aws_dms_replication_subnet_group Resource
Use the aws_dms_replication_subnet_group
InSpec audit resource to test properties of a single DMS replication instance subnet group.
For additional information, including details on parameters and properties, see the AWS documentation on DMS Replication Subnet Group.
Install
This resource is available in the Chef InSpec AWS resource pack.
For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.
Syntax
Ensure that a subnet group identifier exists.
describe aws_dms_replication_subnet_group(replication_subnet_group_identifier: 'test1') do
it { should exist }
end
Parameters
replication_subnet_group_identifier
(required)The identifier for the replication subnet group.
Properties
replication_subnet_group_identifier
- The identifier of the replication subnet group.
replication_subnet_group_description
- The description of the replication subnet group.
vpc_id
- The ID of the virtual private cloud.
subnet_group_status
- The status of the replication subnet group.
subnets
- The subnets that are in the replication subnet group.
Examples
Ensure a identifier is available.
describe aws_dms_replication_subnet_group(replication_subnet_group_identifier: 'SUBNET_GROUP_IDENTIFIER') do
its('replication_subnet_group_identifier') { should eq 'SUBNET_GROUP_IDENTIFIER' }
end
Ensure that the vpc is available.
describe aws_dms_replication_subnet_group(replication_subnet_group_identifier: 'SUBNET_GROUP_IDENTIFIER') do
its('vpc_id') { should eq 'VPC_ID' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The controls will pass if the describe
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_dms_replication_subnet_group(replication_subnet_group_identifier: 'SUBNET_GROUP_IDENTIFIER') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_dms_replication_subnet_group(replication_subnet_group_identifier: 'SUBNET_GROUP_IDENTIFIER') do
it { should_not exist }
end
be_available
Use should
to check if the identifier is available.
describe aws_dms_replication_subnet_group(replication_subnet_group_identifier: 'SUBNET_GROUP_IDENTIFIER') do
it { should be_available }
end
AWS Permissions
Your Principal will need the DatabaseMigrationService:Client:DescribeReplicationSubnetGroupsResponse
action with Effect
set to Allow
.