2

I want to create a Cloudformation template for launching an Elastic Beanstalk application based on the Docker platform. I managed to make manually the setup, which includes uploading the Dockerrun.aws.json.

From what I've seen, this file can be specified as the SourceBundle as a reference to a an S3 object. However, I cannot find a way to put the content of the Dockerrun.aws.json file as part to the template.

I've seen examples for EC2 deployments, on which the content of configuration files can be part of the template.

1 Answers1

1

As an alternative to using the AWS Elastic Beanstalk tasks built into Tasks for AWS, it is also possible to provision the Elastic Beanstalk components directly via the AWS CloudFormation Stack task and the corresponding CloudFormation resource types:

AWS::ElasticBeanstalk::Application

AWS::ElasticBeanstalk::ApplicationVersion

AWS::ElasticBeanstalk::Environment

In your case, check the ApplicationVersion object where it is described how to manage the Dockerrun.aws.json file using CloudFormation.

Example:

"myAppVersion" :{ 
  "Type" : "AWS::ElasticBeanstalk::ApplicationVersion",
  "Properties" : {
    "ApplicationName" : {"Ref" : "myAppName"},
    "Description" : "ElasticBeanStalk_conf",
    "SourceBundle" : {
      "S3Bucket" : { "Fn::Join" :
        ["-", [ "elasticbeanstalk-conf", { "Ref" : "AWS::Region" } ] ] },
      "S3Key" : "Dockerrun.aws.json"
    } 
  }
}
Itai Ganot
  • 10,976