Skip to content

Using cloudformation_update_stack and paremeters #118

Description

@cwilson21

When trying to update a cloudformation stack, we specify the parameters we want to update and we get an error about other parameters that need to be updated.

Example of what is specified:

{"ParameterKey": "GlusterDiskSizeParameter","ParameterValue": "450"}

The following error comes when using the above parameters:

botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the UpdateStack operation: Parameters: [RDSUsernameParameter, RDSPasswordParameter, ClusterIDParameter] must have values

However when we call that same function, and add each of those Parameters with "UsePreviousValue": True" we get an error indicating invalid parameters

 "stderr": "st2.actions.python.ActionManager: DEBUG    Calling method \"boto3.cloudformation.update_stack\" with kwargs: {'Parameters': ['{\"ParameterKey\":\"GlusterDiskSizeParameter\"', '\"ParameterValue\":\"450\"}', '{\"ParameterKey\":\"RDSUsernameParameter\"', '\"UsePreviousValue\":true}', '{\"ParameterKey\":\"RDSPasswordParameter\"', '\"UsePreviousValue\":true}', '{\"ParameterKey\":\"ClusterIDParameter\"', '\"UsePreviousValue\":true}'], 'StackName': 'Cluster96518'}\nTraceback (most recent call last):\n  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>\n    obj.run()\n  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 214, in run\n    output = action.run(**self._parameters)\n  File \"/opt/stackstorm/packs/aws/actions/run.py\", line 36, in run\n    return self.do_method(module_path, cls, aws_action, **kwargs)\n  File \"/opt/stackstorm/packs/aws/actions/lib/action.py\", line 224, in do_method\n    resultset = getattr(obj, action)(**kwargs)\n  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/client.py\", line 251, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/client.py\", line 512, in _make_api_call\n    request_dict = self._convert_to_request_dict(\n  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/client.py\", line 565, in _convert_to_request_dict\n    request_dict = self._serializer.serialize_to_request(\n  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/validate.py\", line 270, in serialize_to_request\n    raise ParamValidationError(report=report.generate_report())\nbotocore.exceptions.ParamValidationError: Parameter validation failed:\nInvalid type for parameter Parameters[0], value: {\"ParameterKey\":\"GlusterDiskSizeParameter\", type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[1], value: \"ParameterValue\":\"450\"}, type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[2], value: {\"ParameterKey\":\"RDSUsernameParameter\", type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[3], value: \"UsePreviousValue\":true}, type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[4], value: {\"ParameterKey\":\"RDSPasswordParameter\", type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[5], value: \"UsePreviousValue\":true}, type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[6], value: {\"ParameterKey\":\"ClusterIDParameter\", type: <class 'str'>, valid types: <class 'dict'>\nInvalid type for parameter Parameters[7], value: \"UsePreviousValue\":true}, type: <class 'str'>, valid types: <class 'dict'>\n",

We also are selecting to use the existing template as we are just updating and replacing a parameter in it. Any assistance on what we are doing wrong or how to move forward with this would be appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions