-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
361 additions
and
194 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,177 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Parameters": { | ||
"ClusterName": { | ||
"Description": "The name of the ECS cluster", | ||
"Type": "String", | ||
"Default": "GoCD" | ||
} | ||
}, | ||
"Outputs": { | ||
"AccessKey": { | ||
"Value": { | ||
"Ref": "AccessKey" | ||
} | ||
}, | ||
"SecretKey": { | ||
"Value": { | ||
"Fn::GetAtt": [ | ||
"AccessKey", | ||
"SecretAccessKey" | ||
] | ||
} | ||
}, | ||
"GoCDEC2OptimizedRole": { | ||
"Value": { | ||
"Fn::GetAtt": [ | ||
"GoCDEC2OptimizedRole", | ||
"Arn" | ||
] | ||
} | ||
}, | ||
"GoCDEC2OptimizedInstanceProfile": { | ||
"Value": { | ||
"Fn::GetAtt": [ | ||
"GoCDEC2OptimizedInstanceProfile", | ||
"Arn" | ||
] | ||
} | ||
} | ||
}, | ||
"Resources": { | ||
"GoCDECSCluster": { | ||
"Type": "AWS::ECS::Cluster", | ||
"Properties": { | ||
"ClusterName": { | ||
"Ref": "ClusterName" | ||
} | ||
} | ||
}, | ||
"AccessKey": { | ||
"Type": "AWS::IAM::AccessKey", | ||
"Properties": { | ||
"UserName": { | ||
"Ref": "GoCDECSPluginUser" | ||
} | ||
} | ||
}, | ||
"GoCDECSPluginUser": { | ||
"Type": "AWS::IAM::User", | ||
"Properties": { | ||
"Policies": [ | ||
{ | ||
"PolicyName": "ManageEC2Instances", | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"ec2:runInstances", | ||
"ec2:createTags", | ||
"ec2:terminateInstances", | ||
"ec2:describeInstances", | ||
"ec2:describeSubnets", | ||
"ec2:createVolume", | ||
"ec2:attachVolume", | ||
"ec2:stopInstances", | ||
"ec2:startInstances", | ||
"ec2:deleteTags", | ||
"iam:PassRole", | ||
"iam:GetRole" | ||
], | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"PolicyName": "ManageECSInstances", | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"ecs:describeClusters", | ||
"ecs:deregisterContainerInstance", | ||
"ecs:describeContainerInstances", | ||
"ecs:listContainerInstances", | ||
"ecs:registerTaskDefinition", | ||
"ecs:deregisterTaskDefinition", | ||
"ecs:startTask", | ||
"ecs:stopTask", | ||
"ecs:listTasks", | ||
"ecs:describeTasks", | ||
"ecs:describeTaskDefinition" | ||
], | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"GoCDEC2OptimizedRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": { | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"ec2.amazonaws.com" | ||
] | ||
}, | ||
"Action": [ | ||
"sts:AssumeRole" | ||
] | ||
} | ||
}, | ||
"Policies": [ | ||
{ | ||
"PolicyName": "AllowECSAgentToManageContainers", | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"ecs:describeClusters", | ||
"ecs:discoverPollEndpoint", | ||
"ecs:registerContainerInstance", | ||
"ecs:deregisterContainerInstance", | ||
"ecs:poll", | ||
"ecs:startTelemetrySession", | ||
"ecs:submitContainerStateChange", | ||
"ecs:submitTaskStateChange", | ||
"logs:CreateLogStream", | ||
"logs:PutLogEvents" | ||
], | ||
"Resource": [ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"GoCDEC2OptimizedInstanceProfile": { | ||
"Type": "AWS::IAM::InstanceProfile", | ||
"Properties": { | ||
"Roles": [ | ||
{ | ||
"Ref": "GoCDEC2OptimizedRole" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.