Last active
January 23, 2021 06:19
-
-
Save sasaken555/524337a57dffface0a21c229476cdc00 to your computer and use it in GitHub Desktop.
AWS Amplify application stack. Once pushed your source to CodeCommit, an application will be built and published!
This file contains 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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: Frontend application hosted by Amplify | |
Parameters: | |
AppName: | |
Type: String | |
Default: my-app | |
Description: Amplify application name | |
AppRolePolicyName: | |
Type: String | |
Default: AppRoleDefaultPolicy | |
Description: Amplify role policy name | |
AppBranchName: | |
Type: String | |
Default: master | |
Description: Amplify application Git branch name to deploy | |
Resources: | |
FrontAppRepository: | |
Type: AWS::CodeCommit::Repository | |
Properties: | |
RepositoryName: | |
Ref: AppName | |
RepositoryDescription: frontend application with your favorite framework. | |
FrontAppAmplifyRole: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Statement: | |
- Action: sts:AssumeRole | |
Effect: Allow | |
Principal: | |
Service: amplify.amazonaws.com | |
Version: "2012-10-17" | |
FrontAppAmplifyRolePolicy: | |
Type: AWS::IAM::Policy | |
Properties: | |
PolicyDocument: | |
Statement: | |
- Action: codecommit:GitPull | |
Effect: Allow | |
Resource: !GetAtt FrontAppAmplifyRole.Arn | |
Version: "2012-10-17" | |
PolicyName: | |
Ref: AppRolePolicyName | |
Roles: | |
- Ref: FrontAppAmplifyRole | |
FrontAppAmplifyApp: | |
Type: AWS::Amplify::App | |
Properties: | |
Name: | |
Ref: AppName | |
IAMServiceRole: | |
Fn::GetAtt: | |
- FrontAppAmplifyRole | |
- Arn | |
Repository: | |
Fn::GetAtt: | |
- FrontAppRepository | |
- CloneUrlHttp | |
FrontAppAmplifyBranch: | |
Type: AWS::Amplify::Branch | |
Properties: | |
AppId: | |
Fn::GetAtt: | |
- FrontAppAmplifyApp | |
- AppId | |
BranchName: | |
Ref: AppBranchName | |
EnableAutoBuild: true | |
EnablePullRequestPreview: true | |
Outputs: | |
CloneUrl: | |
Description: Git clone URL with SSH | |
Value: | |
Fn::GetAtt: | |
- FrontAppRepository | |
- CloneUrlSsh | |
AmplifyAppId: | |
Description: Amplify application ID | |
Value: | |
Fn::GetAtt: | |
- FrontAppAmplifyApp | |
- AppId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment