-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathmain.tf
47 lines (35 loc) · 917 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
provider "aws" {
region = "eu-west-1"
# Make it faster by skipping something
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
}
data "aws_organizations_organization" "this" {}
module "eventbridge" {
source = "../../"
bus_name = "${random_pet.this.id}-bus"
create_permissions = true
permissions = {
"099720109477 DevAccess" = {}
"099720109466 ProdAccess" = {
action = "events:PutEvents"
}
"* OrgAccessToExternalBus" = {
event_bus_name = aws_cloudwatch_event_bus.external.name
condition_org = data.aws_organizations_organization.this.id
}
}
tags = {
Name = "${random_pet.this.id}-bus"
}
}
##################
# Extra resources
##################
resource "random_pet" "this" {
length = 2
}
resource "aws_cloudwatch_event_bus" "external" {
name = "${random_pet.this.id}-external"
}