Sha256: b0d03661195982847be61eeba888c6c729141abcd23842e8ef3999ce9d4c0736

Contents?: true

Size: 1.61 KB

Versions: 52

Compression:

Stored size: 1.61 KB

Contents

### exist

```ruby
describe iam_group('my-iam-group') do
  it { should exist }
end
```

### be_allowed_action

```ruby
describe iam_group('my-iam-group') do
  it { should be_allowed_action('ec2:DescribeInstances') }
  it { should be_allowed_action('s3:Put*').resource_arn('arn:aws:s3:::my-bucket-name/*') }
end
```

### have_iam_policy

```ruby
describe iam_group('my-iam-group') do
  it { should have_iam_policy('ReadOnlyAccess') }
end
```

### have_iam_user

```ruby
describe iam_group('my-iam-group') do
  it { should have_iam_user('my-iam-user') }
end
```

### have_inline_policy

```ruby
describe iam_group('my-iam-group') do
  it { should have_inline_policy('InlineEC2FullAccess') }
  it do
    should have_inline_policy('InlineEC2FullAccess').policy_document(<<-'DOC')
{
  "Statement": [
    {
      "Action": "ec2:*",
      "Effect": "Allow",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "elasticloadbalancing:*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "cloudwatch:*",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "autoscaling:*",
      "Resource": "*"
    }
  ]
}
DOC
  end
end
```

You can test absence of inline policies.

```ruby
describe iam_group('my-iam-group') do
  it { should_not have_inline_policy }
end
```

### advanced

`iam_group` can use `Aws::IAM::Group` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/IAM/Group.html).

```ruby
describe iam_group('my-iam-group') do
  its('users.count') { should eq 5 }
end
```

or

```ruby
describe iam_group('my-iam-group') do
  its('resource.users.count') { should eq 5 }
end
```

Version data entries

52 entries across 52 versions & 3 rubygems

Version Path
awspec-1.23.0 doc/_resource_types/iam_group.md
awspec-1.22.1 doc/_resource_types/iam_group.md
awspec-1.22.0 doc/_resource_types/iam_group.md
awspec-1.21.1 doc/_resource_types/iam_group.md
awspec-1.21.0 doc/_resource_types/iam_group.md
awspec-1.20.0 doc/_resource_types/iam_group.md
awspec-1.19.2 doc/_resource_types/iam_group.md
awspec-1.19.1 doc/_resource_types/iam_group.md
awspec-1.19.0 doc/_resource_types/iam_group.md
cthiesfork-awspec-1.2.4 doc/_resource_types/iam_group.md
awspec-api_gateway_extended-1.2.4 doc/_resource_types/iam_group.md
awspec-api_gateway_extended-1.2.3 doc/_resource_types/iam_group.md
awspec-1.18.6 doc/_resource_types/iam_group.md
cthiesfork-awspec-1.2.2 doc/_resource_types/iam_group.md
cthiesfork-awspec-1.2.1 doc/_resource_types/iam_group.md
awspec-1.18.5 doc/_resource_types/iam_group.md
cthiesfork-awspec-1.2.0 doc/_resource_types/iam_group.md
cthiesfork-awspec-1.1.0 doc/_resource_types/iam_group.md
cthiesfork-awspec-1.0.0 doc/_resource_types/iam_group.md
awspec-1.18.4 doc/_resource_types/iam_group.md