What are the different parameter types in CloudFormation?

Beginner

Answer

CloudFormation supports these parameter types:
Basic Types:

  • String: Text values
  • Number: Numeric values
  • CommaDelimitedList: List of values separated by commas
    AWS-Specific Types:
  • AWS::EC2::KeyPair::KeyName: EC2 Key Pair names
  • AWS::EC2::SecurityGroup::Id: Security Group IDs
  • AWS::EC2::Subnet::Id: Subnet IDs
  • AWS::EC2::VPC::Id: VPC IDs
  • AWS::Route53::HostedZone::Id: Route 53 Hosted Zone IDs
    Lists:
  • List<Number>: List of numbers
  • List<AWS::EC2::Subnet::Id>: List of subnet IDs
    Example:
Parameters:
  Environment:
    Type: String
    AllowedValues: [dev, staging, production]
    Default: dev
  SubnetIds:
    Type: List<AWS::EC2::Subnet::Id>
    Description: Subnets for load balancer
  InstanceCount:
    Type: Number
    MinValue: 1
    MaxValue: 10
    Default: 2