Build the Template
Let’s build the blueprint.
lono build demo
lono build command builds the blueprint and compiles down the template to the
$ lono build demo Building template output/demo/template.yml Building parameters output/demo/params.json $
You can see that the DSL was compiled down to a CloudFormation YAML template.
--- Parameters: BucketName: Default: '' Type: String AccessControl: Default: Private Type: String Conditions: HasBucketName: Fn::Not: - Fn::Equals: - Ref: BucketName - '' Resources: Bucket: Type: AWS::S3::Bucket Properties: BucketName: Fn::If: - HasBucketName - Ref: BucketName - Ref: AWS::NoValue AccessControl: Ref: AccessControl Outputs: BucketName: Value: Ref: Bucket
Custom parameters values was also compiled down to a JSON file. In this case it’s currently empty.
This files are useful for debugging. They can actually be used with the
aws cloudformation CLI commands. Example:
cd output/demo aws cloudformation create-stack --stack-name demo-dev --template-body file://template.yml --parameters file://params.json
Lono makes it easier though by automating the process with the
lono up command, which we’ll cover next.
Next, we’ll deploy the infrastructure.