Skip to content

Commit

Permalink
final version
Browse files Browse the repository at this point in the history
  • Loading branch information
ozbillwang committed Apr 11, 2017
1 parent e8a5209 commit 08f6ca1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pyc
*.retry
24 changes: 19 additions & 5 deletions library/ssm_parameter_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,37 @@
name: "Hello"
state: absent
- name: Create or update secure key/value pair in aws parameter store
- name: Create or update secure key/value pair with default kms key (aws/ssm)
ssm_parameter_store:
name: "Hello"
description: "This is your first key"
string_type: "SecureString"
value: "World"
- name: Create or update secure key/value pair with nominated kms key
ssm_parameter_store:
name: "Hello"
description: "This is your first key"
string_type: "SecureString"
key_id: "alias/demo"
value: "World"
- name: Retrieving plain-text secret
ssm_parameter_store:
name: "Hello"
state: show
register: result
- name: Retrieving plain-text secret with custom kms key
- name: Retrieving SecureString secret with default kms key (aws/ssm)
ssm_parameter_store:
name: "Hello"
state: show
register: result
- name: Retrieving SecureString secret with nominated kms key
ssm_parameter_store:
name: "Hello"
key_id: "aws/ssm"
key_id: "alias/demo"
state: show
register: result
Expand Down Expand Up @@ -128,7 +142,7 @@
type: string
sample: "Hello"
type:
description: The type of parameter. Valid values include the following: String, String list, Secure string..
description: The type of parameter. Valid values include [ String, StringList, SecureString ]
returned: success
type: string
sample: "String"
Expand Down Expand Up @@ -167,7 +181,7 @@ def create_update_parameter(client, module):
if module.params.get('description'):
args.update(Description=module.params.get('description'))

if module.params.get('string_type') is 'SecureString':
if module.params.get('string_type') == 'SecureString':
args.update(KeyId=module.params.get('key_id'))

try:
Expand Down
12 changes: 10 additions & 2 deletions test/roles/test/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
name: "Hello"
state: absent

- name: Create or update secure key/value pair in aws parameter store
- name: Create or update secure key/value pair with nominated kms key
ssm_parameter_store:
name: "Hello"
description: "This is your first key"
key_id: "alias/demo"
string_type: "SecureString"
value: "World"

Expand All @@ -22,13 +23,20 @@
state: show
register: result

- name: Retrieving plain-text secret with custom kms key
- name: Retrieving plain-text secret with default kms key
ssm_parameter_store:
name: "Hello"
key_id: "aws/ssm"
state: show
register: result

- name: Retrieving plain-text secret with nominated kms key
ssm_parameter_store:
name: "Hello"
key_id: "alias/demo"
state: show
register: result

- name: Retrieving secret without decrypted
ssm_parameter_store:
name: "Hello"
Expand Down

0 comments on commit 08f6ca1

Please sign in to comment.