aws_elasticloadbalancingv2_listener_certificates resource
Use the aws_elasticloadbalancingv2_listener_certificates
InSpec audit resource to test properties of multiple TLS or HTTPS listener certificates.
For additional information, including details on parameters and properties, see the AWS documentation on ElasticLoadBalancingV2 Listener Certificate.
Syntax
Ensure that a listener ARN exists.
describe aws_elasticloadbalancingv2_listener_certificates(listener_arn: 'LISTENER_ARN') do
it { should exist }
end
Parameters
listener_arn
(required)The Amazon Resource Name (ARN) of the listener certificate.
Properties
certificate_arns
- The Amazon Resource Name (ARN) of the certificate.
is_default
- Indicates whether the certificate is the default certificate.
Examples
Ensure a listener ARN is available:
describe aws_elasticloadbalancingv2_listener_certificates(listener_arn: 'LISTENER_ARN') do
it { should exist }
end
Ensure that listener has a desired certificate ARN attached:
describe aws_elasticloadbalancingv2_listener_certificates(listener_arn: 'LISTENER_ARN') do
its('certificate_arns') { should include "CERTIFICATE_ARN" }
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_elasticloadbalancingv2_listener_certificates(listener_arn: 'LISTENER_ARN') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_elasticloadbalancingv2_listener_certificates(listener_arn: 'LISTENER_ARN') do
it { should_not exist }
end
AWS Permissions
Your AWS principal will need the ElasticLoadBalancingV2:Client:DescribeListenerCertificatesOutput
action with Effect
set to Allow
.