Skip to content

Commit

Permalink
Added Tier as option to aws_ssm_parameter_store module (ansible-colle…
Browse files Browse the repository at this point in the history
…ctions#305)

* Added Tier as option
* * added better description
* added changelong

Co-authored-by: Markus Bergholz <[email protected]>
Co-authored-by: Mark Chappell <[email protected]>
  • Loading branch information
3 people authored and abikouo committed Sep 18, 2023
1 parent 3e42eb8 commit 0eae079
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions aws_ssm_parameter_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,21 @@
choices: ['never', 'changed', 'always']
default: changed
type: str
tier:
description:
- Parameter store tier type.
required: false
choices: ['Standard', 'Advanced', 'Intelligent-Tiering']
default: Standard
type: str
version_added: 1.5.0
author:
- Nathan Webster (@nathanwebsterdotme)
- Bill Wang (@ozbillwang) <[email protected]>
- Michael De La Rue (@mikedlr)
- "Davinder Pal (@116davinder) <[email protected]>"
- "Nathan Webster (@nathanwebsterdotme)"
- "Bill Wang (@ozbillwang) <[email protected]>"
- "Michael De La Rue (@mikedlr)"
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
Expand Down Expand Up @@ -111,6 +122,13 @@
value: "Test1234"
overwrite_value: "always"
- name: Create or update key/value pair in aws parameter store with tier
community.aws.aws_ssm_parameter_store:
name: "Hello"
description: "This is your first key"
value: "World"
tier: "Advanced"
- name: recommend to use with aws_ssm lookup plugin
ansible.builtin.debug:
msg: "{{ lookup('amazon.aws.aws_ssm', 'hello') }}"
Expand Down Expand Up @@ -157,7 +175,8 @@ def create_update_parameter(client, module):
args = dict(
Name=module.params.get('name'),
Value=module.params.get('value'),
Type=module.params.get('string_type')
Type=module.params.get('string_type'),
Tier=module.params.get('tier')
)

if (module.params.get('overwrite_value') in ("always", "changed")):
Expand Down Expand Up @@ -237,6 +256,7 @@ def setup_module_object():
decryption=dict(default=True, type='bool'),
key_id=dict(default="alias/aws/ssm"),
overwrite_value=dict(default='changed', choices=['never', 'changed', 'always']),
tier=dict(default='Standard', choices=['Standard', 'Advanced', 'Intelligent-Tiering']),
)

return AnsibleAWSModule(
Expand Down

0 comments on commit 0eae079

Please sign in to comment.