cloudtools / stacker

An AWS CloudFormation Stack orchestrator/manager.
http://stacker.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
709 stars 167 forks source link

1.4 Regression: stacktrace during deploy w/ changeset and UsePreviousValue parameters #643

Closed troyready closed 6 years ago

troyready commented 6 years ago

This error can be reproduced by:

  1. Deploying the following stack:
    
    AWSTemplateFormatVersion: '2010-09-09'

Parameters: ServiceNameOne: Description: Service name Default: logs.us-west-2.amazonaws.com Type: String

Resources: RoleOne: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: '2012-10-17' Statement:

stacks: teststack: template_path: templatefile.yaml

2. Update the template and config to the following:

AWSTemplateFormatVersion: '2010-09-09'

Parameters: ServiceNameOne: Description: Service name Default: logs.us-west-2.amazonaws.com Type: String ServiceNameTwo: Description: Service name Type: String

Resources: RoleOne: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: '2012-10-17' Statement:

stacks: teststack: template_path: templatefile.yaml variables: ServiceNameTwo: logs.us-west-2.amazonaws.com

3. Deploy the updated stack interactively:

 $ stacker build -i -r us-west-2 config.yaml [2018-08-07T15:45:47] Using interactive AWS provider mode. [2018-08-07T15:45:49] 'ParameterValue' Traceback (most recent call last): File "/home/troyready/.local/lib/python3.6/site-packages/stacker/plan.py", line 93, in _run_once status = self.fn(self.stack, status=self.status) File "/home/troyready/.local/lib/python3.6/site-packages/stacker/actions/build.py", line 353, in _launch_stack stack_policy=stack_policy, File "/home/troyready/.local/lib/python3.6/site-packages/stacker/providers/aws/default.py", line 805, in update_stack stack_policy=stack_policy, **kwargs) File "/home/troyready/.local/lib/python3.6/site-packages/stacker/providers/aws/default.py", line 830, in interactive_update_stack self.params_as_dict(parameters)) File "/home/troyready/.local/lib/python3.6/site-packages/stacker/providers/aws/default.py", line 970, in params_as_dict parameters[p['ParameterKey']] = p['ParameterValue'] KeyError: 'ParameterValue' [2018-08-07T15:45:49] teststack: failed ('ParameterValue') [2018-08-07T15:45:49] The following steps failed: teststack


The failure is occurring because the new `parameters` variable contains the following:

[{'ParameterKey': 'ServiceNameTwo', 'ParameterValue': 'logs.us-west-2.amazonaws.com'}, {'ParameterKey': 'ServiceNameOne', 'UsePreviousValue': True}]


(UsePreviousValue instead of ParameterValue)