Skip to main content

aws_lambda Resource

[edit on GitHub]

Use the aws_lambda resource to test a specific AWS Lambda function.

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

describe aws_lambda('LAMBDA_FUNCTION') do
    it { should exist}
    its ('handler') { should eq 'main.on_event'}
    its ('version') { should eq '$LATEST' }
    its ('runtime') { should eq 'python3.7' }
end

Parameters

This resource expects the name of the AWS Lambda function.

Properties

This resource can test all properties defined by the Aws::lambda::Types::GetFunctionResponse class.

Examples

Test that all lambda functions with a particular tag is correctly deployed.

describe aws_lambda('LAMBDA_FUNCTION') do
    it { should exist}
    its ('handler') { should eq 'main.on_event'}
    its ('version') { should eq '$LATEST' }
    its ('runtime') { should eq 'python3.7' }
end

Matchers

This InSpec audit resource uses the standard matchers. For a full list of available matchers, please visit our matchers page.

AWS Permissions

Your Principal will need the Lambda:Client:GetFunctionResponse action with Effect set to Allow.

You can find detailed documentation at AWS Lambda

Was this page helpful?

×









Search Results