From 0eae0794e41d3c83ea315896d0fa989f686ce83d Mon Sep 17 00:00:00 2001 From: DAVINDER PAL Date: Mon, 15 Mar 2021 16:07:14 +0530 Subject: [PATCH] Added Tier as option to aws_ssm_parameter_store module (#305) * Added Tier as option * * added better description * added changelong Co-authored-by: Markus Bergholz Co-authored-by: Mark Chappell --- aws_ssm_parameter_store.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/aws_ssm_parameter_store.py b/aws_ssm_parameter_store.py index d31a79b2bef..3d49c133048 100644 --- a/aws_ssm_parameter_store.py +++ b/aws_ssm_parameter_store.py @@ -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) - - Michael De La Rue (@mikedlr) + - "Davinder Pal (@116davinder) " + - "Nathan Webster (@nathanwebsterdotme)" + - "Bill Wang (@ozbillwang) " + - "Michael De La Rue (@mikedlr)" + extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -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') }}" @@ -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")): @@ -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(