File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,19 @@ locals {
4343 share_service_network = local. config_ram_share ? local. create_service_network && try (var. ram_share . share_service_network , true ) : false
4444 # Default of var.ram_share.share_services - if not defined, all the created services will be included
4545 share_services = try (var. ram_share . share_services , keys (var. services ))
46+ # Support RAM share of services managed by the module as well as external ones
47+ ram_services_association_resources = {
48+ for svc in local . share_services :
49+ svc = > lookup (
50+ aws_vpclattice_service. lattice_service ,
51+ svc,
52+ lookup (
53+ data. aws_vpclattice_service . lattice_service ,
54+ svc,
55+ null
56+ )
57+ )
58+ }
4659 # Move var.ram_share.principals from list(string) to map(string)
4760 principals_map = { for index , principal in try (var. ram_share . principals , []) : index => principal }
4861}
Original file line number Diff line number Diff line change @@ -278,6 +278,6 @@ resource "aws_ram_resource_association" "ram_service_network_association" {
278278resource "aws_ram_resource_association" "ram_services_association" {
279279 count = local. config_ram_share ? length (local. share_services ) : 0
280280
281- resource_arn = aws_vpclattice_service . lattice_service [local . share_services [count . index ]]. arn
281+ resource_arn = local . ram_services_association_resources [local . share_services [count . index ]]. arn
282282 resource_share_arn = local. resource_share_arn
283283}
You can’t perform that action at this time.
0 commit comments