Skip to main content

Parameter Files

A Parameter file adheres to the format contained in the skeleton generated by the cli command aws cloudformation create-change-set --generate-cli-skeleton yaml-input. Output from this command (see below) can be used as a starting point for creating a Parameter file as can the examples provided in this document.

info

A Parameter file is not needed in cases where a Template file has default parameter values set.

parameter resolution see

Note that a Parameter file must not include the keys StackName, TemplateBody, or TemplateURL as these are defined in the Deployment file.

Examples

Parameter File for IAM Capabilities

When a Stack uses a template that is creating IAM roles, the parameter file must specify the capabilities required to create the IAM role. Create a parameter file for this purpose with the following content:

params/iam-capability-reqd.yml
Capabilities: [ CAPABILITY_NAMED_IAM ] # or CAPABILITY_IAM - required for some templates

Parameter File for StackOps Installation

The following example shows a parameter file that specifies the parameters required for the StackOps installation:

params/stackops.yml
Parameters:
- ParameterKey: AuthorizedUserArns
ParameterValue: "123456789012, arn:aws:iam::210987654321:root" # Principals that can access the StackOps installation and member account admin roles
- ParameterKey: ApplicationLicenseKey
ParameterValue: "1234567890123456789012345678901234567890" # License key from https://service.stackops.ngin.global
- { ParameterKey: LogLevelServer, ParameterValue: ERROR } # or DEBUG or INFO or WARN
- { ParameterKey: LogLevelUI, ParameterValue: ERROR }
- { ParameterKey: LogData, ParameterValue: "off" } # or "on"
- { ParameterKey: StackOpsVersion, ParameterValue: latest }
Capabilities: [ CAPABILITY_NAMED_IAM ]

Parameter File Format from AWS Cli Command

The following is an example of a parameter file format generated by the AWS CLI command aws cloudformation create-change-set --generate-cli-skeleton yaml-input with the first three keys omitted as they are defined in the Deployment file.

warning

A StackOps Parameter file must not include the keys StackName, TemplateBody, or TemplateURL as these are defined in the Deployment file.

aws cloudformation create-change-set --generate-cli-skeleton yaml-input

UsePreviousTemplate: true # Whether to reuse the template that's associated with the stack to create the change set.
Parameters: # A list of Parameter structures that specify input parameters for the change set.
- ParameterKey: '' # The key associated with the parameter.
ParameterValue: '' # The input value associated with the parameter.
UsePreviousValue: true # During a stack update, use the existing parameter value that the stack is using for a given parameter key.
ResolvedValue: '' # Read-only.
Capabilities: # In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for CloudFormation to create the stack.
- CAPABILITY_IAM
ResourceTypes: # The template resource types that you have permissions to work with if you execute this change set, such as AWS.
- ''
RoleARN: '' # The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that CloudFormation assumes when executing the change set.
RollbackConfiguration: # The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards.
RollbackTriggers: # The triggers to monitor during stack creation or update actions.
- Arn: '' # [REQUIRED] The Amazon Resource Name (ARN) of the rollback trigger.
Type: '' # [REQUIRED] The resource type of the rollback trigger.
MonitoringTimeInMinutes: 0 # The amount of time, in minutes, during which CloudFormation should monitor all the rollback triggers after the stack creation or update operation deploys all necessary resources.
NotificationARNs: # The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon SNS) topics that CloudFormation associates with the stack.
- ''
Tags: # Key-value pairs to associate with this stack.
- Key: '' # [REQUIRED] Required.
Value: '' # [REQUIRED] Required.
ChangeSetName: '' # [REQUIRED] The name of the change set.
ClientToken: '' # A unique identifier for this CreateChangeSet request.
Description: '' # A description to help you identify this change set.
ChangeSetType: CREATE # The type of change set operation. Valid values are: CREATE, UPDATE, IMPORT.
ResourcesToImport: # The resources to import into your stack.
- ResourceType: '' # [REQUIRED] The type of resource to import into your stack, such as AWS.
LogicalResourceId: '' # [REQUIRED] The logical ID of the target resource as specified in the template.
ResourceIdentifier: # [REQUIRED] A key-value pair that identifies the target resource.
KeyName: ''
IncludeNestedStacks: true # Creates a change set for the all nested stacks specified in the template.
OnStackFailure: DO_NOTHING # Determines what action will be taken if stack creation fails. Valid values are: DO_NOTHING, ROLLBACK, DELETE.
ImportExistingResources: true # Indicates if the change set imports resources that already exist.