Skip to content

Commit fd516d2

Browse files
committed
* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python: docs: Terraform reference for SAR Lambda Layer (aws-powertools#716) chore(deps-dev): bump flake8-bugbear from 21.9.1 to 21.9.2 (aws-powertools#712) chore(deps): bump boto3 from 1.18.49 to 1.18.51 (aws-powertools#713) chore(deps): bump boto3 from 1.18.41 to 1.18.49 (aws-powertools#703) chore(deps): bump codecov/codecov-action from 2.0.2 to 2.1.0 (aws-powertools#675)
2 parents 573ef89 + 68c810e commit fd516d2

File tree

4 files changed

+63
-14
lines changed

4 files changed

+63
-14
lines changed

Diff for: .github/workflows/python_build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Complexity baseline
3838
run: make complexity-baseline
3939
- name: Upload coverage to Codecov
40-
uses: codecov/codecov-action@v2.0.2
40+
uses: codecov/codecov-action@v2.1.0
4141
with:
4242
file: ./coverage.xml
4343
# flags: unittests

Diff for: docs/index.md

+48
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,54 @@ If using SAM, you can include this SAR App as part of your shared Layers stack,
124124
)
125125
```
126126

127+
=== "Terraform"
128+
129+
> Credits to [Dani Comnea](https://github.com/DanyC97) for providing the Terraform equivalent.
130+
131+
```terraform hl_lines="12-13 15-20 23-25 40"
132+
terraform {
133+
required_version = "~> 0.13"
134+
required_providers {
135+
aws = "~> 3.50.0"
136+
}
137+
}
138+
139+
provider "aws" {
140+
region = "us-east-1"
141+
}
142+
143+
resource "aws_serverlessapplicationrepository_cloudformation_stack" "deploy_sar_stack" {
144+
name = "aws-lambda-powertools-python-layer"
145+
146+
application_id = data.aws_serverlessapplicationrepository_application.sar_app.application_id
147+
semantic_version = data.aws_serverlessapplicationrepository_application.sar_app.semantic_version
148+
capabilities = [
149+
"CAPABILITY_IAM",
150+
"CAPABILITY_NAMED_IAM"
151+
]
152+
}
153+
154+
data "aws_serverlessapplicationrepository_application" "sar_app" {
155+
application_id = "arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer"
156+
semantic_version = var.aws_powertools_version
157+
}
158+
159+
variable "aws_powertools_version" {
160+
type = string
161+
default = "1.20.2"
162+
description = "The AWS Powertools release version"
163+
}
164+
165+
output "deployed_powertools_sar_version" {
166+
value = data.aws_serverlessapplicationrepository_application.sar_app.semantic_version
167+
}
168+
169+
# Fetch Lambda Powertools Layer ARN from deployed SAR App
170+
output "aws_lambda_powertools_layer_arn" {
171+
value = aws_serverlessapplicationrepository_cloudformation_stack.deploy_sar_stack.outputs.LayerVersionArn
172+
}
173+
```
174+
127175
??? tip "Example of least-privileged IAM permissions to deploy Layer"
128176

129177
> Credits to [mwarkentin](https://github.com/mwarkentin) for providing the scoped down IAM permissions.

Diff for: poetry.lock

+13-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bandit = "^1.7.0"
4949
radon = "^5.1.0"
5050
xenon = "^0.8.0"
5151
flake8-eradicate = "^1.1.0"
52-
flake8-bugbear = "^21.9.1"
52+
flake8-bugbear = "^21.9.2"
5353
mkdocs-material = "^7.3.0"
5454
mkdocs-git-revision-date-plugin = "^0.3.1"
5555
mike = "^0.6.0"

0 commit comments

Comments
 (0)