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

5 minute read
0

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

Short description

You receive the Parameter validation failed error when a parameter in your CloudFormation template uses an AWS specific parameter type in the following scenarios:

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

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

To resolve the Parameter validation failed error, complete the following steps.

Resolve the error when you create a stack

Complete the following steps:

  1. Open the CloudFormation console.
  2. In the navigation pane, choose Stacks.
  3. Under Stack name, select the stack that failed.
  4. Choose the Parameters tab.
  5. Under Key, search for the ABC parameter with the abc value.
  6. Check the Parameters section of the template that's used to create your stack. Verify that the abc resource matches the AWS specific parameter type.
  7. Verify that the abc resource for the ABC parameter exists in the Region or account. Use either the AWS Management Console or an AWS CLI command to describe the resource. To find the right command for your resource, see the Find the describe command for your resource section.
    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 abc value. Take one of the following actions:
    If you're referencing another resource in the parent stack, then verify that this resource matches the AWS specific parameter type used in the child stack. For example, the stack fails if you use the parameter type AWS::EC2::Subnet::Id (subnet) and refer to the AWS::EC2::VPC resource type.
    -or-
    If the abc value passes directly from the parent stack, then verify that the abc resource for the ABC parameter exists in the Region or account. To find the right command for your resource, see the Find the describe command for your resource section.
    The following example uses the List parameter in the child stack:
    "SecurityGroups": {    "Description": "List of security group IDs for the instances",
        "Type": "ListAWS::EC2::SecurityGroup::Id"
    }
    The value to the parameter passes from the parent stack:
    "ChildStack" : { "Type" : "AWS::CloudFormation::Stack",
     "Properties" : {
        "Parameters":{
          "KeyPair" : { "Ref": "KeyPair" },
          "ImageID" : { "Ref": "ImageID" },
          "InstanceType" : { "Ref": "InstanceType" },
          "SecurityGroups" : { "Ref": "SecurityGroup" }
        }
    Important: In the preceding example, verify that the value of the security group ID that's passed to the SecurityGroup parameter 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. The value must match the AWS specific parameter type.

Resolve the error when you update the stack

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

You must change the value for the ABC parameter during the update. If you don't change the value, then the resource with the name or PhysicalID of abc might be deleted from the account out of band. Take the following actions:

  • To verify that the resource exists, use either the AWS Management Console or the AWS CLI command to describe the resource. To find the right command for your resource, see the Find the describe command for your resource section.
  • To update the stack by updating the ABC parameter, complete steps 6-8 in the preceding Resolve the error when you create a stack section.
  • To update the stack, pass a valid value to the ABC parameter.

Find the describe command for your resource

Choose the right command for your resource:

AWS OFFICIAL
AWS OFFICIALUpdated 5 months ago