Skip to content

Conversation

@Abogical
Copy link
Member

@Abogical Abogical commented Nov 27, 2025

Issue # (if applicable)

Closes #32230.

Reason for this change

Table and TableV2 were adding actions GetShardItem and GetRecord to the table's resource policy for cross-account resources, service and account principals. The issue is that these actions are not supported in the resource policies. Hence creating a deployment failure

Description of changes

Separated these actions to only be added to the IAM principal, but not the resource for Table and TableV2 constructs.

Describe any new or updated permissions being added

No new permissions are added. The GetShardItem and GetRecord permissions are removed for resource policies.

Description of how you validated changes

Unit and Integration tests have been modified. The integration test failed to deploy before the fix, but now it succeeds after this fix.

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 November 27, 2025 15:04
@github-actions github-actions bot added bug This issue is a bug. p0 star-contributor [Pilot] contributed between 25-49 PRs to the CDK labels Nov 27, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 27, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 27, 2025
@rix0rrr rix0rrr changed the title fix(dyanamodb): unsupported actions added to table resource policy fix(dynamodb): unsupported actions added to table resource policy Nov 28, 2025
*/
public readData(grantee: iam.IGrantable): iam.Grant {
const actions = [...perms.READ_DATA_ACTIONS, perms.DESCRIBE_TABLE];
const actions = [...perms.RESOURCE_READ_DATA_ACTIONS, perms.DESCRIBE_TABLE];
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you attach a documentation link which talks about this ?

Mainly a documentation link that talks about the specific actions here being segregated into resource and principal only are limited to their respective counterparts.

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't really find an official documentation that specifies which action is supported by resources and which is only supported by the principal. I only know by deploying these 2 actions that they fail to be attached to the resource.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can see : #36228 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be okay since READ_STREAM_DATA_ACTIONS also contains dynamodb:DescribeStream which is missing from these set of read permissions

This change should be backward compatible with existing setups and avoid giving full stream read accesses to users due to missing permissions

Dynamo DB Actions

@mergify
Copy link
Contributor

mergify bot commented Nov 28, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 38 minutes 53 seconds in the queue, including 38 minutes 45 seconds waiting for CI.
The checks were run in-place.

Required conditions to merge

@mergify
Copy link
Contributor

mergify bot commented Nov 28, 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 Nov 28, 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 10de047 into main Nov 28, 2025
16 of 18 checks passed
@mergify mergify bot deleted the fix-dynamodb-resource-grants branch November 28, 2025 19:22
@github-actions
Copy link
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 Nov 28, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. contribution/core This is a PR that came from AWS. p0 star-contributor [Pilot] contributed between 25-49 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws_dynamodb: Unable to create table with resource policy with certain dynamodb actions

4 participants