diff --git a/doc/_resource_types/ssm_parameter.md b/doc/_resource_types/ssm_parameter.md index c0d3920fe..4d9e8697b 100644 --- a/doc/_resource_types/ssm_parameter.md +++ b/doc/_resource_types/ssm_parameter.md @@ -26,8 +26,8 @@ end ```ruby describe ssm_parameter('my-parameter') do - its(:key_id) { should be_eql('6a81f446-27b0-4d51-a04f-af7ddeea2e22') } - its(:description) { should be_eql('Some string description') } + its(:arn) { should be_eql('arn:aws:ssm:REGION:ACCOUNT_ID:parameter/my-parameter') } + its(:name) { should be_eql('my-parameter') } its(:version) { should be_eql(1) } end ``` diff --git a/doc/resource_types.md b/doc/resource_types.md index 82d563b2c..9b065a249 100644 --- a/doc/resource_types.md +++ b/doc/resource_types.md @@ -3340,13 +3340,13 @@ end ``` -### its(:name), its(:type), its(:key_id), its(:last_modified_date), its(:last_modified_user), its(:description), its(:allowed_pattern), its(:version), its(:tier), its(:policies) +### its(:name), its(:type), its(:value), its(:version), its(:selector), its(:source_result), its(:last_modified_date), its(:arn) ### :unlock: Advanced use ```ruby describe ssm_parameter('my-parameter') do - its(:key_id) { should be_eql('6a81f446-27b0-4d51-a04f-af7ddeea2e22') } - its(:description) { should be_eql('Some string description') } + its(:arn) { should be_eql('arn:aws:ssm:REGION:ACCOUNT_ID:parameter/my-parameter') } + its(:name) { should be_eql('my-parameter') } its(:version) { should be_eql(1) } end ``` diff --git a/lib/awspec/helper/finder/ssm_parameter.rb b/lib/awspec/helper/finder/ssm_parameter.rb index 11518b6de..b50ba0f13 100644 --- a/lib/awspec/helper/finder/ssm_parameter.rb +++ b/lib/awspec/helper/finder/ssm_parameter.rb @@ -2,15 +2,9 @@ module Awspec::Helper module Finder module SsmParameter def find_ssm_parameter(name) - ssm_client.describe_parameters( - { - filters: [ - { - key: 'Name', - values: [name] - } - ] - }).parameters[0] + ssm_client.get_parameter({ + name: name, with_decryption: false + }).parameter end def find_parameter_tag(id, tag_key) diff --git a/lib/awspec/stub/ssm_parameter.rb b/lib/awspec/stub/ssm_parameter.rb index 92633a9d1..9c87cf9c7 100644 --- a/lib/awspec/stub/ssm_parameter.rb +++ b/lib/awspec/stub/ssm_parameter.rb @@ -1,16 +1,14 @@ Aws.config[:ssm] = { stub_responses: { - describe_parameters: { - parameters: [ - { - name: 'my-parameter', - type: 'SecureString', - key_id: 'alias/aws/ssm', - description: 'Some description', - version: 1, - next_token: nil - } - ] + get_parameter: { + parameter: + { + name: 'my-parameter', + type: 'SecureString', + version: 1, + arn: 'arn:aws:ssm:REGION:ACCOUNT_ID:parameter/my-parameter', + value: 'encrypted' + } } } } diff --git a/spec/type/ssm_parameter_spec.rb b/spec/type/ssm_parameter_spec.rb index 7c3c1d41e..2c01d9530 100644 --- a/spec/type/ssm_parameter_spec.rb +++ b/spec/type/ssm_parameter_spec.rb @@ -4,7 +4,7 @@ describe ssm_parameter('my-parameter') do it { should exist } it { should be_encrypted } - its(:key_id) { should be_eql('alias/aws/ssm') } - its(:description) { should be_eql('Some description') } its(:version) { should be_eql(1) } + its(:arn) { should be_eql('arn:aws:ssm:REGION:ACCOUNT_ID:parameter/my-parameter') } + its(:value) { should be_eql('encrypted') } end