Skip to content

Conversation

@badmintoncryer
Copy link
Contributor

Issue # (if applicable)

None

Reason for this change

AWS S3 general purpose bucket now supports for Attribute-based access control (ABAC).
https://docs.aws.amazon.com/ja_jp/AmazonS3/latest/userguide/buckets-tagging.html

Description of changes

  • add abacStatus to BucketProps

Describe any new or updated permissions being added

None

Description of how you validated changes

add both unit and integ tests

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

… buckets

- Introduced `abacStatus` property to the S3 bucket construct to enable or disable ABAC.
- Updated integration test to include `abacStatus` for both KMS-encrypted and S3-managed buckets.
- Modified the snapshot to reflect changes in the bucket configuration.
- Enhanced documentation to explain how to enable and disable ABAC for S3 buckets.
@aws-cdk-automation aws-cdk-automation requested a review from a team November 27, 2025 15:10
@github-actions github-actions bot added p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Nov 27, 2025
@aws-cdk-automation aws-cdk-automation added pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Nov 27, 2025
});
});

test.each([true, false])('bucket with ABAC status %s', (abacStatus) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the handling changes based on whether the value is undefined, it's a good idea to also check for undefined with Match.absent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you combine them into one? Because they are tests for a single concern, it will be easier to grasp the test cases than separating them into individual tests.

  test.each([
    [true, 'Enabled'],
    [false, 'Disabled'],
    [undefined, Match.absent()],
  ])('bucket with ABAC status %s', (abacStatus, expected) => {
    const stack = new cdk.Stack();
    new s3.Bucket(stack, 'MyBucket', {
      abacStatus,
    });

    Template.fromStack(stack).hasResourceProperties('AWS::S3::Bucket', {
      AbacStatus: expected,
    });
  });

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 28, 2025
@badmintoncryer
Copy link
Contributor Author

@go-to-k Thank you for your review! I've addressed your comment.

badmintoncryer and others added 2 commits November 28, 2025 21:00
@badmintoncryer
Copy link
Contributor Author

@go-to-k I've updated!

@go-to-k
Copy link
Contributor

go-to-k commented Nov 28, 2025

@badmintoncryer

Did you forget to push your commit? :)

#36229 (comment)

@badmintoncryer
Copy link
Contributor Author

@go-to-k I'm sorry for forgetting to push it.

Copy link
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. pr/needs-maintainer-review This PR needs a review from a Core Team Member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants