Skip to content

Instantly share code, notes, and snippets.

@wonderb0lt
Created December 15, 2014 17:35
Show Gist options
  • Save wonderb0lt/febe250612253a0960e7 to your computer and use it in GitHub Desktop.
Save wonderb0lt/febe250612253a0960e7 to your computer and use it in GitHub Desktop.
The CFN template for the cfn/docker sample
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Infrastructure for the Spring Boot + Docker + CFN sample",
"Parameters": {
"Version": {
"Type": "String",
"Default": "1.0.0"
}
},
"Resources": {
"SampleRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2008-10-17",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"Path": "/",
"Policies": [
{
"PolicyName": "AccessDockerConfigurationBucket",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bol-mdp-docker",
"arn:aws:s3:::bol-mdp-docker/*"
]
}
]
}
}
]
}
},
"SampleApplication": {
"Type": "AWS::ElasticBeanstalk::Application",
"Properties": {
"Description": "Spring Boot + Docker + CFN EB-Application",
"ApplicationName": {
"Fn::Join": [
"-",
[
"spring-boot-docker-cfn-app-",
{
"Ref": "AWS::StackName"
}
]
]
}
}
},
"EbVersion": {
"Type": "AWS::ElasticBeanstalk::ApplicationVersion",
"Properties": {
"ApplicationName": {
"Ref": "SampleApplication"
},
"Description": "Default Version",
"SourceBundle": {
"S3Bucket": {
"Fn::Join": [
"-",
[
"bol",
{
"Ref": "AWS::Region"
},
"artifacts"
]
]
},
"S3Key": {
"Fn::Join": [
"",
[
"spring-boot-docker-cfn-sample/spring-boot-docker-cfn-sample-",
{
"Ref": "Version"
},
".zip"
]
]
}
}
}
},
"ConfigurationTemplate": {
"Type": "AWS::ElasticBeanstalk::ConfigurationTemplate",
"Properties": {
"ApplicationName": {
"Ref": "SampleApplication"
},
"Description": "Default ConfigurationTemplate Version 1.0",
"SolutionStackName": "64bit Amazon Linux 2014.03 v1.0.1 running Docker 1.0.0"
}
},
"EbAppInstanceProfile": {
"Type": "AWS::IAM::InstanceProfile",
"Properties": {
"Path": "/",
"Roles": [
{
"Ref": "SampleRole"
}
]
}
},
"Environment": {
"Type": "AWS::ElasticBeanstalk::Environment",
"Properties": {
"ApplicationName": {
"Ref": "SampleApplication"
},
"Description": "Default Environment",
"VersionLabel": {
"Ref": "EbVersion"
},
"TemplateName": {
"Ref": "ConfigurationTemplate"
},
"OptionSettings": [
{
"Namespace": "aws:autoscaling:launchconfiguration",
"OptionName": "IamInstanceProfile",
"Value": {
"Ref": "EbAppInstanceProfile"
}
},
{
"Namespace": "aws:elasticbeanstalk:application:environment",
"OptionName": "echoservice.greetingTemplate",
"Value": "Howdy, World!"
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment