Skip to content

Commit

Permalink
chore: with the new infra update LOCAL_LAMBDA_ENDPOINT is now replace…
Browse files Browse the repository at this point in the history
…d by LOCAL_AWS_ENDPOINT (#3019)
  • Loading branch information
craigzour authored Dec 11, 2023
1 parent 4e45e6b commit 47c2d24
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ LOCAL_AWS_ENDPOINT=http://localhost:4566
# When running locally from devcontainer to devcontainer
# If running localstack outside of the devcontainer, replace
# all references of host.docker.internal with localhost
LOCAL_AWS_ENDPOINT=http://host.docker.internal:4566
LOCAL_AWS_ENDPOINT=http://127.0.0.1:4566

AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
NEXTAUTH_URL=http://localhost:3000
REDIS_URL=redis
LOCAL_LAMBDA_ENDPOINT=http://host.docker.internal:3001
RELIABILITY_FILE_STORAGE=forms-local-reliability-file-storage
DATABASE_URL=postgres://postgres:chummy@db:5432/formsDB

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ REDIS_URL=localhost
For local development of the complete solution (running SAM for local Lambdas) add the following two environment variables to your .env file and see the instructions for launching the Lambda's locally in our [Infrastructure ReadME](https://github.com/cds-snc/forms-staging-terraform)

```
LOCAL_LAMBDA_ENDPOINT=http://127.0.0.1:3001
LOCAL_AWS_ENDPOINT=http://127.0.0.1:4566
DATABASE_URL=postgres://postgres:password@localhost:5432/formsDB
```

Expand Down Expand Up @@ -196,7 +196,7 @@ REDIS_URL=localhost
Pour le développement local de la solution complète (exécutant SAM pour les Lambda locaux), ajoutez les deux variables d'environnement suivantes à votre fichier .env et consultez les instructions pour lancer les Lambda localement dans notre [Infrastructure ReadME] (https://github.com/cds -snc/forms-staging-terraform)

```
LOCAL_LAMBDA_ENDPOINT=http://127.0.0.1:3001
LOCAL_AWS_ENDPOINT=http://127.0.0.1:4566
DATABASE_URL=postgres://postgres:password@localhost:5432/formsDB
```

Expand Down
2 changes: 1 addition & 1 deletion pages/api/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const protectedMethods = ["POST"];
const lambdaClient = new LambdaClient({
region: "ca-central-1",
retryMode: "standard",
endpoint: process.env.LOCAL_LAMBDA_ENDPOINT,
...(process.env.LOCAL_AWS_ENDPOINT && { endpoint: process.env.LOCAL_AWS_ENDPOINT }),
});

const submit = async (req: NextApiRequest, res: NextApiResponse): Promise<void> => {
Expand Down
3 changes: 1 addition & 2 deletions utils/responseGenerator/.env_example
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copy to .env

LOCAL_LAMBDA_ENDPOINT=http://127.0.0.1:3001
LOCAL_AWS_ENDPOINT=http://localhost:4566
LOCAL_AWS_ENDPOINT=http://127.0.0.1:4566
RELIABILITY_FILE_STORAGE=forms-local-reliability-file-storage

AWS_ACCESS_KEY_ID=test
Expand Down

0 comments on commit 47c2d24

Please sign in to comment.