Skip to main content

aws_elasticloadbalancingv2_listener_certificate Resource

Use the aws_elasticloadbalancingv2_listener_certificate InSpec audit resource to test properties of a single TLS or HTTPS listener certificate.

For additional information, including details on parameters and properties, see the AWS documentation on ElasticLoadBalancingV2 Listener Certificate.

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 listener ARN exist.

describe aws_elasticloadbalancingv2_listener_certificate(listener_arn: 'LISTENER_ARN') do
  it { should exist }
end

Ensure that the listener has a desired port.

describe aws_elasticloadbalancingv2_listener_certificate(listener_arn: 'LISTENER_ARN') do
  its('certificate_arn') { should eq "CERTIFICATE_ARN" }
end

Parameters

listener_arn (required)

The Amazon Resource Name (ARN) of the listener certificate.

Properties

certificate_arn
The Amazon Resource Name (ARN) of the certificate.
is_default
Indicates whether the certificate is the default certificate. Valid values: true or false.

Examples

Ensure that a listener ARN exists.

describe aws_elasticloadbalancingv2_listener_certificate(listener_arn: 'LISTENER_ARN') do
  it { should exist }
end

Ensure that listener has a desired certificate ARN attached.

describe aws_elasticloadbalancingv2_listener_certificate(listener_arn: 'LISTENER_ARN') do
  its('certificate_arn') { should eq "CERTIFICATE_ARN" }
end

Matchers

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

exist

The control will pass if the describe returns at least one result.

Use should_not to test the entity should not exist.

describe aws_elasticloadbalancingv2_listener(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!

×









Search Results