Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soumyo/aws_lambda_event_invoke_config #672

Merged
merged 5 commits into from Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions docs/resources/aws_lambda_event_invoke_config.md
Expand Up @@ -5,27 +5,25 @@ platform: aws

# aws_lambda_event_invoke_config

Use the `aws_lambda_event_invoke_config` InSpec audit resource to test properties of a single specific AWS Lambda EventInvokeConfig.
Use the `aws_lambda_event_invoke_config` InSpec audit resource to test properties of a specific AWS Lambda EventInvokeConfig.

The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous invocation on a version or an alias.

## Syntax

Ensure that the config exists.

describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
it { should exist }
end

## Parameters

`function_name` _(required)_

| Property | Description |
| --- | --- |
| function_name | The name of the function. |
The name of the function.

For additional information, see the [AWS documentation on AWS CloudFront RealtimeLogConfig.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html).
For additional information, see the [AWS documentation on AWS Lambda EventInvokeConfig.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html).

## Properties

Expand All @@ -41,18 +39,18 @@ For additional information, see the [AWS documentation on AWS CloudFront Realtim
## Examples

### Ensure an arn is available.
describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
its('function_arn') { should eq 'FunctionARN' }
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
its('function_arn') { should eq 'FUNCTION_ARN' }
end

### Ensure a maximum retry attempts is available.
describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
its('maximum_retry_attempts') { should eq 1 }
end

### Ensure on success destination is available.
describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
its('on_success_destinations') { should include 'Destination' }
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
its('on_success_destinations') { should include 'DESTINATION' }
end

## Matchers
Expand All @@ -65,21 +63,21 @@ The controls will pass if the `get` method returns at least one result.

Use `should` to test that the entity exists.

describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
it { should exist }
end

Use `should_not` to test the entity does not exist.

describe aws_lambda_event_invoke_config(function_name: 'dummy') do
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
it { should_not exist }
end

### be_available

Use `should` to check if the entity is available.

describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
it { should be_available }
end

Expand Down
18 changes: 8 additions & 10 deletions docs/resources/aws_lambda_event_invoke_configs.md
Expand Up @@ -13,19 +13,17 @@ The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous

Ensure that the config exists.

describe aws_lambda_event_invoke_configs(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
it { should exist }
end

## Parameters

`function_name` _(required)_

| Property | Description |
| --- | --- |
| function_name | The name of the function. |
The name of the function.

For additional information, see the [AWS documentation on AWS CloudFront RealtimeLogConfig.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html).
For additional information, see the [AWS documentation on AWS Lambda EventInvokeConfig.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html).

## Properties

Expand All @@ -39,12 +37,12 @@ For additional information, see the [AWS documentation on AWS CloudFront Realtim
## Examples

### Ensure an arn is available.
describe aws_lambda_event_invoke_config(function_name: 'FunctionName') do
its('function_arns') { should include 'FunctionARN' }
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: 'FunctionName') do
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
its('maximum_retry_attempts') { should include 1 }
end

Expand All @@ -58,13 +56,13 @@ The controls will pass if the `list` method returns at least one result.

Use `should` to test that the entity exists.

describe aws_lambda_event_invoke_configs(function_name: 'FunctionName') do
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: 'dummy') do
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
it { should_not exist }
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/aws_lambda_event_invoke_config.rb
Expand Up @@ -7,7 +7,7 @@ class AWSLambdaEventInvokeConfig < AwsResourceBase
desc 'Retrieves the configuration for asynchronous invocation for a function, version, or alias.'

example "
describe get_function_event_invoke_config(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_config(function_name: 'FUNCTION_NAME') do
it { should exist }
end
"
Expand Down
2 changes: 1 addition & 1 deletion libraries/aws_lambda_event_invoke_configs.rb
Expand Up @@ -7,7 +7,7 @@ class AWSLambdaEventInvokeConfigs < AwsResourceBase
desc 'Gets information about the scalable targets in the specified namespace.'

example "
describe aws_lambda_event_invoke_configs(function_name: 'FunctionName') do
describe aws_lambda_event_invoke_configs(function_name: 'FUNCTION_NAME') do
it { should exist }
end
"
Expand Down