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..
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_modifiedfunction_arns- The Amazon Resource Name (ARN) of the function.
Field:
function_arnmaximum_retry_attempts- The maximum number of times to retry when the function returns an error.
Field:
maximum_retry_attemptsdestination_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
For a full list of available matchers, see 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 AWS principal will need the Lambda:Client:ListFunctionEventInvokeConfigsResponse action with Effect set to Allow.