Skip to content

Commit

Permalink
Merge pull request #155 from TerraHubCorp/update_components
Browse files Browse the repository at this point in the history
Update components
  • Loading branch information
Vitalie Calmîc authored Dec 5, 2019
2 parents f316911 + a25f510 commit 74849a3
Show file tree
Hide file tree
Showing 26 changed files with 143 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ component:
split("|",
local.elements_landing_zone_config_configuration_aggregator_map["config_${count.index}"]["regions"])
tags: >-
local.elements_landing_zone_config_configuration_aggregator_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_config_configuration_aggregator_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_config_configuration_aggregator_map["config_${count.index}"]["name"]}")))
output:
arns:
value: >-
Expand All @@ -31,5 +35,6 @@ component:
value: >-
{ for config_configuration_aggregator in
aws_config_configuration_aggregator.landing_zone_config_configuration_aggregator.*:
config_configuration_aggregator.tags["Name"] =>
lookup(config_configuration_aggregator.tags, "LzHash",
config_configuration_aggregator.arn) =>
config_configuration_aggregator.arn }
12 changes: 9 additions & 3 deletions components/landing_zone_config_config_rule/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ component:
source_identifier: >-
local.elements_landing_zone_config_config_rule_map["config_${count.index}"]["source_identifier"]
tags: >-
local.elements_landing_zone_config_config_rule_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_config_config_rule_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_config_config_rule_map["config_${count.index}"]["name"]}")))
output:
arns:
value: aws_config_config_rule.landing_zone_config_config_rule.*.arn
Expand All @@ -32,9 +36,11 @@ component:
value: >-
{ for config_config_rule in
aws_config_config_rule.landing_zone_config_config_rule.*:
config_config_rule.tags["Name"] => config_config_rule.arn }
lookup(config_config_rule.tags, "LzHash", config_config_rule.arn) =>
config_config_rule.arn }
landing_zone_config_config_rule_rule_ids:
value: >-
{ for config_config_rule in
aws_config_config_rule.landing_zone_config_config_rule.*:
config_config_rule.tags["Name"] => config_config_rule.rule_id }
lookup(config_config_rule.tags, "LzHash", config_config_rule.arn) =>
config_config_rule.rule_id }
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ component:
account_id: 'var.${tfvar.terrahub["landing_zone_providers"]["0"]}_account_id'
region: 'var.${tfvar.terrahub["landing_zone_providers"]["0"]}_region'
tags: >-
local.elements_config_aggregate_authorization_tags_map["config_${count.index}"]
merge(local.elements_config_aggregate_authorization_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
output:
arns:
value: >-
Expand All @@ -22,5 +25,6 @@ component:
value: >-
{ for config_aggregate_authorization in
aws_config_aggregate_authorization.landing_zone_config_aggregate_authorization.*:
config_aggregate_authorization.tags["Name"] =>
lookup(config_aggregate_authorization.tags, "LzHash",
config_aggregate_authorization.id) =>
config_aggregate_authorization.arn }
14 changes: 10 additions & 4 deletions components/landing_zone_eip/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ component:
provider: 'aws.${tfvar.terrahub["landing_zone_providers"]["0"]}'
count: >-
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_eip_resource"])
tags: 'local.elements_landing_zone_eip_tags_map["config_${count.index}"]'
tags: >-
merge(local.elements_landing_zone_eip_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
vpc: 'local.elements_landing_zone_eip_map["config_${count.index}"]["vpc"]'
output:
ids:
Expand All @@ -22,8 +26,10 @@ component:
public_ips:
value: aws_eip.landing_zone_eip.*.public_ip
landing_zone_eip_ids:
value: '{ for eip in aws_eip.landing_zone_eip.*: eip.tags["Name"] => eip.id }'
value: >-
{ for eip in aws_eip.landing_zone_eip.*: lookup(eip.tags, "LzHash",
eip.id) => eip.id }
landing_zone_eip_public_ips:
value: >-
{ for eip in aws_eip.landing_zone_eip.*: eip.tags["Name"] =>
eip.public_ip }
{ for eip in aws_eip.landing_zone_eip.*: lookup(eip.tags, "LzHash",
eip.id) => eip.public_ip }
7 changes: 5 additions & 2 deletions components/landing_zone_gateway_cgw/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ component:
type: >-
local.elements_landing_zone_gateway_cgw_map["config_${count.index}"]["type"]
tags: >-
local.elements_landing_zone_gateway_cgw_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_gateway_cgw_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
output:
ids:
value: aws_customer_gateway.landing_zone_gateway_cgw.*.id
Expand All @@ -30,4 +33,4 @@ component:
landing_zone_gateway_cgw_ids:
value: >-
{ for gateway_cgw in aws_customer_gateway.landing_zone_gateway_cgw.*:
gateway_cgw.tags["Name"] => gateway_cgw.id }
lookup(gateway_cgw.tags, "LzHash", gateway_cgw.id) => gateway_cgw.id }
10 changes: 7 additions & 3 deletions components/landing_zone_gateway_nat/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ component:
allocation_id: 'element(data.aws_eip.eip_selected.*.id, count.index)'
subnet_id: 'element(data.aws_subnet.subnet_selected.*.id, count.index)'
tags: >-
local.elements_landing_zone_gateway_nat_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_gateway_nat_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
output:
ids:
value: aws_nat_gateway.landing_zone_gateway_nat.*.id
Expand All @@ -56,8 +59,9 @@ component:
landing_zone_gateway_nat_ids:
value: >-
{ for gateway_nat in aws_nat_gateway.landing_zone_gateway_nat.*:
gateway_nat.tags["Name"] => gateway_nat.id }
lookup(gateway_nat.tags, "LzHash", gateway_nat.id) => gateway_nat.id }
landing_zone_gateway_nat_network_interface_ids:
value: >-
{ for gateway_nat in aws_nat_gateway.landing_zone_gateway_nat.*:
gateway_nat.tags["Name"] => gateway_nat.network_interface_id }
lookup(gateway_nat.tags, "LzHash", gateway_nat.id) =>
gateway_nat.network_interface_id }
7 changes: 5 additions & 2 deletions components/landing_zone_gateway_tgw/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ component:
vpn_ecmp_support: >-
local.elements_landing_zone_gateway_tgw_map["config_${count.index}"]["vpn_ecmp_support"]
tags: >-
local.elements_landing_zone_gateway_tgw_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_gateway_tgw_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
output:
ids:
value: aws_ec2_transit_gateway.landing_zone_gateway_tgw.*.id
Expand All @@ -39,4 +42,4 @@ component:
value: >-
{ for gateway_tgw in
aws_ec2_transit_gateway.landing_zone_gateway_tgw.*:
gateway_tgw.tags["Name"] => gateway_tgw.id }
lookup(gateway_tgw.tags, "LzHash", gateway_tgw.id) => gateway_tgw.id }
7 changes: 5 additions & 2 deletions components/landing_zone_gateway_vgw/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ component:
availability_zone: >-
local.elements_landing_zone_gateway_vgw_map["config_${count.index}"]["availability_zone"]
tags: >-
local.elements_landing_zone_gateway_vgw_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_gateway_vgw_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
output:
ids:
value: aws_vpn_gateway.landing_zone_gateway_vgw.*.id
Expand All @@ -37,4 +40,4 @@ component:
landing_zone_gateway_vgw_ids:
value: >-
{ for gateway_vgw in aws_vpn_gateway.landing_zone_gateway_vgw.*:
gateway_vgw.tags["Name"] => gateway_vgw.id }
lookup(gateway_vgw.tags, "LzHash", gateway_vgw.id) => gateway_vgw.id }
7 changes: 5 additions & 2 deletions components/landing_zone_network_acl/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ component:
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_network_acl_resource"])
vpc_id: 'element(data.aws_vpc.vpc_selected.*.id, count.index)'
tags: >-
local.elements_landing_zone_network_acl_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_network_acl_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
subnet_ids: >-
slice(data.aws_subnet.subnet_selected.*.id,
local.elements_landing_zone_network_acl_map["config_${count.index}"]["subnets_from_index"],
Expand All @@ -52,4 +55,4 @@ component:
landing_zone_network_acl_ids:
value: >-
{ for network_acl in aws_network_acl.landing_zone_network_acl.*:
network_acl.tags["Name"] => network_acl.id }
lookup(network_acl.tags, "LzHash", network_acl.id) => network_acl.id }
4 changes: 2 additions & 2 deletions components/landing_zone_route/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ component:
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_route_table_data"])
vpc_id: 'element(data.aws_vpc.vpc_selected.*.id, count.index)'
filter:
name: 'tag:Name'
name: 'tag:LzHash'
values:
- >-
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["name"]
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["LzHash"]
resource:
aws_route:
landing_zone_route:
Expand Down
4 changes: 2 additions & 2 deletions components/landing_zone_route_nat/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ component:
- >-
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["LzHash"]
aws_nat_gateway:
aws_nat_gateway:
aws_nat_gateway_selected:
provider: 'aws.${tfvar.terrahub["landing_zone_providers"]["0"]}'
count: >-
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_gateway_nat_data"])
Expand All @@ -53,7 +53,7 @@ component:
destination_cidr_block: >-
local.elements_landing_zone_route_nat_map["config_${count.index}"]["destination_cidr_block"]
nat_gateway_id: >-
element(distinct(data.aws_nat_gateway.aws_nat_gateway.*.id),
element(data.aws_nat_gateway.aws_nat_gateway_selected.*.id,
count.index)
output:
ids:
Expand Down
4 changes: 2 additions & 2 deletions components/landing_zone_route_table_association/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ component:
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_route_table_data"])
vpc_id: 'element(data.aws_vpc.vpc_selected.*.id, count.index)'
filter:
- name: 'tag:Name'
- name: 'tag:LzHash'
values:
- >-
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["filter_tag_name"]
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["LzHash"]
- name: association.main
values:
- >-
Expand Down
8 changes: 6 additions & 2 deletions components/landing_zone_route_table_tgw/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ component:
element(data.aws_ec2_transit_gateway.gateway_tgw_selected.*.id,
count.index)
tags: >-
local.elements_landing_zone_route_table_tgw_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_route_table_tgw_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]} ${count.index}")))
output:
ids:
value: aws_route_table.landing_zone_route_table_tgw.*.id
Expand All @@ -39,4 +42,5 @@ component:
value: >-
{ for route_table_tgw in
aws_route_table.landing_zone_route_table_tgw.*:
route_table_tgw.tags["Name"] => route_table_tgw.id }
lookup(route_table_tgw.tags, "LzHash", route_table_tgw.id) =>
route_table_tgw.id }
8 changes: 4 additions & 4 deletions components/landing_zone_route_vgw/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ component:
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_route_table_data"])
vpc_id: 'element(data.aws_vpc.vpc_selected.*.id, count.index)'
filter:
name: 'tag:Name'
name: 'tag:LzHash'
values:
- >-
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["name"]
local.elements_landing_zone_route_table_data_map["config_${count.index}"]["LzHash"]
aws_vpn_gateway:
aws_vpn_gateway:
provider: 'aws.${tfvar.terrahub["landing_zone_providers"]["0"]}'
count: >-
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_gateway_vgw_data"])
attached_vpc_id: 'element(data.aws_vpc.vpc_selected.*.id, count.index)'
filter:
- name: 'tag:Name'
- name: 'tag:LzHash'
values:
- >-
local.elements_landing_zone_gateway_vgw_data_map["config_${count.index}"]["name"]
local.elements_landing_zone_gateway_vgw_data_map["config_${count.index}"]["LzHash"]
resource:
aws_route:
landing_zone_route_vgw:
Expand Down
6 changes: 5 additions & 1 deletion components/landing_zone_secretsmanager_secret/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ component:
recovery_window_in_days: >-
local.elements_landing_zone_secretsmanager_secret_map["config_${count.index}"]["recovery_window_in_days"]
tags: >-
local.elements_landing_zone_secretsmanager_secret_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_secretsmanager_secret_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_secretsmanager_secret_map["config_${count.index}"]["name"]}")))
output:
ids:
value: aws_secretsmanager_secret.landing_zone_secretsmanager_secret.*.id
Expand Down
6 changes: 5 additions & 1 deletion components/landing_zone_sns_topic/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ component:
sqs_failure_feedback_role_arn: >-
local.elements_landing_zone_sns_topic_map["config_${count.index}"]["sqs_failure_feedback_role_arn"]
tags: >-
local.elements_landing_zone_sns_topic_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_sns_topic_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_sns_topic_map["config_${count.index}"]["name"]}")))
output:
ids:
value: aws_sns_topic.landing_zone_sns_topic.*.id
Expand Down
6 changes: 5 additions & 1 deletion components/landing_zone_ssm_activation/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ component:
registration_limit: >-
local.elements_landing_zone_ssm_activation_map["config_${count.index}"]["registration_limit"]
tags: >-
local.elements_landing_zone_ssm_activation_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_ssm_activation_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_ssm_activation_map["config_${count.index}"]["name"]}")))
output:
ids:
value: aws_ssm_activation.landing_zone_ssm_activation.*.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ component:
count: >-
length(var.${tfvar.terrahub["landing_zone_providers"]["0"]}_provider["landing_zone_instance_data"])
filter:
name: 'tag:Name'
name: 'tag:LzHash'
values:
- >-
local.elements_landing_zone_instance_data_map["config_${count.index}"]["name"]
local.elements_landing_zone_instance_data_map["config_${count.index}"]["LzHash"]
resource:
aws_ssm_association:
landing_zone_ssm_association_by_instance_id:
Expand Down
12 changes: 9 additions & 3 deletions components/landing_zone_ssm_document/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ component:
account_ids: >-
local.elements_landing_zone_ssm_document_map["config_${count.index}"]["permissions_account_ids"]
tags: >-
local.elements_landing_zone_ssm_document_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_ssm_document_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_ssm_document_map["config_${count.index}"]["name"]}")))
output:
created_dates:
value: aws_ssm_document.landing_zone_ssm_document.*.created_date
Expand All @@ -53,8 +57,10 @@ component:
landing_zone_ssm_document_created_dates:
value: >-
{ for ssm_document in aws_ssm_document.landing_zone_ssm_document.*:
ssm_document.tags["Name"] => ssm_document.created_date }
lookup(ssm_document.tags, "LzHash", ssm_document.hash) =>
ssm_document.created_date }
landing_zone_ssm_document_hashes:
value: >-
{ for ssm_document in aws_ssm_document.landing_zone_ssm_document.*:
ssm_document.tags["Name"] => ssm_document.hash }
lookup(ssm_document.tags, "LzHash", ssm_document.hash) =>
ssm_document.hash }
9 changes: 7 additions & 2 deletions components/landing_zone_ssm_maintenance_window/.terrahub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ component:
start_date: >-
local.elements_landing_zone_ssm_maintenance_window_map["config_${count.index}"]["start_date"]
tags: >-
local.elements_landing_zone_ssm_maintenance_window_tags_map["config_${count.index}"]
merge(local.elements_landing_zone_ssm_maintenance_window_tags_map["config_${count.index}"],
map("LzHash", sha1("${tfvar.terrahub["project"]["code"]}
${tfvar.terrahub["component"]["name"]}
${tfvar.terrahub["landing_zone_providers"]["0"]}
${local.elements_landing_zone_ssm_maintenance_window_map["config_${count.index}"]["name"]}")))
output:
ids:
value: aws_ssm_maintenance_window.landing_zone_ssm_maintenance_window.*.id
Expand All @@ -41,4 +45,5 @@ component:
value: >-
{ for ssm_maintenance_window in
aws_ssm_maintenance_window.landing_zone_ssm_maintenance_window.*:
ssm_maintenance_window.tags["Name"] => ssm_maintenance_window.id }
lookup(ssm_maintenance_window.tags, "LzHash",
ssm_maintenance_window.id) => ssm_maintenance_window.id }
Loading

0 comments on commit 74849a3

Please sign in to comment.