How do I resolve the "Parameter validation failed: parameter value 'abc' for parameter name 'ABC' does not exist" error in AWS CloudFormation?

Last updated: 2020-07-08

When I create or update my AWS CloudFormation stack, I get the following error: "Parameter validation failed: parameter value 'abc' for parameter name 'ABC' does not exist." How can I resolve this error?

Short description

AWS CloudFormation returns this error when one of the parameters used in your AWS CloudFormation template is an AWS-specific parameter type.

You can receive this error when you use an AWS-specific parameter:

  • To pass a value that doesn't exist in the AWS Region or account during stack creation.
  • As a property for a resource, and then delete this value out of band before you update the resource during the stack update.
  • As a parameter in a child stack. The error happens when the value of the child stack that's passed from the parent stack doesn't match the parameter type, or the parameter's resource doesn't exist in the account in that Region.

Resolution

Create a stack

1.    Open the AWS CloudFormation console.

2.    In the navigation pane, choose Stacks.

3.    Form the Stack name column, choose the stack that failed to get created or updated.

4.    Choose the Parameters tab.

5.    In the Key column, search for the parameter ABC with the value abc.

6.    To verify that the resource abc matches the type of the AWS-specific parameter type, check the Parameters section of the AWS CloudFormation template used to create your stack.

7.    To verify that the resource abc for the parameter ABC exists in the Region or account, use either the AWS Management Console or the AWS Command Line Interface (AWS CLI) command for describing the resource. To find the right command for your resource, see the Find the describe command for your resource section.

Note: For example, if you use the parameter type AWS::EC2::VPC::Id, then check the Amazon Virtual Private Cloud (Amazon VPC) console for the resource.

8.    If ABC is a parameter to the child stack, then you must pass the value abc by choosing Option A or Option B.

(Option A) If you're referencing another resource in the parent stack, then verify that the resource from the parent stack that's being referenced matches the AWS-specific parameter type used in the child stack.

Note: For example, the stack fails if you use the parameter type AWS::EC2::Subnet::Id (subnet) and refer to a resource of type AWS::EC2::VPC (VPC).

(Option B) If the parameter value abc is passed directly from the parent stack, then verify that the resource abc for the parameter ABC exists in the Region or account. Use either the AWS Management Console or the AWS CLI command for describing the resource. To find the right command for your resource, see the Find the describe command for your resource section.

For example, consider the following List<AWS::EC2::SecurityGroup::Id> parameter in the child stack:

"SecurityGroups": {
    "Description": "List of security group IDs for the instances",
    "Type": "List<AWS::EC2::SecurityGroup::Id>"
}

The value to the parameter is passed from the parent stack. For example:

"ChildStack" : {
 "Type" : "AWS::CloudFormation::Stack",
 "Properties" : {
    "Parameters":{
      "KeyPair" : { "Ref": "KeyPair" },
      "ImageID" : { "Ref": "ImageID" },
      "InstanceType" : { "Ref": "InstanceType" },
      "SecurityGroups" : { "Ref": "SecurityGroup" }
    }

Note: In the preceding example, you must verify the value of the security group ID that's passed to the parameter SecurityGroup exists in the Region or account.

9.    Create a new stack with a valid value for the parameter that exists in your Region or account and that matches the AWS-specific parameter type.

Update the stack

When the update of the stack fails, AWS CloudFormation rolls back the changes. This means that you can't see the parameter value that's updated through the AWS CloudFormation console.

If you haven't changed the value for the parameter ABC during the update, then the resource with the name or PhysicalID of abc might have been deleted from the account out of band.

1.    To verify that the resource exists, use either the AWS Management Console or the AWS CLI command for describing the resource. To find the right command for your resource, see the Find the describe command for your resource section.

2.    If you're updating the stack by updating the parameter ABC, then follow steps 6,7 and 8 in the preceding Create a stack section.

3.    Update the stack by passing a valid value to the parameter ABC.

Now, your stack should update successfully.

Find the describe command for your resource

Choose the right command for your resource:

  • For AWS::EC2::Image::Id or List<AWS::EC2::Image::Id>, use the command for AWS CLI version 1 or version 2.
  • For AWS::EC2::Instance::Id or List<AWS::EC2::Instance::Id>, use the command for AWS CLI version 1 or version 2.
  • For AWS::EC2::KeyPair::KeyName, use the command for AWS CLI version 1 or version 2.
  • For AWS::EC2::SecurityGroup::GroupName, AWS::EC2::SecurityGroup::Id, List<AWS::EC2::SecurityGroup::GroupName>, or List<AWS::EC2::SecurityGroup::Id>, use the command for AWS CLI version 1 or version 2.
  • For AWS::EC2::Subnet::Id or List<AWS::EC2::Subnet::Id>, use the command for AWS CLI version 1 or version 2.
  • For AWS::EC2::VPC::Id or List<AWS::EC2::VPC::Id>, use the command for AWS CLI version 1 or version 2.
  • For AWS::Route53::HostedZone::Id or List<AWS::Route53::HostedZone::Id>, use the command for AWS CLI version 1 or version 2.

Did this article help?


Do you need billing or technical support?