Skip to content

Commit 2b56b79

Browse files
Merge pull request #72 from ncx-co/main
update deployment guide with a few more details
2 parents da3f78e + 48ef8c0 commit 2b56b79

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

infrastructure/DEPLOYMENT.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ An example of Cloud Stack is available for AWS (RDS for the database and Lambda
55

66
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.
77

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`.
99

10+
1. Clone the `eoapi` repo and install dependencies
1011
```bash
11-
# Download titiler repo
12+
# Download eoapi repo
1213
git clone https://github.com/developmentseed/eoapi.git
1314

1415
# Create a virtual environment
@@ -18,37 +19,44 @@ The stack is deployed by the [AWS CDK](https://aws.amazon.com/cdk/) utility. Und
1819

1920
# install cdk dependencies
2021
python -m pip install -r infrastructure/aws/requirements-cdk.txt
22+
```
2123

22-
# Install node dependency
24+
2. Install node dependency - requires node version 14+
25+
```bash
2326
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
2434
25-
# Deploys the CDK toolkit stack into an AWS environment
26-
npm --prefix infrastructure/aws run cdk -- bootstrap
2735
# or to a specific region
28-
AWS_DEFAULT_REGION=us-west-2 AWS_REGION=us-west-2 npm --prefix infrastructure/aws run cdk -- bootstrap
36+
AWS_DEFAULT_REGION=us-west-2 AWS_REGION=us-west-2 CDK_EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- bootstrap
2937
```
3038

31-
2. Update settings
39+
4. Update settings
3240

3341
Set environment variable or hard code in `infrastructure/aws/.env` file (e.g `CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1`).
3442

3543
**Important**:
3644
- `CDK_EOAPI_DB_PGSTAC_VERSION` is a required env
3745
- You can choose which functions to deploy by setting `CDK_EOAPI_FUNCTIONS` env (e.g `CDK_EOAPI_FUNCTIONS='["stac","raster","vector"]'`)
3846

39-
3. Pre-Generate CFN template
47+
5. Pre-Generate CFN template
4048

4149
```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
4351
```
4452

45-
4. Deploy
53+
6. Deploy
4654

4755
```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}
4957
5058
# Deploy in specific region
51-
AWS_DEFAULT_REGION=eu-central-1 AWS_REGION=eu-central-1 CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- deploy eoapi-production --profile {my-aws-profile}
59+
AWS_DEFAULT_REGION=eu-central-1 AWS_REGION=eu-central-1 CDK_EOAPI_STAGE=staging CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1 npm --prefix infrastructure/aws run cdk -- deploy eoapi-${CDK_EOAPI_STAGE} --profile {my-aws-profile}
5260
```
5361

5462
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

Comments
 (0)