Using parameters and setting defaults

  • Try to parameterize as much as possible, making sure to cover settings that you expect users to customize. Some examples are CIDR blocks, FQDN names, host names, instance types, and storage volume sizes.

Naming, labeling, and grouping

  • For parameter names, use Pascal case, and begin with an uppercase letter (e.g., KeyPairName).
  • Use parameter groupings and display labels. This AWS CloudFormation feature enables you to display parameters in an intuitive way. For example, you could place all the network-related information in a category called Network Configuration and your database configuration parameters in a category called Database Configuration. For instructions on setting up groups and labels, see the AWS::CloudFormation::Interface resource.
  • Name subnets (and their references) public or private as appropriate:
    • Public subnets have a direct Internet gateway route in the route table associated with them. Instances in this subnet can make inbound and outbound use of a public or Elastic IP address.
    • Private subnets have an indirect route to the Internet via a NAT gateway or NAT instance that resides in a public subnet. These instances are reachable only through their private IP address. (For more on this, see the security best practices section.)

Numbering parameters

  • For items that are entities, the parameter number should directly follow the entity name. For example, if you have two XYZ instances, they should be named XYZ1 and XYZ2.
  • If a feature is attached, extends, or complements the entity, its name should follow the entity name; for example, XYZ1EIP and XYZ2EIP.

Using parameter types

  • Use AWS-specific parameter types as much as possible. This enables users to pick values from a dropdown list. See the AWS documentation for a list.

Using the DependsOn attribute

  • Make sure to use the DependsOn attribute appropriately across resources to control the order of resource creation. Also, be mindful of the situation where it is required. For more information around these special cases, see the AWS CloudFormation documentation.

Including the Quick Start configuration parameters

Each Quick Start template should include the following Quick Start configuration code and parameters:

  • Include an AWSInfoRegionMap section for the AWS partition and Quick Start S3 location:
...
    "Mappings": {
        "AWSInfoRegionMap": {
            "ap-northeast-1": {
                "Partition": "aws",
                "QuickStartS3URL": "https://s3.amazonaws.com"
            },
            "ap-northeast-2": {
                "Partition": "aws",
                "QuickStartS3URL": "https://s3.amazonaws.com"
            },
            "ap-south-1": {
                "Partition": "aws",
                "QuickStartS3URL": "https://s3.amazonaws.com"
            },
            "ap-southeast-1": {
                "Partition": "aws",
                "QuickStartS3URL": "https://s3.amazonaws.com"
            },
...
  • Include the standard parameters for the Quick Start S3 bucket name and key prefix. Set the default value for the key prefix to company-name/product-name/latest, e.g., atlassian/jira/latest.
...
   "QSS3BucketName": {
     "AllowedPattern": "^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$",
     "ConstraintDescription": "Quick Start bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-).",
     "Default": "quickstart-reference",
     "Description": "S3 bucket name for the Quick Start assets. Quick Start bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-).",
            "Type": "String"
        },
   "QSS3KeyPrefix": {
     "AllowedPattern": "^[0-9a-zA-Z-]+(/[0-9a-zA-Z-]+)*$",
     "ConstraintDescription": "Quick Start key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slash (/). It cannot start or end with forward slash (/) because they are automatically appended.",
     "Default": "atlassian/jira/latest",
     "Description": "S3 key prefix for the Quick Start assets. Quick Start key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slash (/). It cannot start or end with forward slash (/) because they are automatically appended.",
     "Type": "String"
        },
...