Skip to content

(bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN value #921

Description

@jasondbaker

We use a cross-account KMS key to encrypt CDK S3 buckets. When the ARN for this key is provided as the FileAssetsBucketKmsKeyId parameter value, the template generates an invalid policy statement. The parameter description notes that this can be either a KMS key ID or ARN value.

- Fn::Sub: arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${FileAssetsBucketKmsKeyId}

Activity

  1. changed the title [-]FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN value[/-] [+](bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN value[/+] on Nov 14, 2025
  2. added theissue type on Mar 27, 2026
  3. lemon0333 commented on Aug 22, 2026

    @lemon0333
    Contributor

    I'd like to take this. Approach: the bootstrap template's FilePublishingRoleDefaultPolicy always builds the KMS resource ARN as arn:${Partition}:kms:${Region}:${AccountId}:key/${FileAssetsBucketKmsKeyId}, which breaks when FileAssetsBucketKmsKeyId is already a full key ARN (as the parameter description permits) — producing a malformed ...:key/arn:aws:kms:.... I'll add a CFN condition that detects when the value already starts with arn: and, in that case, use it directly as the resource; otherwise keep the existing key-id construction. The AWS_MANAGED_KEY/create-new-key paths are unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions