-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0997c45
feat(amplify): add compute role support for Amplify branches
mazyu36 5eee1ea
fix readme
mazyu36 d407d28
Merge branch 'main' into feature/branch-compute-role
mazyu36 0cfeb39
fix
mazyu36 a7dd592
add validation
mazyu36 bab1ebc
fix integ
mazyu36 052bb10
addressed review comments
mazyu36 d26173b
fix
mazyu36 30ea997
Merge branch 'main' into feature/branch-compute-role
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,12 @@ | ||
| import { Platform } from './app'; | ||
|
|
||
| export function renderEnvironmentVariables(vars: { [name: string]: string }) { | ||
| return Object.entries(vars).map(([name, value]) => ({ name, value })); | ||
| } | ||
|
|
||
| /** | ||
| * Utility function to check if the platform is a server-side rendering platform | ||
| */ | ||
| export function isServerSideRendered(platform?: Platform): boolean { | ||
| return platform === Platform.WEB_COMPUTE || platform === Platform.WEB_DYNAMIC; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...pute-role.js.snapshot/amplifybranchcomputeroleDefaultTestDeployAssert73C754F8.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...te-role.js.snapshot/amplifybranchcomputeroleDefaultTestDeployAssert73C754F8.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...ha/test/integ.branch-compute-role.js.snapshot/cdk-amplify-branch-compute-role.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
134 changes: 134 additions & 0 deletions
134
.../test/integ.branch-compute-role.js.snapshot/cdk-amplify-branch-compute-role.template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| { | ||
| "Resources": { | ||
| "ComputeRole65BDBE3E": { | ||
| "Type": "AWS::IAM::Role", | ||
| "Properties": { | ||
| "AssumeRolePolicyDocument": { | ||
| "Statement": [ | ||
| { | ||
| "Action": "sts:AssumeRole", | ||
| "Effect": "Allow", | ||
| "Principal": { | ||
| "Service": "amplify.amazonaws.com" | ||
| } | ||
| } | ||
| ], | ||
| "Version": "2012-10-17" | ||
| } | ||
| } | ||
| }, | ||
| "AppRole1AF9B530": { | ||
| "Type": "AWS::IAM::Role", | ||
| "Properties": { | ||
| "AssumeRolePolicyDocument": { | ||
| "Statement": [ | ||
| { | ||
| "Action": "sts:AssumeRole", | ||
| "Effect": "Allow", | ||
| "Principal": { | ||
| "Service": "amplify.amazonaws.com" | ||
| } | ||
| } | ||
| ], | ||
| "Version": "2012-10-17" | ||
| } | ||
| } | ||
| }, | ||
| "AppComputeRole426920E4": { | ||
| "Type": "AWS::IAM::Role", | ||
| "Properties": { | ||
| "AssumeRolePolicyDocument": { | ||
| "Statement": [ | ||
| { | ||
| "Action": "sts:AssumeRole", | ||
| "Effect": "Allow", | ||
| "Principal": { | ||
| "Service": "amplify.amazonaws.com" | ||
| } | ||
| } | ||
| ], | ||
| "Version": "2012-10-17" | ||
| } | ||
| } | ||
| }, | ||
| "AppF1B96344": { | ||
| "Type": "AWS::Amplify::App", | ||
| "Properties": { | ||
| "BasicAuthConfig": { | ||
| "EnableBasicAuth": false | ||
| }, | ||
| "CacheConfig": { | ||
| "Type": "AMPLIFY_MANAGED_NO_COOKIES" | ||
| }, | ||
| "ComputeRoleArn": { | ||
| "Fn::GetAtt": [ | ||
| "AppComputeRole426920E4", | ||
| "Arn" | ||
| ] | ||
| }, | ||
| "IAMServiceRole": { | ||
| "Fn::GetAtt": [ | ||
| "AppRole1AF9B530", | ||
| "Arn" | ||
| ] | ||
| }, | ||
| "Name": "App", | ||
| "Platform": "WEB_COMPUTE" | ||
| } | ||
| }, | ||
| "AppmainF505BAED": { | ||
| "Type": "AWS::Amplify::Branch", | ||
| "Properties": { | ||
| "AppId": { | ||
| "Fn::GetAtt": [ | ||
| "AppF1B96344", | ||
| "AppId" | ||
| ] | ||
| }, | ||
| "BranchName": "main", | ||
| "ComputeRoleArn": { | ||
| "Fn::GetAtt": [ | ||
| "ComputeRole65BDBE3E", | ||
| "Arn" | ||
| ] | ||
| }, | ||
| "EnableAutoBuild": true, | ||
| "EnablePullRequestPreview": true | ||
| } | ||
| } | ||
| }, | ||
| "Parameters": { | ||
| "BootstrapVersion": { | ||
| "Type": "AWS::SSM::Parameter::Value<String>", | ||
| "Default": "/cdk-bootstrap/hnb659fds/version", | ||
| "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
| } | ||
| }, | ||
| "Rules": { | ||
| "CheckBootstrapVersion": { | ||
| "Assertions": [ | ||
| { | ||
| "Assert": { | ||
| "Fn::Not": [ | ||
| { | ||
| "Fn::Contains": [ | ||
| [ | ||
| "1", | ||
| "2", | ||
| "3", | ||
| "4", | ||
| "5" | ||
| ], | ||
| { | ||
| "Ref": "BootstrapVersion" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.