Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GuKCLPolicy: Fix DynamoDB permissions on new KCL v3 tables #2600

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

rtyley
Copy link
Member

@rtyley rtyley commented Feb 27, 2025

In PR #2578 I failed to grant the UpdateItem & DeleteItem permissions on these two new KCL v3 tables:

...the permissions were correctly granted on the existing 'lease' table, so existing code based on KCL v2, worked, but as soon as the code was updated to KCL v3, errors started:

User: arn:aws:sts::308506855511:assumed-role/content-api-CODE-apple-ne-InstanceRoleApplenews9EF-UAETULBM8AA1/i-084355a59df3f277c is not authorized to perform: dynamodb:UpdateItem on resource: arn:aws:dynamodb:eu-west-1:308506855511:table/content-api-firehose-v2-PROD_apple-news-CODE-LIVE-WorkerMetricStats

This fix correctly grants the UpdateItem & DeleteItem permissions to all 3 tables. UpdateTable is now the only permission granted solely on to the 'lease' table.

For reference, the full list of IAM permissions for KCL v3 are at:

image

Copy link

changeset-bot bot commented Feb 27, 2025

🦋 Changeset detected

Latest commit: 57ed86d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/cdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rtyley rtyley force-pushed the fix-dynamodb-permissions-for-GuKCLPolicy branch 4 times, most recently from 96477f6 to 6ed3232 Compare February 27, 2025 13:55
@rtyley rtyley marked this pull request as ready for review February 27, 2025 13:55
@rtyley rtyley requested a review from akash1810 February 27, 2025 13:55
In PR #2578 I failed to give the `UpdateItem` & `DeleteItem`
permissions on these new KCL v3 tables:

* worker metrics: https://docs.aws.amazon.com/streams/latest/dev/kcl-dynamoDB.html#kcl-worker-metrics-table
* coordinator state: https://docs.aws.amazon.com/streams/latest/dev/kcl-dynamoDB.html#kcl-coordinator-state-table

...the permissions were correctly granted on the 'lease' table, so existing code, based on KCL v2, _worked_
(as seen in guardian/apple-news#426 (comment)), but as soon as
the code was updated to KCL v3, errors were seen:

guardian/apple-news#398 (comment)

This fix correctly grants the `UpdateItem` & `DeleteItem` permissions to all 3 tables.

For reference, the full list of permissions are at: https://docs.aws.amazon.com/streams/latest/dev/kcl-iam-permissions.html
@rtyley rtyley force-pushed the fix-dynamodb-permissions-for-GuKCLPolicy branch from 6ed3232 to 57ed86d Compare February 27, 2025 14:07
@rtyley rtyley merged commit 82b3422 into main Feb 28, 2025
4 checks passed
@rtyley rtyley deleted the fix-dynamodb-permissions-for-GuKCLPolicy branch February 28, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants