Skip to content

Commit

Permalink
switch parameter back to db (no breaking change)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrodmn committed Jan 24, 2025
1 parent 3d8e2f9 commit 5e9a572
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions integration_tests/cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
PgStacApiLambda(
self,
"pgstac-api",
connection_target=pgstac_db.connection_target,
db=pgstac_db.connection_target,
db_secret=pgstac_db.pgstac_secret,
api_env={
"NAME": app_config.build_service_name("STAC API"),
Expand All @@ -107,7 +107,7 @@ def __init__(
"NAME": app_config.build_service_name("titiler pgSTAC API"),
"description": f"{app_config.stage} titiler pgstac API",
},
connection_target=pgstac_db.connection_target,
db=pgstac_db.connection_target,
db_secret=pgstac_db.pgstac_secret,
buckets=[],
lambda_function_options={
Expand All @@ -118,7 +118,7 @@ def __init__(
TiPgApiLambda(
self,
"tipg-api",
connection_target=pgstac_db.connection_target,
db=pgstac_db.connection_target,
db_secret=pgstac_db.pgstac_secret,
api_env={
"NAME": app_config.build_service_name("tipg API"),
Expand Down
4 changes: 2 additions & 2 deletions lib/stac-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class PgStacApiLambda extends Construct {
props.dbSecret.grantRead(this.stacApiLambdaFunction);

if (props.vpc){
this.stacApiLambdaFunction.connections.allowTo(props.connectionTarget, ec2.Port.tcp(5432), "allow connections from stac-fastapi-pgstac");
this.stacApiLambdaFunction.connections.allowTo(props.db, ec2.Port.tcp(5432), "allow connections from stac-fastapi-pgstac");
}

const stacApi = new HttpApi(this, `${Stack.of(this).stackName}-stac-api`, {
Expand Down Expand Up @@ -81,7 +81,7 @@ export interface PgStacApiLambdaProps {
/**
* RDS Instance with installed pgSTAC or pgbouncer server.
*/
readonly connectionTarget: rds.IDatabaseInstance | ec2.IInstance;
readonly db: rds.IDatabaseInstance | ec2.IInstance;

/**
* Subnet into which the lambda should be deployed.
Expand Down
4 changes: 2 additions & 2 deletions lib/tipg-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
props.dbSecret.grantRead(this.tiPgLambdaFunction);

if (props.vpc){
this.tiPgLambdaFunction.connections.allowTo(props.connectionTarget, ec2.Port.tcp(5432), "allow connections from tipg");
this.tiPgLambdaFunction.connections.allowTo(props.db, ec2.Port.tcp(5432), "allow connections from tipg");
}

const tipgApi = new HttpApi(this, `${Stack.of(this).stackName}-tipg-api`, {
Expand Down Expand Up @@ -82,7 +82,7 @@ import {
/**
* RDS Instance with installed pgSTAC or pgbouncer server.
*/
readonly connectionTarget: rds.IDatabaseInstance | ec2.IInstance;
readonly db: rds.IDatabaseInstance | ec2.IInstance;

/**
* Subnet into which the lambda should be deployed.
Expand Down
4 changes: 2 additions & 2 deletions lib/titiler-pgstac-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { CustomLambdaFunctionProps } from "../utils";
props.dbSecret.grantRead(this.titilerPgstacLambdaFunction);

if (props.vpc) {
this.titilerPgstacLambdaFunction.connections.allowTo(props.connectionTarget, ec2.Port.tcp(5432), "allow connections from titiler");
this.titilerPgstacLambdaFunction.connections.allowTo(props.db, ec2.Port.tcp(5432), "allow connections from titiler");
}

const stacApi = new HttpApi(this, `${Stack.of(this).stackName}-titiler-pgstac-api`, {
Expand Down Expand Up @@ -106,7 +106,7 @@ import { CustomLambdaFunctionProps } from "../utils";
/**
* RDS Instance with installed pgSTAC or pgbouncer server.
*/
readonly connectionTarget: rds.IDatabaseInstance | ec2.IInstance;
readonly db: rds.IDatabaseInstance | ec2.IInstance;

/**
* Subnet into which the lambda should be deployed.
Expand Down

0 comments on commit 5e9a572

Please sign in to comment.