You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: infrastructure/DEPLOYMENT.md
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,11 @@ An example of Cloud Stack is available for AWS (RDS for the database and Lambda
5
5
6
6
The stack is deployed by the [AWS CDK](https://aws.amazon.com/cdk/) utility. Under the hood, CDK will create the deployment packages required for AWS Lambda, upload it to AWS, and handle the creation of the Lambda and API Gateway resources.
7
7
8
-
1. Install CDK and connect to your AWS account. This step is only necessary once per AWS account.
8
+
The example commands here will deploy a CloudFormation stack called `eoAPI-staging`.
9
9
10
+
1. Clone the `eoapi` repo and install dependencies
2. Install node dependency - requires node version 14+
25
+
```bash
23
26
npm --prefix infrastructure/aws install
27
+
```
28
+
29
+
3. Install CDK and connect to your AWS account. This step is only necessary once per AWS account. The environment variable `CDK_EOAPI_STAGE` determines the name of the stack
30
+
(e.g. eoAPI-staging or eoAPI-production)
31
+
```bash
32
+
# Deploy the CDK toolkit stack into an AWS environment.
33
+
CDK_EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- bootstrap
24
34
25
-
# Deploys the CDK toolkit stack into an AWS environment
26
-
npm --prefix infrastructure/aws run cdk -- bootstrap
27
35
# or to a specific region
28
-
AWS_DEFAULT_REGION=us-west-2 AWS_REGION=us-west-2 npm --prefix infrastructure/aws run cdk -- bootstrap
Set environment variable or hard code in`infrastructure/aws/.env` file (e.g `CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1`).
34
42
35
43
**Important**:
36
44
- `CDK_EOAPI_DB_PGSTAC_VERSION` is a required env
37
45
- You can choose which functions to deploy by setting `CDK_EOAPI_FUNCTIONS` env (e.g `CDK_EOAPI_FUNCTIONS='["stac","raster","vector"]'`)
38
46
39
-
3. Pre-Generate CFN template
47
+
5. Pre-Generate CFN template
40
48
41
49
```bash
42
-
npm --prefix infrastructure/aws run cdk -- synth # Synthesizes and prints the CloudFormation template for this stack
50
+
CDK_EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- synth # Synthesizes and prints the CloudFormation template for this stack
43
51
```
44
52
45
-
4. Deploy
53
+
6. Deploy
46
54
47
55
```bash
48
-
CDK_EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- deploy eoapi-staging
56
+
CDK_EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- deploy eoAPI-${CDK_EOAPI_STAGE}
If you get an error saying that the max VPC's has been reached, this means that you have hit the limit for the amount of VPCs per unique AWS account and region combination. You can change the AWS region to a region that has less VPCs and deploy again to fix this.
0 commit comments