-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(amplify): add compute role support for Amplify branches #34708
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, I have added some comments
|
@leonmk-aws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for these changes, I added a few comments on the platform field.
| /** | ||
| * The platform of the app | ||
| */ | ||
| readonly platform?: Platform; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not add optional field in the interface that extends iResource, see below one approach on how to do the isSSR check without exposing the field in this interface.
| let computedRole: iam.IRole | undefined; | ||
| const isSSR = props.platform === Platform.WEB_COMPUTE || props.platform === Platform.WEB_DYNAMIC; | ||
| const appPlatform = props.platform || Platform.WEB; | ||
| const isSSR = appPlatform === Platform.WEB_COMPUTE || appPlatform === Platform.WEB_DYNAMIC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider adding a function in the utils.ts file, to share it between app.ts and branch.ts
| // Enhanced CDK Analytics Telemetry | ||
| addConstructMetadata(this, props); | ||
|
|
||
| const platform = props.app.platform; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of relying on the IApp interface to have an optional platform field, another approach would be to check if if (props.app instanceof App) is true and use the platform attribute of this class to perform the isSSR check.
c5d8a9f to
052bb10
Compare
|
@leonmk-aws I've fixed a validation based on the comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes, approved
|
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
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). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
N/A
Reason for this change
Amplify supports branch-level compute role setting.
But current L2 Construct doesn't support it.
Description of changes
Add
computeRoleproperty forBranchconstruct.Describe any new or updated permissions being added
N/A
Description of how you validated changes
Add a unit test and an integ test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license