Skip to main content

aws_ram_resource_share Resource

Use the aws_ram_resource_share InSpec audit resource to test properties of a single specific AWS RAM resource share.

For additional information, including details on parameters and properties, see the AWS documentation on AWS RAM Resource Share.

Installation

This resource is available in the Chef InSpec AWS resource pack.

See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.

Syntax

Ensure that a resource exists.

describe aws_ram_resource_share(resource_owner: 'SELF', resource_share_arn: 'RESOURCE_SHARE_ARN') do
  it { should exist }
end

Parameters

resource_owner (required)

The type of owner. Possible values: SELF and OTHER-ACCOUNTS.

resource_share_arn (required)

The Amazon Resource Name (ARN) of the resource share.

Properties

resource_share_arn
The Amazon Resource Name (ARN) of the resource share.
name
The name of the resource share.
owning_account_id
The ID of the AWS account that owns the resource share.
allow_external_principals
Indicates whether principals outside your AWS organization can be associated with a resource share.
status
The status of the resource share.
status_message
A message about the status of the resource share.
tags
The tags for the resource share.
creation_time
The time when the resource share was created.
last_updated_time
The time when the resource share was last updated.
feature_set
Indicates how the resource share was created. Possible values include CREATED_FROM_POLICY, PROMOTING_TO_STANDARD, and STANDARD.

Examples

Ensure a resource share ARN is available.

describe aws_ram_resource_share(resource_owner: 'SELF', resource_share_arn: 'RESOURCE_SHARE_ARN') do
  its('resource_share_arn') { should eq 'RESOURCE_SHARE_ARN' }
end

Ensure a resource name is available.

describe aws_ram_resource_share(resource_owner: 'SELF', resource_share_arn: 'RESOURCE_SHARE_ARN') do
    its('name') { should eq 'RESOURCE_SHARE_NAME' }
end

Matchers

This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.

The controls will pass if the get method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_ram_resource_share(resource_owner: 'SELF', resource_share_arn: 'RESOURCE_SHARE_ARN') do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_ram_resource_share(resource_owner: 'SELF', resource_share_arn: 'RESOURCE_SHARE_ARN') do
  it { should_not exist }
end

be_available

Use should to check if the work_group name is available.

describe aws_ram_resource_share(resource_owner: 'SELF', resource_share_arn: 'RESOURCE_SHARE_ARN') do
  it { should be_available }
end

AWS Permissions

Your Principal will need the RAM:Client:GetResourceSharesResponse action with Effect set to Allow.

Edit this page on GitHub.

Thank you for your feedback!

×









Search Results