-
Notifications
You must be signed in to change notification settings - Fork 400
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
feat: add workflow to trigger external pipeline for publishing lambda layers #129
feat: add workflow to trigger external pipeline for publishing lambda layers #129
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #129 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 706 706
Branches 66 66
=========================================
Hits 706 706 Continue to review full report at Codecov.
|
This is awesome - Thanks for doing that ;) As to the docs, you can add that in the homepage under Installation: https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/docs/content/index.mdx Create a sub-heading called |
…rtools-python into feat/lambda-layers
Create the layer via API with: | ||
|
||
```bash:title=bash-script | ||
aws serverlessrepo create-cloud-formation-change-set --application-id arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer --stack-name YOUR_STACK_NAME --capabilities CAPABILITY_NAMED_IAM | ||
CHANGE_SET_ID=$(aws cloudformation list-change-sets --stack-name YOUR_STACK_NAME --query 'Summaries[*].ChangeSetId' --output text) | ||
aws cloudformation wait change-set-create-complete --change-set-name $CHANGE_SET_ID | ||
aws cloudformation execute-change-set --change-set-name $CHANGE_SET_ID | ||
``` | ||
|
||
this will create a CloudFormation stack with the powertools layer in a specific region where you run this commands. | ||
Keep in mind that layers are regional resources and you need to create the layer in every region where you need it. | ||
Alternatively, you can deploy the layer from the AWS Console by navigating to Serverless Application Repository and search for `aws-lambda-powertools-python-layer` and follow the deploy steps from there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create the layer via API with: | |
```bash:title=bash-script | |
aws serverlessrepo create-cloud-formation-change-set --application-id arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer --stack-name YOUR_STACK_NAME --capabilities CAPABILITY_NAMED_IAM | |
CHANGE_SET_ID=$(aws cloudformation list-change-sets --stack-name YOUR_STACK_NAME --query 'Summaries[*].ChangeSetId' --output text) | |
aws cloudformation wait change-set-create-complete --change-set-name $CHANGE_SET_ID | |
aws cloudformation execute-change-set --change-set-name $CHANGE_SET_ID | |
``` | |
this will create a CloudFormation stack with the powertools layer in a specific region where you run this commands. | |
Keep in mind that layers are regional resources and you need to create the layer in every region where you need it. | |
Alternatively, you can deploy the layer from the AWS Console by navigating to Serverless Application Repository and search for `aws-lambda-powertools-python-layer` and follow the deploy steps from there. | |
SAR App | ARN | |
------------------------------------------------- | --------------------------------------------------------------------------------- | |
[aws-lambda-powertools-python-layer](https://serverlessrepo.aws.amazon.com/applications/eu-west-1/057560766410/aws-lambda-powertools-python-layer) | arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer | |
If using SAM, you can include this SAR App as part of your shared Layers stack, and lock to a specific semantic version. Once deployed, it'll be available across the account this is deployed to. | |
```yaml | |
AwsLambdaPowertoolsPythonLayer: | |
Type: AWS::Serverless::Application | |
Properties: | |
Location: | |
ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer | |
SemanticVersion: 1.3.0 # change to latest semantic version available in SAR |
Customers typically use SAR within their SAM stack, or the Console, but rarely using the CLI as it's quite a lot of steps. Added a table as well as a snippet of this SAR App
@@ -58,6 +58,22 @@ from aws_lambda_powertools.logging.logger import set_package_logger | |||
set_package_logger() | |||
``` | |||
|
|||
## Lambda Layer | |||
|
|||
Powertools is also available as a layer and is distributed via the [Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Powertools is also available as a layer and is distributed via the [Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html). | |
Powertools is also available as a Lambda Layer. It is distributed via the [AWS Serverless Application Repository (SAR)](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the installation part, and a suggested a fix
I seem to not have access to commit these changes while Alex is off... I'm merging as-is, and will submit the changes in a separate commit to |
Issue # , if available: #25
Description of changes:
Add workflow to publish latest release to Serverless Application Repository. This workflow will pass the release version parameter to ssm and start the pipeline within an internal AWS account. The GitHub secrets will be added separately. The code pipeline will package and publish the layer under the name aws-lambda-powertools-python-layer.
I would like to add documentation where to find the layer in SAR, how to find the right version, deploy and use it, but I am not sure to where to put the content. Docs, README.md or a dedicated .md file with a link in README.md?
Checklist
Breaking change checklist
RFC issue #:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.