From da3044485d4975259dadc1e48fd4d8ae14555663 Mon Sep 17 00:00:00 2001 From: heitorlessa Date: Wed, 20 Jul 2022 10:19:41 +0200 Subject: [PATCH 1/3] chore(layers): expand to all aws commercial regions --- .../workflows/reusable_deploy_layer_stack.yml | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/reusable_deploy_layer_stack.yml b/.github/workflows/reusable_deploy_layer_stack.yml index 45c97860438..7c3cd2946e8 100644 --- a/.github/workflows/reusable_deploy_layer_stack.yml +++ b/.github/workflows/reusable_deploy_layer_stack.yml @@ -26,30 +26,31 @@ 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 From ca1431106af8d6439cc05d4df2cc7646d1a26c80 Mon Sep 17 00:00:00 2001 From: heitorlessa Date: Wed, 20 Jul 2022 10:32:09 +0200 Subject: [PATCH 2/3] feat(layers): add layer ARN in outputs to ease debugging --- layer/layer/canary_stack.py | 4 +++- layer/layer/layer_stack.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/layer/layer/canary_stack.py b/layer/layer/canary_stack.py index 15bc80214d3..71340689ad8 100644 --- a/layer/layer/canary_stack.py +++ b/layer/layer/canary_stack.py @@ -1,6 +1,6 @@ import uuid -from aws_cdk import CfnParameter, CustomResource, Duration, Stack +from aws_cdk import CfnOutput, CfnParameter, CustomResource, Duration, Stack from aws_cdk.aws_iam import Effect, ManagedPolicy, PolicyStatement, Role, ServicePrincipal from aws_cdk.aws_lambda import Code, Function, LayerVersion, Runtime from aws_cdk.aws_logs import RetentionDays @@ -73,3 +73,5 @@ def __init__( ) # force to recreate resource on each deployment with randomized name CustomResource(self, f"CanaryTrigger-{str(uuid.uuid4())[0:7]}", service_token=provider.service_token) + + CfnOutput(self, "LatestLayerArn", value=layer_arn) diff --git a/layer/layer/layer_stack.py b/layer/layer/layer_stack.py index c29c3816f55..f15232eb560 100644 --- a/layer/layer/layer_stack.py +++ b/layer/layer/layer_stack.py @@ -1,4 +1,4 @@ -from aws_cdk import RemovalPolicy, Stack +from aws_cdk import CfnOutput, RemovalPolicy, Stack from aws_cdk.aws_lambda import CfnLayerVersionPermission from aws_cdk.aws_ssm import StringParameter from cdk_lambda_powertools_python_layer import LambdaPowertoolsLayer @@ -27,3 +27,5 @@ def __init__( layer.apply_removal_policy(RemovalPolicy.RETAIN) StringParameter(self, "VersionArn", parameter_name=ssm_paramter_layer_arn, string_value=layer.layer_version_arn) + + CfnOutput(self, "LatestLayerArn", value=layer.layer_version_arn) From a484f355bc7d3509ed26934dfac0d9814598380f Mon Sep 17 00:00:00 2001 From: heitorlessa Date: Wed, 20 Jul 2022 10:49:58 +0200 Subject: [PATCH 3/3] revert: remove output from canary stack --- layer/layer/canary_stack.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/layer/layer/canary_stack.py b/layer/layer/canary_stack.py index 71340689ad8..15bc80214d3 100644 --- a/layer/layer/canary_stack.py +++ b/layer/layer/canary_stack.py @@ -1,6 +1,6 @@ import uuid -from aws_cdk import CfnOutput, CfnParameter, CustomResource, Duration, Stack +from aws_cdk import CfnParameter, CustomResource, Duration, Stack from aws_cdk.aws_iam import Effect, ManagedPolicy, PolicyStatement, Role, ServicePrincipal from aws_cdk.aws_lambda import Code, Function, LayerVersion, Runtime from aws_cdk.aws_logs import RetentionDays @@ -73,5 +73,3 @@ def __init__( ) # force to recreate resource on each deployment with randomized name CustomResource(self, f"CanaryTrigger-{str(uuid.uuid4())[0:7]}", service_token=provider.service_token) - - CfnOutput(self, "LatestLayerArn", value=layer_arn)