From 97b5a3209a6710489ec8812f807c94a26d5076ed Mon Sep 17 00:00:00 2001 From: emileten Date: Wed, 21 Feb 2024 13:08:12 +0300 Subject: [PATCH] test to fix deployment : try adding s3 endpoint and force allow public subnet --- integration_tests/cdk/config.py | 2 +- integration_tests/cdk/eoapi_template/vpc.py | 4 ++++ lib/database/index.ts | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/integration_tests/cdk/config.py b/integration_tests/cdk/config.py index b1ebcdd..729aa8c 100644 --- a/integration_tests/cdk/config.py +++ b/integration_tests/cdk/config.py @@ -14,7 +14,7 @@ class AppConfig(BaseSettings): description="AWS account ID" ) project_id: str = pydantic.Field( - description="Project ID", default="eoapi-cdk-integration" + description="Project ID", default="eoapi-cdk" ) stage: str = pydantic.Field(description="Stage of deployment", default="test") # because of its validator, `tags` should always come after `project_id` and `stage` diff --git a/integration_tests/cdk/eoapi_template/vpc.py b/integration_tests/cdk/eoapi_template/vpc.py index fdcc495..600f189 100644 --- a/integration_tests/cdk/eoapi_template/vpc.py +++ b/integration_tests/cdk/eoapi_template/vpc.py @@ -32,6 +32,10 @@ def __init__(self, scope: Construct, app_config: AppConfig, **kwargs) -> None: "CloudWatchEndpoint", service=aws_ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH_LOGS, ) + + self.vpc.add_gateway_endpoint( + "S3", service=aws_ec2.GatewayVpcEndpointAwsService.S3 + ) self.export_value( self.vpc.select_subnets(subnet_type=aws_ec2.SubnetType.PUBLIC) diff --git a/lib/database/index.ts b/lib/database/index.ts index 99ff510..b930e32 100644 --- a/lib/database/index.ts +++ b/lib/database/index.ts @@ -73,7 +73,8 @@ export class PgStacDatabase extends Construct { // overwrites defaults with user-provided configurable properties ...props.bootstrapperLambdaFunctionOptions, // Non configurable properties that are going to be overwritten even if provided by the user - vpc: hasVpc(this.db) ? this.db.vpc : props.vpc + vpc: hasVpc(this.db) ? this.db.vpc : props.vpc, + allowPublicSubnet: true, }); this.pgstacSecret = new secretsmanager.Secret(this, "bootstrappersecret", {