title | platform |
---|---|
About the aws_dhcp_options Resource |
aws |
Use the aws_dhcp_options
InSpec audit resource to test properties of a single AWS DHCP Options.
Ensure that an aws_dhcp_options
exists
describe aws_dhcp_options('dopt-0123456789abcdefg') do
it { should exist }
end
describe aws_dhcp_options(dhcp_options_id: 'dopt-0123456789abcdefg') do
it { should exist }
end
This resource accepts a single parameter, the DHCP Options ID which uniquely identifies the DHCP Options.
This can be passed either as a string or as a dhcp_options_id: 'value'
key-value entry in a hash.
See also the AWS documentation on EC2.
Property | Description |
---|---|
dhcp_configurations | The list of dhcp configurations |
domain_name_servers | The list of domain name servers in the dhcp configuration |
ntp_servers | The list of ntp servers in the dhcp configuration |
tags | The tags of the DHCP Options. |
describe aws_dhcp_options('dopt-0123456789abcdefg') do
its('tags') { should include(:Environment => 'env-name',
:Name => 'dhcp-options-name')}
end
Your Principal will need the ec2:DescribeDhcpOptions
action with Effect set to Allow.
You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon EC2.