aws / aws/aws-cli

cloudformation deploy --parameter-overrides parses parameters with spaces in a wrong way

Open
#3,274 18 comments 0 reactions 0 assignees View on GitHub
bug cloudformation package-deploy customization p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

**Description:**
I want to hand over parameters to the deployment of my cloudformation template using `cloudformation deploy --parameter-overrides`. Some parameters might contain spaces which are parsed in a wrong way. Even by using escape characters an error is thrown.

For example: `cloudformation deploy [...] --parameter-overrides Foo=B a r` or `Foo=B\ a\ r` or `Foo="B a r"` do not work.

**Expected Behaviour:**
The parameters are parsed as they would not contain any space, e.g. like `Foo=Bar`.

**Actual Behaviour:**
An error is thrown: `['a'] value passed to --parameter-overrides must be of format Key=Value`

**Debug infos:**
- `aws --version` returns: `aws-cli/1.15.0 Python/3.6.5 Darwin/17.4.0 botocore/1.10.0`

Here is the `--debug` output (I have removed some params as I had no time to prepare a simple example yet).

```
2018-04-19 11:26:00,017 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.15.0 Python/3.6.5 Darwin/17.4.0 botocore/1.10.0
2018-04-19 11:26:00,018 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['cloudformation', 'deploy', '--debug', '--template-file', 'cfn.packaged.yml', 'Foo=B', 'a', 'r']

...

2018-04-19 11:26:00,063 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
File "/usr/local/Cellar/awscli/1.15.0/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 208, in main
return command_table[parsed_args.command](remaining, parsed_args)
File "/usr/local/Cellar/awscli/1.15.0/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 345, in __call__
return command_table[parsed_args.operation](remaining, parsed_globals)
File "/usr/local/Cellar/awscli/1.15.0/libexec/lib/python3.6/site-packages/awscli/customizations/commands.py", line 187, in __call__
return self._run_main(parsed_args, parsed_globals)
File "/usr/local/Cellar/awscli/1.15.0/libexec/lib/python3.6/site-packages/awscli/customizations/cloudformation/deploy.py", line 259, in _run_main
self.PARAMETER_OVERRIDE_CMD)
File "/usr/local/Cellar/awscli/1.15.0/libexec/lib/python3.6/site-packages/awscli/customizations/cloudformation/deploy.py", line 381, in parse_key_value_arg
value=key_value_pair)
awscli.customizations.cloudformation.exceptions.InvalidKeyValuePairArgumentError: ['a'] value passed to --parameter-overrides must be of format Key=Value
2018-04-19 11:26:00,066 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255
```

If you need more information to reproduce it, let me know.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.