Comments (13)
Okay, I figured it out ... I hope this issue (and comment) helps others.
The correct syntax is:
[{"parameter_key":"ExampleParameter","parameter_value":"1234"}]
If you need to supply multiple parameters, the syntax is:
[ {"parameter_key":"Param1","parameter_value":"1234"},{"parameter_key":"Param2","parameter_value":"1234"} ]
This did my head in for a while.
from aws-cli.
hi All,
Any improvement here since 2013? Any way to use '--parameters file:///...' instead of list of parameters?
Thank you.
from aws-cli.
I see it's possible to have some abbreviation, like:
--parameters ParameterKey=Vpc,ParameterValue=vpc-1f616a7d ParameterKey=SubnetA,ParameterValue=subnet-44e1e926 ParameterKey=SubnetB,ParameterValue=subnet-36d8f342
but that's still pretty ugly compared to
--parameters Vpc=vpc-1f616a7d, SubnetA=subnet-44e1e926, SubnetB=subnet-36d8f342
and it's especially annoying, since u have to specify these again when u r doing an aws cloudformation update-stack ...
from aws-cli.
Any update on the above request to use '--parameters file:///...' instead of list of parameters ?
Thanks!
from aws-cli.
Further information: running with --debug shows me that even though parameters are getting parsed in the forms which work, none of them are being sent in the POST.
(I also notice that I left out two closing braces in the template ... sorry for the transcription error)
snippets from --debug:
...
2013-02-19 16:41:30,558 - botocore.parameters - DEBUG - name: Parameters
2013-02-19 16:41:30,558 - botocore.parameters - DEBUG - label:
...
send: 'POST / HTTP/1.1\r\nHost: cloudformation.us-east-1.amazonaws.com\r\nAccept-Encoding: identity\r\nContent-Length: 529\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: AWS4-HMAC-SHA256 Credential=xxxxxxxxxxxxx/20130219/us-east-1/cloudformation/aws4_request, SignedHeaders=host;user-agent;x-amz-date, Signature=xxxxxxxx\r\nX-Amz-Date: 20130219T054130Z\r\nUser-Agent: aws-cli/0.5.3 Python/2.7.3 Linux/3.7.6-102.fc17.x86_64\r\n\r\nStackName=example&Action=CreateStack&Version=2010-05-15&TemplateBody=%7B%22AWSTemplateFormatVersion%22%3A%222010-09-09%22%2C%22Description%22%3A%22Example+template%22%2C%22Parameters%22%3A%7B%22ExampleParameter%22%3A%7B%22Type%22%3A%22Number%22%7D%7D%2C%22Resources%22%3A%7B%22ExampleVolume%22%3A%7B%22Properties%22%3A%7B%22AvailabilityZone%22%3A%22us-east-1a%22%2C%22Size%22%3A%2210%22%2C%22Tags%22%3A%5B%7B%22FirstTag%22%3A%7B%22Ref%22%3A%22ExampleParameter%22%7D%7D%5D%7D%2C%22Type%22%3A%22AWS%3A%3AEC2%3A%3AVolume%22%7D%7D%7D'
reply: 'HTTP/1.1 400 Bad Request\r\n'
from aws-cli.
Thanks for your diligence 8^) We acknowledge that the actual format of complex parameters is currently difficult to decipher. We are working on a couple of ways to improve this. I'll update this ticket when this work has been completed.
from aws-cli.
What's the correct syntax for passing the parameters on the command line rather than as a 'file:'?
from aws-cli.
Hi Tom,
The syntax for command-line use is the same; using a file: prefix just makes it pull the contents from a file instead of from stdin. Of course, this may present some interesting challenges with quoting, shell metacharacters, and so on but for the most part it's straightforward.
Example:
$ aws cloudformation create-stack --stack-name my-test-stack \
--template-body file:my-template.json \
--parameters '[{"parameter_key":"KeyName","parameter_value":"my-ssh-keyname"}]'
from aws-cli.
Thanks for that, I was trying to wrap the JSON list in single quoted braces. Didn't think to just single quote the list.
I'm having more fun now!
from aws-cli.
What is the new syntax these days ?
I just tried the syntax described by @nonspecialist above but it seems it does not work anymore
I am using
$ aws --version
aws-cli/0.16.0 Python/2.7.2 Darwin/12.4.0
$ pip list | grep boto
boto (2.11.0)
botocore (0.16.0)
I tested this format
[{"parameter_key":"name", "parameter_value":"test"}]
And received
Invalid value ('parameter_key') for param element of list:Parameters of type list
from aws-cli.
I just run into the same issue, now the format seems to be [{"ParameterKey":"name", "ParameterValue":"test"}]
For the single quote I believe that with a single note on the official documentation or the help command will do: "Note: for the json sintax single quote the json string" it would save lots of headaches
from aws-cli.
Why is it necessary to specify a hash of ParameterKey and ParameterValue instead of creating the hash directly?
{ "name": "value", "instance": "i-03fa8d" }
is a lot more readable than
[ {"ParameterKey": "name", "ParameterValue": "test"}, {"ParameterKey": "instance", "ParameterValue": "i-03fa8d"} ]
from aws-cli.
See #484. This is being actively worked and we hope to have an improved UI available for map-like values in the future.
from aws-cli.
Related Issues (20)
- dynamodb update-table missing delete-protection-enabled option
- KMS Decrypt with valid key and cipher-text returns error HOT 2
- Cross platform deploy on aws cloudformation package breaks path seperators
- s3api create-bucket does not work for express one zone directory buckets HOT 2
- (AccessDenied) when calling the ListBuckets operation: Access Denied HOT 1
- EC2::Client#describe_security_groups undocumented & unchecked options limitation. HOT 3
- aws sso login failed on WSL2
- Neither Cryptography 38.0.4 or Cryptography 40.0.1 works HOT 1
- S3Api get-bucket-location returns "EU" for buckets created in eu-west-1 (Ireland) HOT 2
- Have a command to generate a Redis Auth token just like RDS
- Add creds to .netrc for codeartifact pip login. HOT 1
- [AWS][EC2] create-volume tagging request is made in a second time causing rejection from tagging policies
- list-state-machines does not return all records HOT 2
- aws lambda invoke retries while lambda execution has not failed
- Warnings when using Python 3.12
- Unable to generate long-living pre-signed URL
- role parameter in eks update-kubeconfig is not being used for aws cli connection HOT 1
- `aws codeartifact login --tool npm` fails with "This command does not support workspaces." HOT 1
- Command to turn versioning on on Digital Ocean Space/Bucket fails with 'argument of type 'NoneType' is not iterable' HOT 4
- InvalidGrantException while refresh auth token HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-cli.