From b942fc7ba00f23b82b2c297a75cdcd6fd8bd81f5 Mon Sep 17 00:00:00 2001 From: Larisa Bucur Date: Tue, 5 Mar 2024 23:48:00 +0200 Subject: [PATCH 1/3] update github actions for production --- .github/workflows/api-promote-prod.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/api-promote-prod.yml b/.github/workflows/api-promote-prod.yml index ec37d3980..2d2cb8cab 100644 --- a/.github/workflows/api-promote-prod.yml +++ b/.github/workflows/api-promote-prod.yml @@ -293,9 +293,9 @@ jobs: # Update the pulumi stack with new image - run: | npm install - cd prod - pulumi stack select -c gitcoin/prod/scorer-production - pulumi config -s gitcoin/prod/scorer-production set aws:region us-west-2 --non-interactive + cd aws + pulumi stack select -c gitcoin/passport-scorer/production + pulumi config -s gitcoin/passport-scorer/production set aws:region us-west-2 --non-interactive working-directory: infra env: PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -303,10 +303,10 @@ jobs: - uses: pulumi/actions@v3 id: pulumi with: - command: up - stack-name: gitcoin/prod/scorer-production + command: preview + stack-name: gitcoin/passport-scorer/production upsert: false - work-dir: infra/prod + work-dir: infra/aws env: PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 7026c07b9f027d754e4a31681ef9c4dbda92728a Mon Sep 17 00:00:00 2001 From: Larisa Bucur Date: Tue, 5 Mar 2024 23:48:27 +0200 Subject: [PATCH 2/3] add pulumi file for production --- infra/aws/Pulumi.production.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 infra/aws/Pulumi.production.yaml diff --git a/infra/aws/Pulumi.production.yaml b/infra/aws/Pulumi.production.yaml new file mode 100644 index 000000000..16f12c3f2 --- /dev/null +++ b/infra/aws/Pulumi.production.yaml @@ -0,0 +1,2 @@ +config: + aws:region: us-west-2 From 74ec940d2a94be0c44b3174dbd00875c0f312c0c Mon Sep 17 00:00:00 2001 From: Larisa Bucur Date: Tue, 5 Mar 2024 23:59:23 +0200 Subject: [PATCH 3/3] migrate to core VPC prod --- infra/aws/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/infra/aws/index.ts b/infra/aws/index.ts index 28ce7b954..59712a5ba 100644 --- a/infra/aws/index.ts +++ b/infra/aws/index.ts @@ -64,6 +64,7 @@ const pagerDutyIntegrationEndpoint = `${process.env["PAGERDUTY_INTEGRATION_ENDPO const coreInfraStack = new pulumi.StackReference(`gitcoin/core-infra/${stack}`); const RDS_SECRET_ARN = coreInfraStack.getOutput("rdsSecretArn"); +// coreInfraStack.getOutput("MIGRATION_HARDCODED_RDS_SECRET"); //coreInfraStack.getOutput("test_rdsSecretArn");// coreInfraStack.getOutput("rdsSecretArn"); // test_rdsSecretArn const vpcID = coreInfraStack.getOutput("vpcId"); const vpcPrivateSubnetIds = coreInfraStack.getOutput("privateSubnetIds"); @@ -121,10 +122,11 @@ const privateSubnetSecurityGroup = new aws.ec2.SecurityGroup( ); const scorerDbProxyEndpoint = coreInfraStack.getOutput("rdsProxyEndpoint"); +// coreInfraStack.getOutput("MIGRATION_HARDCODED_DB_ENDPOINT"); // coreInfraStack.getOutput("test_rdsProxyEndpoint"); // coreInfraStack.getOutput("rdsProxyEndpoint"); // test_rdsProxyEndpoint const scorerDbProxyEndpointConn = coreInfraStack.getOutput("rdsProxyConnectionUrl"); -const readreplica0ConnectionUrl = coreInfraStack.getOutput( - "readreplica0ConnectionUrl" -); +// coreInfraStack.getOutput("MIGRATION_HARDCODED_DB_CONN_URL"); // coreInfraStack.getOutput("test_rdsProxyConnectionUrl"); // coreInfraStack.getOutput("rdsProxyConnectionUrl"); // test_rdsProxyConnectionUrl +const readreplica0ConnectionUrl = coreInfraStack.getOutput("readreplica0ConnectionUrl"); +// coreInfraStack.getOutput("MIGRATION_HARDCODED_DB_CONN_URL_READ"); // coreInfraStack.getOutput("readreplica0ConnectionUrl"); // test_readreplica0ConnectionUrl ////////////////////////////////////////////////////////////// // Set up ALB and ECS cluster @@ -139,7 +141,7 @@ export const clusterId = cluster.id; // Create bucket for access logs const accessLogsBucket = new aws.s3.Bucket(`gitcoin-scorer-access-logs`, { acl: "private", - forceDestroy: true, + forceDestroy: stack == "production" ? false: true, }); const serviceAccount = aws.elb.getServiceAccount({}); @@ -706,7 +708,7 @@ let dbSubnetGroupId = `core-rds`; const redashDb = new aws.rds.Instance( "redash-db-0", { - identifier: "redash-db-0", + identifier: "redash-db", allocatedStorage: 20, maxAllocatedStorage: 20, engine: "postgres",