Skip to content

Maintenance: move table seeding into custom resource #1315

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

Closed
1 of 2 tasks
dreamorosi opened this issue Feb 21, 2023 · 1 comment · Fixed by #1317
Closed
1 of 2 tasks

Maintenance: move table seeding into custom resource #1315

dreamorosi opened this issue Feb 21, 2023 · 1 comment · Fixed by #1317
Assignees
Labels
completed This item is complete and has been merged/shipped parameters This item relates to the Parameters Utility tests PRs that add or change tests

Comments

@dreamorosi
Copy link
Contributor

Summary

Currently as part of the integration tests of the Parameters utility we are creating a number of resources. For DynamoDBProvider specifically we are creating some DynamoDB Tables and then inserting some items into it, so that the integration tests can read them.

The current implementation of the tests relies on the AWS SDK to perform those inserts as part of the setup stage (beforeAll in Jest). This means that the IAM role/identity used is the one assumed by the GitHub Actions worker and obtained via OIDC connector.

Why is this needed?

The current implementation would require to grant additional permissions to the IAM role assumed by the GitHub Actions worker, which we want to avoid.

Which area does this relate to?

Tests, Parameters

Solution

Move those actions into the stack and do the inserts as part of the deployment. Specifically, given the simplicity of the commands, it's possible to use AwsCustomResource. This will allow us to not grant additional permissions to the worker and delegate the responsibility of communicate with the tables to a custom resource within the stack.

Acknowledgment

@dreamorosi dreamorosi converted this from a draft issue Feb 21, 2023
@dreamorosi dreamorosi self-assigned this Feb 21, 2023
@dreamorosi dreamorosi added this to the Idempotency - Beta release milestone Feb 21, 2023
@dreamorosi dreamorosi added parameters This item relates to the Parameters Utility confirmed The scope is clear, ready for implementation tests PRs that add or change tests labels Feb 21, 2023
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in AWS Lambda Powertools for TypeScript Feb 21, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Feb 21, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon confirmed The scope is clear, ready for implementation labels Feb 21, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped parameters This item relates to the Parameters Utility tests PRs that add or change tests
Projects
None yet
1 participant