Skip to content

fix(terraform): accept every KMS key form the collector accepts - #82

Closed
tim-thacker-nullify wants to merge 1 commit into
fix/terraform-kms-image-regionfrom
fix/terraform-collector-kms-input-forms
Closed

tim-thacker-nullify wants to merge 1 commit into
fix/terraform-kms-image-regionfrom
fix/terraform-collector-kms-input-forms

Conversation

@tim-thacker-nullify

@tim-thacker-nullify tim-thacker-nullify commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Claude

Round-1 review finding F10 on #78. Stacked on fix/terraform-kms-image-region.

#78 added an ARN-only validation to k8s-resources.kms_key_arn, a variable that previously had none. That module writes no IAM policy: it forwards the value to the collector as NULLIFY_KMS_KEY_ARN, which the collector passes to S3 as SSEKMSKeyId. S3 accepts a bare key ID and alias/<name> there, so a caller already passing either now fails at plan on upgrade.

  • k8s-resources.kms_key_arn accepts key ARN, alias ARN, bare key ID and alias/<name>, in any partition (arn:aws[a-z-]*:), in both terraform/ and terraform-v6/
  • nullify-aws-integration.kms_key_arn is unchanged and still ARN-only: it builds IAM policy resources from the parsed ARN
  • README KMS section says which module takes which forms

#81's k8s-resources tests stay green against the new pattern: arn:aws:kms:eu-central-1:111122223333:alias/nullify-customer-uploads still matches, arn:aws:s3:::not-a-key still does not.

No terraform run locally (no local tooling by request); CI validates.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

#78 added an ARN-only validation to k8s-resources.kms_key_arn, but that
module writes no IAM policy: it forwards the value to the collector as
NULLIFY_KMS_KEY_ARN, which S3 takes as SSEKMSKeyId. A caller who passed a
bare key ID or alias/<name> before now fails at plan on upgrade.

- accept key ARN, alias ARN, bare key ID and alias/<name>, in any partition
- nullify-aws-integration keeps the strict ARN form: it builds IAM resources

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tim-thacker-nullify

Copy link
Copy Markdown
Member Author

Claude

Superseded by #78's collapsed stack: this PR's KMS input-form change conflicts with the KMS handling that landed through #78 ← #83 ← #89 ← ... ← #94, so it can no longer merge cleanly.

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.

1 participant