aws_lambda_event_invoke_configs Resource
Use the aws_lambda_event_invoke_configs
InSpec audit resource to test properties of the plural resource of AWS Lambda EventInvokeConfig.
The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous invocation on a version or an alias.
For additional information, including details on parameters and properties, see the AWS documentation on AWS Lambda EventInvokeConfig..
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 the config exists.
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
it { should exist }
end
Parameters
function_name
(required)The name of the function.
Properties
last_modified
- The date and time that the configuration was last updated.
Field:
last_modified
function_arns
- The Amazon Resource Name (ARN) of the function.
Field:
function_arn
maximum_retry_attempts
- The maximum number of times to retry when the function returns an error.
Field:
maximum_retry_attempts
destination_configs
- A destination for events after they have been sent to a function for processing.
Field:
destination_configs
Examples
Ensure an arn is available.
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
its('function_arns') { should include 'FUNCTION_ARN' }
end
Ensure a maximum retry attempts is available.
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
its('maximum_retry_attempts') { should include 1 }
end
Matchers
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
The controls will pass if the list
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
it { should_not exist }
end
AWS Permissions
Your Principal will need the Lambda:Client:ListFunctionEventInvokeConfigsResponse
action with Effect
set to Allow
.