Sha256: ff455551e7da517700561521c23f22abb768484c1e148531ba28cd14e625d917

Contents?: true

Size: 1.43 KB

Versions: 131

Compression:

Stored size: 1.43 KB

Contents

### exist

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

### be_allowed_action

```ruby
describe iam_user('my-iam-user') 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_user('my-iam-user') do
  it { should have_iam_policy('ReadOnlyAccess') }
end
```

### have_inline_policy

```ruby
describe iam_user('my-iam-user') do
  it { should have_inline_policy('AllowS3BucketAccess') }
  it do
    should have_inline_policy('AllowS3BucketAccess').policy_document(<<-'DOC')
{
"Statement": [
    {
     "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Action": "s3:*",
      "Effect": "Allow",
      "Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"]
    }
  ]
}
DOC
  end
end
```

### belong_to_iam_group

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

### advanced

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

```ruby
describe iam_user('my-iam-user') do
  its('login_profile.password_reset_required') { should eq false }
end
```

or

```ruby
describe iam_user('my-iam-user') do
  its('resource.login_profile.password_reset_required') { should eq false }
end
```

Version data entries

131 entries across 131 versions & 2 rubygems

Version Path
awspec-0.79.2 doc/_resource_types/iam_user.md
awspec-0.79.1 doc/_resource_types/iam_user.md
awspec-0.79.0 doc/_resource_types/iam_user.md
awspec-0.78.1 doc/_resource_types/iam_user.md
awspec-0.77.1 doc/_resource_types/iam_user.md
awspec-0.77.0 doc/_resource_types/iam_user.md
awspec-0.76.1 doc/_resource_types/iam_user.md
awspec-0.76.0 doc/_resource_types/iam_user.md
awspec-0.75.2 doc/_resource_types/iam_user.md
awspec-0.75.1 doc/_resource_types/iam_user.md
awspec-0.75.0 doc/_resource_types/iam_user.md
awspec-0.74.1 doc/_resource_types/iam_user.md
awspec-0.74.0 doc/_resource_types/iam_user.md
awspec-0.73.2 doc/_resource_types/iam_user.md
awspec-0.73.1 doc/_resource_types/iam_user.md
awspec-0.73.0 doc/_resource_types/iam_user.md
awspec-0.72.0 doc/_resource_types/iam_user.md
awspec-0.71.0 doc/_resource_types/iam_user.md
awspec-0.70.0 doc/_resource_types/iam_user.md
awspec-0.69.1 doc/_resource_types/iam_user.md