Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove sandbox account #2779

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions api.planx.uk/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ const makeUniqueFlow = (
};

const isLiveEnv = () =>
["production", "staging", "pizza", "sandbox"].includes(
process.env.NODE_ENV || "",
);
["production", "staging", "pizza"].includes(process.env.NODE_ENV || "");

/**
* Get current environment, formatted for display
Expand Down
2 changes: 1 addition & 1 deletion doc/how-to/how-to-setup-aws-sso-credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ As part of onboarding, you should be set up to access AWS via [the SSO portal](h
1. Download the AWS CLI
1. Run `aws configure sso` - the required details can be found via the SSO portal
1. For the "profile" field please use the format `planx-<STACK>`, e.g. `planx-staging`
1. Repeat for all environments (sandbox, staging, production)
1. Repeat for all environments (staging, production)
1. Test! You should be able to call commands using the CLI, for example `aws sts get-caller-identity --profile planx-staging` and get the expected result.

Occasionally, you'll be prompted to refresh your credentials, this can be done via `aws sso login --profile <PROFILE>`
13 changes: 5 additions & 8 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ The stacks are:

- `production`
- `staging`
- `sandbox`

Steps:

1. Install [Docker](https://docs.docker.com/get-docker/)
1. Install the [Pulumi CLI](https://www.pulumi.com/docs/reference/cli/)
1. Setup AWS credentials for Pulumi IAM role. Profile names should have the format `planx-<STACK>-pulumi`.
1. Log in to the Pulumi CLI using your PAT (`pulumi login`)
1. Install project dependencies at root (`pnpm i`), this will install dependencies for all layers
1. Provision layers manually (`cd <LAYER_DIR> && pulumi up --stack <STACK>`)

We use the `sandbox` environment to test IaC changes. The `application` layer is also manually deployed from the local developer's machine, and not via CI.
2. Install the [Pulumi CLI](https://www.pulumi.com/docs/reference/cli/)
3. Setup AWS credentials for Pulumi IAM role. Profile names should have the format `planx-<STACK>-pulumi`.
4. Log in to the Pulumi CLI using your PAT (`pulumi login`)
5. Install project dependencies at root (`pnpm i`), this will install dependencies for all layers
6. Provision layers manually (`cd <LAYER_DIR> && pulumi up --stack <STACK>`)

### What about the secrets?

Expand Down
35 changes: 0 additions & 35 deletions infrastructure/application/Pulumi.sandbox.yaml

This file was deleted.

6 changes: 1 addition & 5 deletions infrastructure/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
"tldjs": "^2.3.1"
},
"scripts": {
"setup-sandbox-env": "REACT_APP_GOOGLE_OAUTH_OVERRIDE=https://api.editor.planx.dev REACT_APP_API_URL=https://api.planx.in REACT_APP_HASURA_URL=https://hasura.planx.in/v1/graphql REACT_APP_SHAREDB_URL=wss://sharedb.planx.in",
"build-editor": "cd ../../editor.planx.uk && pnpm build",
"sandbox:up": "pnpm setup-sandbox-env pnpm build-editor && DOCKER_DEFAULT_PLATFORM=linux/amd64 pulumi up --stack sandbox",
"sandbox:down": "pulumi down --stack sandbox",
"sandbox:refresh": "pnpm setup-sandbox-env pnpm build-editor && DOCKER_DEFAULT_PLATFORM=linux/amd64 pulumi up --refresh --stack sandbox"
"build-editor": "cd ../../editor.planx.uk && pnpm build"
}
}
11 changes: 1 addition & 10 deletions infrastructure/application/utils/generateTeamSecrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ export const generateTeamSecrets = (
const secrets: awsx.ecs.KeyValuePair[] = [];
teams.forEach((team) => {
switch(env) {
case "sandbox":
secrets.push({
name: `GOV_UK_PAY_TOKEN_${name(team.name)}`,
value: "sandbox"
});
break;
case "staging":
secrets.push({
name: `GOV_UK_PAY_TOKEN_${name(team.name)}`,
Expand All @@ -49,10 +43,7 @@ export const generateTeamSecrets = (
team.uniformInstances?.forEach((instance) => {
secrets.push({
name: `UNIFORM_CLIENT_${name(instance)}`,
value:
env === "sandbox"
? "sandbox"
: config.require(`uniform-client-${value(instance)}`),
value: config.require(`uniform-client-${value(instance)}`),
});
});
});
Expand Down
5 changes: 0 additions & 5 deletions infrastructure/certificates/Pulumi.sandbox.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions infrastructure/certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
"@pulumi/pulumi": "^3.0.0",
"tldjs": "^2.3.1"
},
"scripts": {
"sandbox:up": "pulumi up --stack sandbox",
"sandbox:down": "pulumi down --stack sandbox",
"sandbox:refresh": "pulumi up --refresh --stack sandbox"
},
"pnpm": {
"overrides": {
"protobufjs": ">=7.2.4"
Expand Down
3 changes: 0 additions & 3 deletions infrastructure/data/Pulumi.sandbox.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions infrastructure/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,5 @@
"@pulumi/aws": "^4.0.0",
"@pulumi/awsx": "^0.30.0",
"@pulumi/pulumi": "^3.74.0"
},
"scripts": {
"sandbox:up": "pulumi up --stack sandbox",
"sandbox:down": "pulumi down --stack sandbox",
"sandbox:refresh": "pulumi up --refresh --stack sandbox"
}
}
5 changes: 0 additions & 5 deletions infrastructure/networking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,5 @@
"@pulumi/aws": "^4.0.0",
"@pulumi/awsx": "^0.30.0",
"@pulumi/pulumi": "^3.74.0"
},
"scripts": {
"sandbox:up": "pulumi up --stack sandbox",
"sandbox:down": "pulumi down --stack sandbox",
"sandbox:refresh": "pulumi up --refresh --stack sandbox"
}
}
Loading