Skip to content

feat(s3): attribute-based access control#36229

Merged
mergify[bot] merged 17 commits intoaws:mainfrom
badmintoncryer:s3-abac
Feb 23, 2026
Merged

feat(s3): attribute-based access control#36229
mergify[bot] merged 17 commits intoaws:mainfrom
badmintoncryer:s3-abac

Conversation

@badmintoncryer
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@go-to-k I've updated!

@go-to-k
Copy link
Copy Markdown
Contributor

go-to-k commented Nov 28, 2025

@badmintoncryer

Did you forget to push your commit? :)

#36229 (comment)

@badmintoncryer
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 6, 2025

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results24 ran24 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 6, 2025

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates24 ran24 passed
TestResult
No test annotations available

Copy link
Copy Markdown
Contributor

@kumsmrit kumsmrit left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution; I have added few minor comments.

## Attribute-Based Access Control (ABAC)

You can enable ABAC (Attribute-Based Access Control) for an S3 general purpose bucket.
When ABAC is enabled for the general purpose bucket, you can use tags to manage access to the general purpose buckets as well as for cost tracking purposes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also describe the disabled case for completeness?
"When ABAC is disabled for the general purpose buckets, you can only use tags for cost tracking purposes."

@kumsmrit kumsmrit self-assigned this Feb 23, 2026
Co-authored-by: kumsmrit <154323786+kumsmrit@users.noreply.github.com>
@mergify mergify bot dismissed kumsmrit’s stale review February 23, 2026 12:37

Pull request has been modified.

Co-authored-by: kumsmrit <154323786+kumsmrit@users.noreply.github.com>
@aws-cdk-automation aws-cdk-automation removed the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Feb 23, 2026
@badmintoncryer
Copy link
Copy Markdown
Contributor Author

@kumsmrit Thank you for your review!! I've addressed all of your comments.

Copy link
Copy Markdown
Contributor

@kumsmrit kumsmrit left a comment

Choose a reason for hiding this comment

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

Thank you for addressing the comments.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 23, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 23, 2026

Merge Queue Status

Rule: default-squash


  • Entered queue2026-02-23 17:34 UTC
  • Checks passed · in-place
  • Merged2026-02-23 18:05 UTC · at 16a768c755047fdba33e008f2709362b2c109992

This pull request spent 30 minutes 21 seconds in the queue, including 30 minutes 10 seconds running CI.

Required conditions to merge

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Feb 23, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 9ec4db3 into aws:main Feb 23, 2026
22 of 23 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Feb 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants