Skip to main content

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.

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 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 Principal will need the ElasticLoadBalancingV2:Client:DescribeListenerCertificatesOutput action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×