diff --git a/.github/workflows/publish_layer.yml b/.github/workflows/publish_layer.yml index 35ae1fd731b..3597f0d8253 100644 --- a/.github/workflows/publish_layer.yml +++ b/.github/workflows/publish_layer.yml @@ -16,9 +16,11 @@ on: types: - completed + jobs: build-layer: runs-on: ubuntu-latest + if: ${{ (github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') }} defaults: run: working-directory: ./layer @@ -29,8 +31,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: "16.12" - - name: Install poetry - run: pipx install poetry - name: Setup python uses: actions/setup-python@v4 with: @@ -39,8 +39,8 @@ jobs: - name: Set release notes tag run: | RELEASE_INPUT=${{ inputs.latest_published_version }} - GITHUB_EVENT_RELEASE_TAG=${{ github.event.release.tag_name }} - RELEASE_TAG_VERSION=${GITHUB_EVENT_RELEASE_TAG:-$RELEASE_INPUT} + LATEST_TAG=$(git describe --tag --abbrev=0) + RELEASE_TAG_VERSION=${RELEASE_INPUT:-$LATEST_TAG} echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV - name: install cdk and deps run: | diff --git a/.github/workflows/reusable_deploy_layer_stack.yml b/.github/workflows/reusable_deploy_layer_stack.yml index 74d2dc19767..45c97860438 100644 --- a/.github/workflows/reusable_deploy_layer_stack.yml +++ b/.github/workflows/reusable_deploy_layer_stack.yml @@ -26,28 +26,30 @@ jobs: strategy: fail-fast: false matrix: - region: ["af-south-1"] - # "eu-central-1", - # "us-east-1", - # "us-east-2", - # "us-west-1", - # "us-west-2", - # "ap-east-1", - # "ap-south-1", - # "ap-northeast-1", - # "ap-northeast-2", - # "ap-southeast-1", - # "ap-southeast-2", - # "ca-central-1", - # "eu-west-1", - # "eu-west-2", - # "eu-west-3", - # "eu-south-1", - # "eu-north-1", - # "sa-east-1", - # "ap-southeast-3", - # "ap-northeast-3", - # "me-south-1" + region: [ + "af-south-1", + # "eu-central-1", + # "us-east-1", + # "us-east-2", + # "us-west-1", + # "us-west-2", + # "ap-east-1", + # "ap-south-1", + # "ap-northeast-1", + # "ap-northeast-2", + # "ap-southeast-1", + # "ap-southeast-2", + # "ca-central-1", + # "eu-west-1", + # "eu-west-2", + # "eu-west-3", + # "eu-south-1", + # "eu-north-1", + # "sa-east-1", + # "ap-southeast-3", + # "ap-northeast-3", + # "me-south-1" + ] steps: - name: checkout uses: actions/checkout@v3 diff --git a/layer/layer/layer_stack.py b/layer/layer/layer_stack.py index 8b32de9c206..15f3d3fdcb8 100644 --- a/layer/layer/layer_stack.py +++ b/layer/layer/layer_stack.py @@ -1,4 +1,4 @@ -from aws_cdk import Stack +from aws_cdk import RemovalPolicy, Stack from aws_cdk.aws_ssm import StringParameter from cdk_lambda_powertools_python_layer import LambdaPowertoolsLayer from constructs import Construct @@ -15,5 +15,6 @@ def __init__( ) layer.add_permission("PublicLayerAccess", account_id="*") + layer.apply_removal_policy(RemovalPolicy.RETAIN) StringParameter(self, "VersionArn", parameter_name=ssm_paramter_layer_arn, string_value=layer.layer_version_arn)