ssm put_parameter add to default
See original GitHub issueHi,
I have been trying to understand how to add the following ssm parameter to the default sets provided in https://github.com/spulec/moto/blob/master/moto/ssm/resources/ami-amazon-linux-latest/eu-west-1.json:
/aws/service/ecs/optimized-ami/amazon-linux-2/recommended
But obviously this isn’t possible by just calling put_parameter
as showing in https://github.com/spulec/moto/blob/master/tests/test_ssm/test_ssm_boto3.py#L390
Is there an obvious way to do this with moto, or do I need to mock the ssm client without moto?
The result value from aws cli should be the following (at the time or writing):
{
"Parameter": {
"Name": "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended",
"Type": "String",
"Value": "{\"ecs_agent_version\":\"1.63.1\",\"ecs_runtime_version\":\"Docker version 20.10.13\",\"image_id\":\"ami-002e2fef4b94f8fd0\",\"image_name\":\"amzn2-ami-ecs-hvm-2.0.20220921-x86_64-ebs\",\"image_version\":\"2.0.20220921\",\"os\":\"Amazon Linux 2\",\"schema_version\":1,\"source_image_name\":\"amzn2-ami-minimal-hvm-2.0.20220912.1-x86_64-ebs\"}",
"Version": 94,
"LastModifiedDate": 1664230158.399,
"ARN": "arn:aws:ssm:eu-west-1::parameter/aws/service/ecs/optimized-ami/amazon-linux-2/recommended",
"DataType": "text"
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:11
Top Results From Across the Web
PutParameter - AWS Systems Manager
Add a parameter to the system. ... aws:ssm:integration ... To use your default AWS KMS key, choose the SecureString data type, and do...
Read more >put-parameter — AWS CLI 2.0.33 Command Reference
You can reference a parameter version ID in API actions or in Systems Manager documents (SSM documents). By default, if you don't specify...
Read more >07 best practices when using AWS SSM Parameter Store
As you know, AWS Lambda supports native environment variables, you can easy to define and add any environment variables you want during ...
Read more >christippett/ssm-parameter-store: A simple Python ... - GitHub
set default AWS region AWS_DEFAULT_REGION=us-west-2 # add parameters aws ssm put-parameter --name "param1" --value "value1" --type SecureString aws ssm ...
Read more >Pipe file directly to AWS SSM parameter store? - Stack Overflow
Rather than taking the value from stdin can you directly add to the command line arguments? aws ssm put-parameter \ --region ap-southeast-1 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Moto intercepts the underlying HTTP request that is send by the SDK, and the AWS CLI/boto3 will then convert the HTTP response to whatever format they want. I haven’t checked, but I’m assuming that the HTTP response from AWS contains a timestamp, so that’s what Moto should return as well
The exact location where to store the data doesn’t matter much, as long as the naming is sensible, for example
moto/ssm/resources/ecs/
.If there is no difference, than we might as well retrieve everything under
/aws/service/ecs
- if AWS decides to add more data, we’re already set-up to retrieve it.