Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#443: SSM Parameters pagination issue, replaced with get_parameter AP… #481

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/_resource_types/ssm_parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
6 changes: 3 additions & 3 deletions doc/resource_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
12 changes: 3 additions & 9 deletions lib/awspec/helper/finder/ssm_parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 9 additions & 11 deletions lib/awspec/stub/ssm_parameter.rb
Original file line number Diff line number Diff line change
@@ -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'
}
}
}
}
4 changes: 2 additions & 2 deletions spec/type/ssm_parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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