Sha256: a24e621ea6facb47b564d37a52041dfbdec59091a10181233a37db35b9bf6b8d

Contents?: true

Size: 1.48 KB

Versions: 20

Compression:

Stored size: 1.48 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_group

```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
```

### 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

20 entries across 20 versions & 1 rubygems

Version Path
awspec-1.15.2 doc/_resource_types/iam_group.md
awspec-1.15.1 doc/_resource_types/iam_group.md
awspec-1.15.0 doc/_resource_types/iam_group.md
awspec-1.14.1 doc/_resource_types/iam_group.md
awspec-1.14.0 doc/_resource_types/iam_group.md
awspec-1.13.0 doc/_resource_types/iam_group.md
awspec-1.12.7 doc/_resource_types/iam_group.md
awspec-1.12.6 doc/_resource_types/iam_group.md
awspec-1.12.5 doc/_resource_types/iam_group.md
awspec-1.12.4 doc/_resource_types/iam_group.md
awspec-1.12.3 doc/_resource_types/iam_group.md
awspec-1.12.2 doc/_resource_types/iam_group.md
awspec-1.12.1 doc/_resource_types/iam_group.md
awspec-1.12.0 doc/_resource_types/iam_group.md
awspec-1.11.1 doc/_resource_types/iam_group.md
awspec-1.11.0 doc/_resource_types/iam_group.md
awspec-1.10.0 doc/_resource_types/iam_group.md
awspec-1.9.0 doc/_resource_types/iam_group.md
awspec-1.8.0 doc/_resource_types/iam_group.md
awspec-1.7.0 doc/_resource_types/iam_group.md