Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
124 lines (123 sloc) 3.69 KB
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"S3Bucket": {
"Type": "String",
"Description": "S3 Bucket containing zip file"
},
"S3ZipKey": {
"Type": "String",
"Description": "Path to zip file"
},
"RackEnv": {
"Type": "String",
"Description": "Value for RACK_ENV and name of this environment"
},
"HealthCheckPath": {
"Type": "String",
"Description": "Path for container health check"
}
},
"Description": "Hello World EB application & IAM policies",
"Resources": {
"ElasticBeanstalkProfile": {
"Type": "AWS::IAM::InstanceProfile",
"Properties": {
"Path": "/hello-world/",
"Roles": [
{ "Ref": "ElasticBeanstalkRole" }
]
}
},
"ElasticBeanstalkRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"Path": "/hello-world/",
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier",
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
],
"AssumeRolePolicyDocument": {
"Version" : "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"Service": [ "ec2.amazonaws.com" ]
},
"Action": [ "sts:AssumeRole" ]
}]
},
"Policies": [ ]
}
},
"ElasticBeanstalkApplication": {
"Type": "AWS::ElasticBeanstalk::Application",
"Properties": {
"Description": "semaphore-cd-hello"
}
},
"ElasticBeanstalkVersion": {
"Type": "AWS::ElasticBeanstalk::ApplicationVersion",
"Properties": {
"ApplicationName": { "Ref": "ElasticBeanstalkApplication" },
"Description": "Source Code",
"SourceBundle": {
"S3Bucket": { "Ref": "S3Bucket" },
"S3Key": { "Ref": "S3ZipKey" }
}
}
},
"ElasticBeanstalkConfigurationTemplate": {
"Type": "AWS::ElasticBeanstalk::ConfigurationTemplate",
"DependsOn": [ "ElasticBeanstalkProfile" ],
"Properties": {
"Description": "Semaphore CD Configuration Template",
"ApplicationName": { "Ref": "ElasticBeanstalkApplication" },
"SolutionStackName": "64bit Amazon Linux 2016.03 v2.1.0 running Docker 1.9.1",
"OptionSettings": [
{
"Namespace": "aws:elasticbeanstalk:environment",
"OptionName": "EnvironmentType",
"Value": "LoadBalanced"
},
{
"Namespace": "aws:elasticbeanstalk:application",
"OptionName": "Application Healthcheck URL",
"Value": { "Ref": "HealthCheckPath" }
},
{
"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "IamInstanceProfile",
"Value": { "Fn::GetAtt": [ "ElasticBeanstalkProfile", "Arn" ] }
},
{
"Namespace": "aws:elasticbeanstalk:application:environment",
"OptionName": "RACK_ENV",
"Value": { "Ref": "RackEnv" }
}
]
}
},
"ElasticBeanstalkEnvironment": {
"Type": "AWS::ElasticBeanstalk::Environment",
"Properties": {
"Description": { "Ref": "RackEnv" },
"ApplicationName": { "Ref": "ElasticBeanstalkApplication" },
"TemplateName": { "Ref": "ElasticBeanstalkConfigurationTemplate" },
"VersionLabel": { "Ref": "ElasticBeanstalkVersion" },
"Tier": {
"Type": "Standard",
"Name": "WebServer"
}
}
}
},
"Outputs": {
"Application": {
"Description": "ElasticBeanstalk Application",
"Value": {
"Ref": "ElasticBeanstalkApplication"
}
}
}
}