Skip to content

Conversation

@9pace
Copy link
Contributor

@9pace 9pace commented Sep 30, 2025

Issue # (if applicable)

Closes #34322

Reason for this change

Fixes synthesis error: 'Supplied properties not correct for CfnBucketPolicyProps: policyDocument: required but missing'

Description of changes

  • Fix synthesis error where duplicate CfnBucketPolicy was created without policyDocument
  • Ensure PolicyDocument is properly passed from original CfnBucketPolicy to constructor
  • Maintains existing behavior while fixing synthesis bug

Description of how you validated changes

  • Add test to verify synthesis works and duplicate resources are created as expected

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team September 30, 2025 14:42
@github-actions github-actions bot added the p2 label Sep 30, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 30, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@@ -1,3 +1,13 @@
import test from 'node:test';
import test from 'node:test';
import test from 'node:test';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
import test from 'node:test';

import test from 'node:test';
import test from 'node:test';
import { describe } from 'node:test';
import test from 'node:test';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
import test from 'node:test';

import test from 'node:test';
import { describe } from 'node:test';
import test from 'node:test';
import test from 'node:test';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
import test from 'node:test';

import { describe } from 'node:test';
import test from 'node:test';
import test from 'node:test';
import test from 'node:test';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
import test from 'node:test';

- Fix synthesis error where duplicate CfnBucketPolicy was created without policyDocument
- Ensure PolicyDocument is properly passed from original CfnBucketPolicy to constructor
- Add test to verify synthesis works and duplicate resources are created as expected
- Maintains existing behavior while fixing synthesis bug

Fixes synthesis error: 'Supplied properties not correct for CfnBucketPolicyProps: policyDocument: required but missing'
@9pace 9pace force-pushed the 9pace/fix-bucket-policy-synthesis-error branch from b3ab538 to 1aafcbc Compare September 30, 2025 14:48
Remove duplicate 'import test from node:test' statements that were
accidentally added during rebase/merge
@kaizencc kaizencc added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Sep 30, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 30, 2025 17:51

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 30, 2025
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

looks good! just a minor comment about the test itself. actual code looks great :)

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 30, 2025
- Remove redundant app.synth() call since Template.fromStack() already synthesizes
- Add more comprehensive validation of policy documents
- Improve test clarity and comments
- Address reviewer feedback from kaizencc
@9pace 9pace self-assigned this Oct 1, 2025
@9pace 9pace requested a review from kaizencc October 1, 2025 18:23
@mergify
Copy link
Contributor

mergify bot commented Oct 1, 2025

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
Contributor

mergify bot commented Oct 2, 2025

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).

@9pace 9pace closed this Oct 2, 2025
@9pace 9pace reopened this Oct 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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
Copy link
Contributor

github-actions bot commented Oct 2, 2025

This issue has been reopened and is now available for discussion.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2025
@github-actions github-actions bot unlocked this conversation Oct 2, 2025
@mergify
Copy link
Contributor

mergify bot commented Oct 2, 2025

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 added the queued label Oct 2, 2025
@mergify
Copy link
Contributor

mergify bot commented Oct 2, 2025

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
Contributor

mergify bot commented Oct 2, 2025

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 d9085cc into main Oct 2, 2025
19 checks passed
@mergify mergify bot deleted the 9pace/fix-bucket-policy-synthesis-error branch October 2, 2025 18:12
@mergify mergify bot removed the queued label Oct 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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 Oct 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

s3: BucketPolicy.fromCfnBucketPolicy causes a SynthesisError

3 participants