Skip to content

Latest commit

 

History

History
 
 

with-vpc-s3-endpoint

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

AWS Lambda with VPC and VPC Endpoint for S3 example

The configuration in this directory creates an AWS Lambda Function deployed within a VPC with a VPC Endpoint for S3 and no Internet access. The Function writes a single object to an S3 bucket that is created as part of the supporting resources.

Be aware, that deletion of AWS Lambda with VPC can take a long time (e.g., 10 minutes).

Usage

To run this example you need to execute:

$ terraform init
$ terraform plan
$ terraform apply

Note that this example may create resources which cost money. Run terraform destroy when you don't need these resources.

Requirements

Name Version
terraform >= 1.0
aws >= 5.79
random >= 3.4

Providers

Name Version
aws >= 5.79
random >= 3.4

Modules

Name Source Version
kms terraform-aws-modules/kms/aws ~> 1.0
lambda_s3_write ../../ n/a
s3_bucket terraform-aws-modules/s3-bucket/aws ~> 3.0
security_group_lambda terraform-aws-modules/security-group/aws ~> 4.0
vpc terraform-aws-modules/vpc/aws ~> 5.0
vpc_endpoints terraform-aws-modules/vpc/aws//modules/vpc-endpoints ~> 5.0

Resources

Name Type
random_pet.this resource
aws_ec2_managed_prefix_list.this data source
aws_iam_policy_document.bucket data source
aws_iam_policy_document.endpoint data source
aws_region.current data source

Inputs

No inputs.

Outputs

Name Description
lambda_cloudwatch_log_group_arn The ARN of the Cloudwatch Log Group
lambda_function_arn The ARN of the Lambda Function
lambda_function_arn_static The static ARN of the Lambda Function. Use this to avoid cycle errors between resources (e.g., Step Functions)
lambda_function_invoke_arn The Invoke ARN of the Lambda Function
lambda_function_kms_key_arn The ARN for the KMS encryption key of Lambda Function
lambda_function_last_modified The date Lambda Function resource was last modified
lambda_function_name The name of the Lambda Function
lambda_function_qualified_arn The ARN identifying your Lambda Function Version
lambda_function_source_code_hash Base64-encoded representation of raw SHA-256 sum of the zip file
lambda_function_source_code_size The size in bytes of the function .zip file
lambda_function_version Latest published version of Lambda Function
lambda_layer_arn The ARN of the Lambda Layer with version
lambda_layer_created_date The date Lambda Layer resource was created
lambda_layer_layer_arn The ARN of the Lambda Layer without version
lambda_layer_source_code_size The size in bytes of the Lambda Layer .zip file
lambda_layer_version The Lambda Layer version
lambda_role_arn The ARN of the IAM role created for the Lambda Function
lambda_role_name The name of the IAM role created for the Lambda Function
local_filename The filename of zip archive deployed (if deployment was from local)
s3_object The map with S3 object data of zip archive deployed (if deployment was from S3)