Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eoinsha/public-s3-lambda-code-example
https://github.com/eoinsha/public-s3-lambda-code-example
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/eoinsha/public-s3-lambda-code-example
- Owner: eoinsha
- Created: 2023-10-20T15:19:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-20T15:19:53.000Z (about 1 year ago)
- Last Synced: 2024-04-13T16:08:08.512Z (9 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Publicly accessible Lambda code
An example of public Lambda code access in S3In cases where you want to provide a CloudFormation template or Terraform module for a publicly-distributed Lambda function, you may need to provide public access to the code in an S3 bucket.
You want to do this without making the public bucket's permissions too broad.This repository is a brief example of how to make a ZIP-packaged Lambda Function code accessible publicly without exposing any unnecessary access.
Only the Lambda service of any AWS account may retrieve the code, limiting the risk of security issues and high bucket owner costs.## Deployment
1. Edit the bucket name in each template
2. Deploy the bucket in the first account:
```bash
aws cloudformation deploy --stack-name=lambda-package-bucket --template bucket-template.yaml
```
3. Deploy the Lambda function in _any_ other account:
```bash
aws cloudformation deploy --stack-name=lambda-package --template template.yaml --capabilities CAPABILITY_NAMED_IAM
```