generated from FiV0/clj-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: split cloudformation script up so github can deploy the service
- Loading branch information
1 parent
99877c4
commit 2c7cf1b
Showing
4 changed files
with
241 additions
and
190 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
|
||
Resources: | ||
# >> Github deploy IAM Role | ||
|
||
GithubDeployUser: | ||
Type: 'AWS::IAM::User' | ||
Properties: | ||
Policies: | ||
# ECR Push | ||
- PolicyName: ecr-allow-push | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- ecr:CompleteLayerUpload | ||
- ecr:GetAuthorizationToken | ||
- ecr:UploadLayerPart | ||
- ecr:InitiateLayerUpload | ||
- ecr:BatchCheckLayerAvailability | ||
- ecr:PutImage | ||
- ecr:BatchGetImage | ||
Resource: "*" | ||
# Resource: | ||
# - !GetAtt ContainerRepo.Arn | ||
# https://github.com/aws-actions/amazon-ecs-deploy-task-definition?tab=readme-ov-file#permissions | ||
- PolicyName: task-definition-update | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Sid: RegisterTaskDefinition | ||
Effect: Allow | ||
Action: | ||
- ecs:RegisterTaskDefinition | ||
Resource: "*" | ||
- Sid: PassRolesInTaskDefinition | ||
Effect: Allow | ||
Action: | ||
- iam:PassRole | ||
Resource: | ||
- '{{resolve:ssm:xt-fiddle_task-role-arn}}' | ||
- '{{resolve:ssm:xt-fiddle_task-execution-role-arn}}' | ||
- Sid: DeployService | ||
Effect: Allow | ||
Action: | ||
- ecs:UpdateService | ||
- ecs:DescribeServices | ||
Resource: | ||
- '{{resolve:ssm:xt-fiddle_ecs-cluster-arn}}' | ||
# https://github.com/aws-actions/aws-cloudformation-github-deploy?tab=readme-ov-file#permissions | ||
- PolicyName: cloudformation-deploy | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- cloudformation:CreateStack | ||
- cloudformation:DescribeStacks | ||
- cloudformation:CreateChangeSet | ||
- cloudformation:DescribeChangeSet | ||
- cloudformation:DeleteChangeSet | ||
- cloudformation:ExecuteChangeSet | ||
Resource: "*" | ||
|
||
GithubDeployUserAccessKey: | ||
Type: 'AWS::IAM::AccessKey' | ||
Properties: | ||
UserName: !Ref GithubDeployUser | ||
|
||
Outputs: | ||
GithubDeployAccessKeyId: | ||
Value: !Ref GithubDeployUserAccessKey | ||
GithubDeploySecretAccessKey: | ||
Value: !GetAtt GithubDeployUserAccessKey.SecretAccessKey |
Oops, something went wrong.