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

feat: Simplify props for GuLambdaFunction #455

Merged
merged 2 commits into from
Apr 16, 2021
Merged

feat: Simplify props for GuLambdaFunction #455

merged 2 commits into from
Apr 16, 2021

Conversation

akash1810
Copy link
Member

What does this change?

Simplifies the props needed to create a GuLambdaFunction by removing the bucket key in favour of using the GuDistributionBucketParameter singleton.

This brings GuLambdaFunction in line with our EC2 constructs and patterns.

GuDistributionBucketParameter adds an SSM parameter to a stack with a default path of /account/services/artifact.bucket.

BREAKING CHANGE: Shape change to the props for GuLambdaFunction

The code.bucket field has been removed.

Does this change require changes to existing projects or CDK CLI?

Yes. They'll need to update, the diff shouldn't be too difficult though as it's just the removal of a property.

How to test

CI should continue to pass.

How can we measure success?

Providing a simpler API that is consistent between EC2 and Lambda constructs.

Have we considered potential risks?

n/a

@akash1810 akash1810 requested a review from a team April 15, 2021 16:43
Copy link
Contributor

@jacobwinch jacobwinch left a comment

Choose a reason for hiding this comment

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

Good idea 👍

It would be good to document this convention too; feel free to do that later / in a separate PR though if you are trying to make progress with other changes which are dependent on this.

@akash1810
Copy link
Member Author

It would be good to document this convention too

Yes! Not sure where though. Any suggestions?

@jacobwinch
Copy link
Contributor

Yes! Not sure where though. Any suggestions?

Maybe it should go with GuFunctionProps? The lambda-based pattern docs typically point users in this direction, to avoid repeating the same docs in lots of places.

@akash1810
Copy link
Member Author

akash1810 commented Apr 16, 2021

A thought: I think we'd want to enforce the path of the lambda distributable in the bucket, similar to what we do for EC2. #259 tightened the GuGetDistributablePolicy to allow s3:GetObject on the stack/stage/app/* path.

@akash1810
Copy link
Member Author

Another thought, we might benefit from reusing GuUserDataS3DistributableProps in GuFunctionProps? I think that would be +1 to having a top level types directory too.

Simplifies the props needed to create a `GuLambdaFunction` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

This brings `GuLambdaFunction` in line with our EC2 constructs and patterns.

`GuDistributionBucketParameter` adds an SSM parameter to a stack with a default path of `/account/services/artifact.bucket`.

BREAKING CHANGE: Shape change to the props for `GuLambdaFunction`

The `code.bucket` field has been removed.
@akash1810
Copy link
Member Author

Yes! Not sure where though. Any suggestions?

Maybe it should go with GuFunctionProps? The lambda-based pattern docs typically point users in this direction, to avoid repeating the same docs in lots of places.

Added now.

@akash1810 akash1810 merged commit 2692d04 into main Apr 16, 2021
@akash1810 akash1810 deleted the aa-lambda-bucket branch April 16, 2021 09:00
@github-actions
Copy link
Contributor

🎉 This PR is included in version 9.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

akash1810 added a commit that referenced this pull request Apr 19, 2021
Following from #455, simplify the props for `GuUserData` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

BREAKING CHANGE: Shape change to the props for `GuUserData`

The `bucket` field has been removed.
akash1810 added a commit that referenced this pull request Apr 19, 2021
Following from #455, simplify the props for `GuUserData` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

BREAKING CHANGE: Shape change to the props for `GuUserData`

The `bucket` field has been removed.
akash1810 added a commit that referenced this pull request Apr 20, 2021
Following from #455, simplify the props for `GuUserData` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

BREAKING CHANGE: Shape change to the props for `GuUserData`

The `bucket` field has been removed.
akash1810 added a commit that referenced this pull request Apr 20, 2021
Following from #455, simplify the props for `GuUserData` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

BREAKING CHANGE: Shape change to the props for `GuUserData`

The `bucket` field has been removed.
akash1810 added a commit that referenced this pull request Apr 20, 2021
Following from #455, simplify the props for `GuUserData` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

BREAKING CHANGE: Shape change to the props for `GuUserData`

The `bucket` field has been removed and we'll automatically use `GuDistributionBucketParameter`.
akash1810 added a commit that referenced this pull request Apr 20, 2021
Following from #455, simplify the props for `GuUserData` by removing the bucket key in favour of using the `GuDistributionBucketParameter` singleton.

BREAKING CHANGE: Shape change to the props for `GuUserData`

The `bucket` field has been removed and we'll automatically use `GuDistributionBucketParameter`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants