diff --git a/CHANGES.md b/CHANGES.md index f492c8b91..5ba366666 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ * update FastAPI requirements * add `validate` in `MosaicTilerFactory` (https://github.com/developmentseed/titiler/pull/206, author @drnextgis) * rename `ressources` package to `resources` (https://github.com/developmentseed/titiler/pull/210, author @drnextgis) +* renamed environment variables prefixes for API and STACK configurations: `TITILER_STACK` as prefix to CDK and `TITILER_API` as prefix to API (https://github.com/developmentseed/titiler/pull/211, author @fredliporace) ## 0.1.0a14 (2021-01-05) diff --git a/deployment/aws/.env.example b/deployment/aws/.env.example index c10dd2eb5..724bd3ed5 100644 --- a/deployment/aws/.env.example +++ b/deployment/aws/.env.example @@ -1,9 +1,9 @@ -STACK_NAME="my-tiler" -STACK_STAGE="dev" -STACK_BUCKETS='["my-bucket*", "*"]' -STACK_MEMORY=3008 +TITILER_STACK_NAME="my-tiler" +TITILER_STACK_STAGE="dev" +TITILER_STACK_BUCKETS='["my-bucket*", "*"]' +TITILER_STACK_MEMORY=3008 # Uncomment to allow lambda to access content on requester-payer buckets -# STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}' +# TITILER_STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}' # Uncomment if you only on the /cog endpoint -# STACK_ADDITIONAL_ENV='{"API_DISABLE_STAC": "TRUE", "API_DISABLE_MOSAIC": "TRUE"}' +# TITILER_STACK_ADDITIONAL_ENV='{"TITILER_API_DISABLE_STAC": "TRUE", "TITILER_API_DISABLE_MOSAIC": "TRUE"}' diff --git a/deployment/aws/cdk/config.py b/deployment/aws/cdk/config.py index f27a46b69..5e37f18de 100644 --- a/deployment/aws/cdk/config.py +++ b/deployment/aws/cdk/config.py @@ -1,4 +1,4 @@ -"""STACK Configs.""" +"""TITILER_STACK Configs.""" from typing import Dict, List, Optional @@ -68,4 +68,4 @@ class Config: """model config""" env_file = ".env" - env_prefix = "STACK_" + env_prefix = "TITILER_STACK_" diff --git a/docker-compose.yml b/docker-compose.yml index 3a5a94754..3535a9c12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,6 @@ services: - VSI_CACHE=TRUE - VSI_CACHE_SIZE=536870912 - WORKERS_PER_CORE=1 - # - API_DISABLE_STAC=TRUE - # - API_DISABLE_MOSAIC=TRUE - # - API_DISABLE_COG=TRUE + # - TITILER_API_DISABLE_STAC=TRUE + # - TITILER_API_DISABLE_MOSAIC=TRUE + # - TITILER_API_DISABLE_COG=TRUE diff --git a/docs/deployment/aws/ecs.md b/docs/deployment/aws/ecs.md index d5a51ae10..595c99e05 100644 --- a/docs/deployment/aws/ecs.md +++ b/docs/deployment/aws/ecs.md @@ -34,9 +34,9 @@ The example handles tasks such as generating a docker image and setting up an ap 3. Update settings (see [intro.md](intro.md)) ```bash - export TITILER_PROJECT="mytiler" - export TITILER_STAGE="dev" - export TITILER_MIN_ECS_INSTANCES=10 + export TITILER_STACK_NAME="mytiler" + export TITILER_STACK_STAGE="dev" + export TITILER_STACK_MIN_ECS_INSTANCES=10 ``` Available settings for ECS: diff --git a/docs/deployment/aws/intro.md b/docs/deployment/aws/intro.md index 4ae010194..612bce8b0 100644 --- a/docs/deployment/aws/intro.md +++ b/docs/deployment/aws/intro.md @@ -6,23 +6,23 @@ Example of of AWS deployments can be found in https://github.com/developmentseed Deployment settings are managed via [pydantic.BaseSettings](https://pydantic-docs.helpmanual.io/usage/settings/) and stored in [config.py](https://github.com/developmentseed/titiler/blob/master/stack/config.py). Pydantic BaseSettings can receive input to overwrite the default value from `.env` file or from environment variables. -Variables in `.env` or in environment variable need to be prefixed with `STACK_`: +Variables in `.env` or in environment variable need to be prefixed with `TITILER_STACK_`: ```bash -STACK_NAME="my-tiler" -STACK_STAGE="dev" +TITILER_STACK_NAME="my-tiler" +TITILER_STACK_STAGE="dev" -STACK_BUCKETS='["my-bucket*", "*"]' -STACK_MOSAIC_HOST="my-bucket/mosaics" +TITILER_STACK_BUCKETS='["my-bucket*", "*"]' +TITILER_STACK_MOSAIC_HOST="my-bucket/mosaics" -STACK_MEMORY=3008 +TITILER_STACK_MEMORY=3008 # Uncomment to allow lambda to access content on requester-payer buckets -# STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}' +# TITILER_STACK_ADDITIONAL_ENV='{"AWS_REQUEST_PAYER":"requester"}' # Uncomment if you only on the /cog endpoint -# STACK_ADDITIONAL_ENV='{"API_DISABLE_STAC": "TRUE", "API_DISABLE_MOSAIC": "TRUE"}' +# TITILER_STACK_ADDITIONAL_ENV='{"TITILER_API_DISABLE_STAC": "TRUE", "TITILER_API_DISABLE_MOSAIC": "TRUE"}' ``` Default values from [config.py](https://github.com/developmentseed/titiler/blob/master/deployment/aws/cdk/config.py): diff --git a/docs/deployment/aws/lambda.md b/docs/deployment/aws/lambda.md index 300812515..fc0c469cf 100644 --- a/docs/deployment/aws/lambda.md +++ b/docs/deployment/aws/lambda.md @@ -38,9 +38,9 @@ The Lambda stack is also deployed by the [AWS CDK](https://aws.amazon.com/cdk/) 3. Update settings (see [intro.md](intro.md)) ```bash - export TITILER_PROJECT="mytiler" - export TITILER_STAGE="dev" - export TITILER_MEMORY=512 + export TITILER_STACK_NAME="mytiler" + export TITILER_STACK_STAGE="dev" + export TITILER_STACK_MEMORY=512 ``` Available settings for AWS Lambda: diff --git a/tests/conftest.py b/tests/conftest.py index a36d7bda9..1b31e0caf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,7 +22,7 @@ def set_env(monkeypatch): monkeypatch.setenv("AWS_REGION", "us-west-2") monkeypatch.delenv("AWS_PROFILE", raising=False) monkeypatch.setenv("AWS_CONFIG_FILE", "/tmp/noconfigheere") - monkeypatch.setenv("API_CACHECONTROL", "private, max-age=3600") + monkeypatch.setenv("TITILER_API_CACHECONTROL", "private, max-age=3600") @pytest.fixture(autouse=True) diff --git a/titiler/settings.py b/titiler/settings.py index 2fbd60d91..6a4909a5d 100644 --- a/titiler/settings.py +++ b/titiler/settings.py @@ -24,4 +24,4 @@ class Config: """model config""" env_file = ".env" - env_prefix = "API_" + env_prefix = "TITILER_API_"