Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add perimeter ids in vpc-sc module outputs, fix vpc-sc in project factory module #2335

Merged
merged 3 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fast/stages/2-security/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Some references that might be useful in setting up this stage:

| name | description | sensitive | consumers |
|---|---|:---:|---|
| [kms_keys](outputs.tf#L55) | KMS key ids. | | |
| [tfvars](outputs.tf#L60) | Terraform variable files for the following stages. | ✓ | |
| [vpc_sc_perimeter_default](outputs.tf#L66) | Raw default perimeter resource. | ✓ | |
| [kms_keys](outputs.tf#L65) | KMS key ids. | | |
| [tfvars](outputs.tf#L70) | Terraform variable files for the following stages. | ✓ | |
| [vpc_sc_perimeter_default](outputs.tf#L76) | Raw default perimeter resource. | ✓ | |
<!-- END TFDOC -->
10 changes: 10 additions & 0 deletions fast/stages/2-security/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ locals {
output_kms_keys = { for k in local._output_kms_keys : k.key => k.id }
tfvars = {
kms_keys = local.output_kms_keys
vpc_sc = {
perimeters = {
for k, v in try(module.vpc-sc[0].service_perimeters_regular, {}) :
k => v.id
}
perimeters_bridge = {
for k, v in try(module.vpc-sc[0].service_perimeters_bridge, {}) :
k => v.id
}
}
}
}

Expand Down
9 changes: 8 additions & 1 deletion modules/project-factory/factory-projects.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ locals {
vpc_sc = (
var.data_overrides.vpc_sc != null
? var.data_overrides.vpc_sc
: try(v.vpc_sc, var.data_defaults.vpc_sc, null)
: (
try(v.vpc_sc, null) != null
? merge({
perimeter_bridges = []
is_dry_run = false
}, v.vpc_sc)
: var.data_defaults.vpc_sc
)
)
# non-project resources
service_accounts = try(v.service_accounts, {})
Expand Down
Loading