| .. | ||
| action.yml | ||
| README.md | ||
aws-lambda-wait-for-provisioned-concurrency
Composite action that waits for provisioned concurrency to reach READY status for all Lambda functions listed in the Terraform lambda_alias_updates output. Iterates over the lambda_alias_updates Terraform output and polls aws lambda get-provisioned-concurrency-config for each entry until the status is READY or FAILED.
Example lambda-alias-updates input:
[
"{\"alias_name\": \"live\", \"function_name\": \"my-get-product\", \"version\": \"42\"}",
"{\"alias_name\": \"live\", \"function_name\": \"my-get-category\", \"version\": \"7\"}"
]
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
lambda-alias-updates |
Yes | — | JSON array of Lambda alias update objects (Terraform output: lambda_alias_updates). Each element is a JSON-encoded string with alias_name, function_name, and version. |
Usage
- name: Wait for Lambda Provisioned Concurrency
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/aws-lambda-wait-for-provisioned-concurrency@aws-lambda-wait-for-provisioned-concurrency-v1
with:
lambda-alias-updates: ${{ steps.tf-apply.outputs.lambda_alias_updates }}
Terraform Setup
- Add the following content to the project
- Add all Lambda Modules to the
provisioned_lambda_moduleslist for which the Function Alias and/or Provisioned Concurrency should be updated
output.tf
locals {
// List of Lambda Modules that have provisioned concurrency configured.
// Required to update the aliases of these functions after deployment.
provisioned_lambda_modules = [
module.lambda_get_category,
module.lambda_product_get_full_slug,
module.lambda_get_product,
]
}
// Output which allows Updates of Lambda Alias and Provisioned Concurrency
output "lambda_alias_updates" {
value = concat([for module in local.provisioned_lambda_modules : "{\"alias_name\": \"${module.lambda_alias_name}\", \"function_name\": \"${module.lambda_name}\", \"version\": \"${module.lambda_version}\" }"])
}
Example Usage with other Shared Actions
jobs:
deploy-stage:
name: Build and Deploy to Stage
runs-on: stackit-ubuntu-22
steps:
- name: Apply Terraform
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/terraform-apply@terraform-apply-v1
id: tf-apply
with:
terraform-version: 1.14.9
workspace: stage
var-file: stage.tfvars
jfrog-token: ${{ secrets.JFROG_TOKEN }}
- name: Update Lambda Aliases
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/aws-lambda-alias-update@aws-lambda-alias-update-v1
with:
lambda-alias-updates: ${{ steps.tf-apply.outputs.lambda_alias_updates }}
- name: Wait for Lambda Provisioned Concurrency
uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/aws-lambda-wait-for-provisioned-concurrency@aws-lambda-wait-for-provisioned-concurrency-v1
with:
lambda-alias-updates: ${{ steps.tf-apply.outputs.lambda_alias_updates }}
Notes
- Expects the
lambda-alias-updatesinput to be the rawlambda_alias_updatesoutput from theterraform-applyaction. - Functions without provisioned concurrency configured are skipped automatically.
- If provisioned concurrency reaches
FAILEDstatus, the action logs a warning and continues without failing the workflow. - Requires AWS credentials to be configured in the job before this step runs.