Skip to content

Conversation

tsaucier-sf
Copy link
Contributor

@tsaucier-sf tsaucier-sf commented Jan 23, 2024

what

  • Add partition support for sns_kms_key_policy IAM policy.
  • Add additional condition for local.enabled_standards_arns securityhub arn.

why

  • Needs to support multiple available partitions
  • format function fails when local.enabled is false due to data lookups not existing.

references

  • Add dynamic partition to IAM ARN in KMS Key Policy #33
  • Discovered when module is disabled
    Error: Error in function call │  │   on .terraform/modules/cloud_security.security_hub/main.tf line 43, in locals: │   43:     
    format("arn:%s:securityhub:%s::%s", one(data.aws_partition.this[*].partition), length(regexall("ruleset", standard)) == 0 
    ? one(data.aws_region.this[*].name) : "", standard) │     ├──────────────── │     │ data.aws_partition.this 
    is empty tuple │     │ data.aws_region.this is empty tuple │  │ Call to function "format" failed: unsupported value for "%s" at 
    4: null value cannot be formatted. ╵ ╷ │ Error: Error in function call │  │   on 
    .terraform/modules/cloud_security.security_hub/main.tf line 43, in locals: │   43:     format("arn:%s:securityhub:%s::%s", 
    one(data.aws_partition.this[*].partition), length(regexall("ruleset", standard)) == 0 ? one(data.aws_region.this[*].name) : 
    "", standard) │     ├──────────────── │     │ data.aws_partition.this is empty tuple │     │ 
    data.aws_region.this is empty tuple │  │ Call to function "format" failed: unsupported value for "%s" at 4: null value 
    cannot be formatted.
    

@tsaucier-sf tsaucier-sf requested review from a team as code owners January 23, 2024 17:43
@hans-d
Copy link

hans-d commented Mar 2, 2024

/terratest

@hans-d hans-d added terratest-failing stale This PR has gone stale labels Mar 2, 2024
@hans-d hans-d removed the stale This PR has gone stale label Mar 5, 2024
@hans-d
Copy link

hans-d commented Mar 5, 2024

/terratest

@hans-d hans-d merged commit 02d0954 into cloudposse:main Mar 7, 2024
@hans-d
Copy link

hans-d commented Mar 7, 2024

@tsaucier-sf https://github.com/cloudposse/terraform-aws-security-hub/releases/tag/0.12.0 Thanks !

@tsaucier-sf tsaucier-sf deleted the chore/partitions-and-condition-overrides branch March 7, 2024 14:24
@tsaucier-sf tsaucier-sf restored the chore/partitions-and-condition-overrides branch March 7, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants