diff --git a/examples/build_recipes/cdk/multi-stack/stacks/powertools_cdk_stack.py b/examples/build_recipes/cdk/multi-stack/stacks/powertools_cdk_stack.py index 84099695c5d..52f85178255 100644 --- a/examples/build_recipes/cdk/multi-stack/stacks/powertools_cdk_stack.py +++ b/examples/build_recipes/cdk/multi-stack/stacks/powertools_cdk_stack.py @@ -25,7 +25,7 @@ class PowertoolsStack(Stack): def __init__(self, scope: Construct, construct_id: str, environment: str = "dev", **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) - self.env = environment + self.deploy_environment = environment # Shared Powertools Layer (using public layer) self.powertools_layer = self._create_powertools_layer() @@ -54,17 +54,17 @@ def _create_dynamodb_table(self) -> dynamodb.Table: return dynamodb.Table( self, "DataTable", - table_name=f"powertools-{self.env}-data", + table_name=f"powertools-{self.deploy_environment}-data", partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING), billing_mode=dynamodb.BillingMode.PAY_PER_REQUEST, - removal_policy=RemovalPolicy.DESTROY if self.env != "prod" else RemovalPolicy.RETAIN, + removal_policy=RemovalPolicy.DESTROY if self.deploy_environment != "prod" else RemovalPolicy.RETAIN, ) def _create_sqs_queue(self) -> sqs.Queue: return sqs.Queue( self, "WorkerQueue", - queue_name=f"powertools-{self.env}-worker", + queue_name=f"powertools-{self.deploy_environment}-worker", visibility_timeout=Duration.seconds(180), ) @@ -77,12 +77,12 @@ def _create_api_function(self) -> _lambda.Function: code=_lambda.Code.from_asset("src/app"), layers=[self.powertools_layer], timeout=Duration.seconds(30), - memory_size=512 if self.env == "prod" else 256, + memory_size=512 if self.deploy_environment == "prod" else 256, environment={ - "ENVIRONMENT": self.env, - "POWERTOOLS_SERVICE_NAME": f"app-{self.env}", - "POWERTOOLS_METRICS_NAMESPACE": f"MyApp/{self.env}", - "POWERTOOLS_LOG_LEVEL": "INFO" if self.env == "prod" else "DEBUG", + "ENVIRONMENT": self.deploy_environment, + "POWERTOOLS_SERVICE_NAME": f"app-{self.deploy_environment}", + "POWERTOOLS_METRICS_NAMESPACE": f"MyApp/{self.deploy_environment}", + "POWERTOOLS_LOG_LEVEL": "INFO" if self.deploy_environment == "prod" else "DEBUG", "TABLE_NAME": self.table.table_name, "QUEUE_URL": self.queue.queue_url, }, @@ -103,12 +103,12 @@ def _create_worker_function(self) -> _lambda.Function: code=_lambda.Code.from_asset("src/worker"), layers=[self.powertools_layer], timeout=Duration.seconds(120), - memory_size=1024 if self.env == "prod" else 512, + memory_size=1024 if self.deploy_environment == "prod" else 512, environment={ - "ENVIRONMENT": self.env, - "POWERTOOLS_SERVICE_NAME": f"worker-{self.env}", - "POWERTOOLS_METRICS_NAMESPACE": f"MyApp/{self.env}", - "POWERTOOLS_LOG_LEVEL": "INFO" if self.env == "prod" else "DEBUG", + "ENVIRONMENT": self.deploy_environment, + "POWERTOOLS_SERVICE_NAME": f"worker-{self.deploy_environment}", + "POWERTOOLS_METRICS_NAMESPACE": f"MyApp/{self.deploy_environment}", + "POWERTOOLS_LOG_LEVEL": "INFO" if self.deploy_environment == "prod" else "DEBUG", "TABLE_NAME": self.table.table_name, }, ) @@ -131,8 +131,8 @@ def _create_api_gateway(self) -> apigateway.RestApi: api = apigateway.RestApi( self, "ApiGateway", - rest_api_name=f"Powertools API - {self.env}", - description=f"API for {self.env} environment", + rest_api_name=f"Powertools API - {self.deploy_environment}", + description=f"API for {self.deploy_environment} environment", ) integration = apigateway.LambdaIntegration(self.api_function) diff --git a/poetry.lock b/poetry.lock index 17a6eb8593c..6d2101e7b66 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4312,14 +4312,14 @@ pathspec = ">=0.10.1" [[package]] name = "sentry-sdk" -version = "2.48.0" +version = "2.52.0" description = "Python client for Sentry (https://sentry.io)" optional = false python-versions = ">=3.6" groups = ["dev"] files = [ - {file = "sentry_sdk-2.48.0-py2.py3-none-any.whl", hash = "sha256:6b12ac256769d41825d9b7518444e57fa35b5642df4c7c5e322af4d2c8721172"}, - {file = "sentry_sdk-2.48.0.tar.gz", hash = "sha256:5213190977ff7fdff8a58b722fb807f8d5524a80488626ebeda1b5676c0c1473"}, + {file = "sentry_sdk-2.52.0-py2.py3-none-any.whl", hash = "sha256:931c8f86169fc6f2752cb5c4e6480f0d516112e78750c312e081ababecbaf2ed"}, + {file = "sentry_sdk-2.52.0.tar.gz", hash = "sha256:fa0bec872cfec0302970b2996825723d67390cdd5f0229fb9efed93bd5384899"}, ] [package.dependencies]