CLI for setting and retrieving parameters and secrets from AWS SSM.
From the root project directory:
pip install .
Running:
ssm --help
The Following authentication methods are supported:
- Environment variables
- Shared credential file (~/.aws/credentials)
- AWS config file (~/.aws/config)
For more details please see here.
List all parameters:
ssm list
Output:
+------------------------------------+---------------+
| Name | Description |
+====================================+===============+
| /platform/infra/testing | Test param |
+------------------------------------+---------------+
| MY_KEY | MY TEST KEY |
+------------------------------------+---------------+
Filter parameters by name:
ssm list --name hello
Will list parameters starting with hello
+--------+---------------+
| Name | Description |
+========+===============+
| hello1 | world1 |
+--------+---------------+
ssm delete --name myparam --delete invalid
Will delete the parameter myparam, invalid parameters are ignored and printed on stdout.
Output:
+----------------------+
| Deleted Parameters |
+======================+
| myparm |
+----------------------+
+----------------------+
| Invalid Parameters |
+======================+
| invalid |
+----------------------+
ssm get --name MY_KEY
Will retrieve and decrypt the param MY_KEY Output:
+--------+---------+
| Name | Value |
+========+=========+
| MY_KEY | MY_VAL |
+--------+---------+
ssm put --name <name> --value <value> --description <optional description> --encrypt
Multiple operation can be done using the from-file option.
Specify the path to a yaml file using the --path <path> option:
ssm from-file --path <path to yaml file>
The file should be a valid yaml file with the keys equal to the operations namely:
- list
- get
- delete
- put
Multiple operation can be specified in one file.
put:
- name: test
value: val
encrypt: True
Output:
put:
CreatedParameters:
- test
list:
- someparam
- anotherparam
Output:
list:
- Description: Some Parameter
Name: someparam
- Description: Another Parameter
Name: anotherparam
delete:
- validparam
- invalidparam
Output:
delete:
DeletedParameters:
- x14
InvalidParameters:
- invalidparam
get:
- test
- invalid
Output:
get:
GetParameters:
- Name: test
Type: SecureString
Value: val
InvalidParameters:
- invalid