O'Reilly logo

AWS Automation Cookbook by Nikit Swaraj

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using parameters

Within the same template, you can use the Ref intrinsic function to specify the parameter value in other parts of the template. The following snippet uses the the previous defined parameter InstanceTypeParameter:

Ec2Instance:  Type: AWS::EC2::Instance  Properties:    InstanceType:      Ref: InstanceTypeParameter    ImageId: ami-3c47a355

There are some AWS-specific parameter types as well. For example, if you mention AWS::EC2::AvailabilityZone::Name, then the value of current AZ such as us-east-1 will be placed in the CloudFormation template. Similarly, there are many more AWS-specific parameters that exist.

Mapping (optional):  The mapping section which is also optional, matches a key to a corresponding set of named values. Let's say ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required