-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws_resource_access_manager.tf
40 lines (33 loc) · 1.26 KB
/
aws_resource_access_manager.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
###############################################################################
### RESOURCE ACCESS MANAGER (RAM)
###############################################################################
# RAM RESOURCE SHARE
resource "aws_ram_resource_share" "main" {
name = "${var.name}-${terraform.workspace}-main"
allow_external_principals = false
}
# RAM RESOURCE ASSOCIATION
resource "aws_ram_resource_association" "main" {
resource_arn = aws_ec2_transit_gateway.main.arn
resource_share_arn = aws_ram_resource_share.main.arn
}
# RAM PRINCIPAL ASSOCIATION
resource "aws_ram_principal_association" "main" {
principal = var.principal_organization_arn
resource_share_arn = aws_ram_resource_share.main.arn
}
#######################################
# OUTPUTS
#######################################
output "ram_resource_share_id" {
description = "The ID of the RAM Resource Share"
value = [aws_ram_resource_share.main.id]
}
output "ram_resource_association_id" {
description = "The ID of the RAM Resource Association"
value = [aws_ram_resource_association.main.id]
}
output "ram_principal_association_id" {
description = "The ID of the RAM Principal Association"
value = [aws_ram_principal_association.main.id]
}