Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Latest commit

 

History

History
412 lines (255 loc) · 9.04 KB

environment.md

File metadata and controls

412 lines (255 loc) · 9.04 KB

Environment

Environment Configuration

The CFG object is for accessing values either from the subhub/.env file and|or superseded by env vars.

A value that is known to be set or have a default can be accessed:

CFG.SOME_VALUE

Otherwise the value can be accessed and given a default if it doesn't exist:

CFG("OTHER_VALUE", "SOME_DEFAULT")

These values can be enabled as an env var or listed in a .env in the subhub/ directory.

Environment Variables

The environment variables as read from the application, in alphabetical order are as follows:

ALLOWED_ORIGIN_SYSTEMS

Learn more.

Allowed Origin Systems

This list of values provides SubHub with a way of identifying the originating sending system, this was developed as a way of pre-planning for future SubHub customers.

AWS_ACCESS_KEY_ID

Learn more.

AWS Access Key Identifier (ID)

From reference 1,

Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). You use access keys to sign programmatic requests that you make to AWS if you use AWS CLI commands (using the SDKs) or using AWS API operations
References
  1. Access Keys (Access Key ID and Secret Access Key)

AWS_EXECUTION_ENV

Learn more.

Amazon Web Services Execution Environment

AWS_REGION

Learn more.

Amazon Web Services (AWS) Region

From reference 1,

Amazon EC2 is hosted in multiple locations world-wide. These locations are composed of Regions and Availability Zones. Each Region is a separate geographic area. Each Region has multiple, isolated locations known as Availability Zones.
References
  1. Regions and Availability Zones
  2. Available Regions

AWS_SECRET_ACCESS_KEY

Learn more.

Amazon Web Services Secret Access Key

From reference 1,

Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). You use access keys to sign programmatic requests that you make to AWS if you use AWS CLI commands (using the SDKs) or using AWS API operations
References
  1. Access Keys (Access Key ID and Secret Access Key)

BASKET_API_KEY

Learn more.

Basket Application Programming Interface (API) Key

Valid API Key issued to SubHub to authenticate in API calls to the Mozilla Basket service.

BRANCH

Learn more.

Version Control System (VCS) branch

This is the branch name of the deployed code. Should be available locally as well as when deployed to AWS Lambda.

LOG_LEVEL

Learn more.

Log level of the application

From reference 2,

When you set a logging level in Python using the standard module, you’re telling the library you want to handle all events from that level on up. If you set the log level to INFO, it will include NOTSET, DEBUG, and INFO messages.
References
  1. Python Logging Levels
  2. Ultimate Guide to Logging

DELETED_USER_TABLE

Learn more.

Amazon Web Services, DynamoDB Users Table

This environment variable is used for the sub and hub applications for the curation of users that have been deleted from the applications. It is defaulted if not specified. This is the common use case for local testing with doit local.

DEPLOYED_BY

Learn more.

The name of the entity to deploy the environment.

Ideally this would not be a human and done by a system such as a continuous deployment service such as TravisCI, CircleCI, or Jenkins.

DEPLOY_DOMAIN

Learn more.

The domain entry of the deployed environment.

DEPLOYED_ENV

Learn more.

DEPLOYED_ENV

The deployment environment is determined by the branch name:

  • master: prod
  • stage/*: stage
  • qa/*: qa
  • *: dev

There is a dev and fab environment available as well. The determination of how this works in those cases is left open for future refinement.

DEPLOYED_WHEN

Learn more.

DEPLOYED_WHEN

This value provides the timestamp for when the application was deployed.

DYNALITE_PORT

Learn more.

DYNALITE_PORT

This value is used only when running dynalite locally. Defaults to 8000.

DYNALITE_URL

Learn more.

DYNALITE_URL

This configuration value is the fully qualified uniform resource locator (URL) for a dockerized instance of an API vending the AWS DynamDB interface.

EVENT_TABLE

Learn more.

EVENT_TABLE

This environment variable sets the name of the Amazon DynamoDB events table that is used by the hub application. It is defaulted if not specified. This is the common use case for local testing with doit local.

FXA_SQS_URI

Learn more.

HUB_API_KEY

Learn more.

HUB_API_KEY

API Key issued from Stripe to identify and validate calls originated from Stripe.

LOCAL_FLASK_PORT

Learn more.

Flask server, local port

This value is used only when running the subhub flask app locally. It is defaulted to port, 5000.

NEW_RELIC_ACCOUNT_ID

Learn more.

NEW_RELIC_TRUSTED_ACCOUNT_ID

Learn more.

NEW_RELIC_SERVERLESS_MODE_ENABLED

Learn more.

NEW_RELIC_DISTRIBUTED_TRACING_ENABLED

Learn more.

PAYMENT_API_KEY

Learn more.

PAYMENT_API_KEY

API Key issued to SubHub customers to authenticate transactions incoming to SubHub.

PAYMENT_EVENT_LIST

Learn more.

PAYMENT_API_KEY

List of Stripe webhook events that will be monitored by SubHub. To be monitored by SubHub, the event must be in this list otherwise it will not be listened for by hub.

PROFILING_ENABLED

Learn more.

PROFILING_ENABLED

This is a Boolean flag to indicate if profiling is enabled in the application.

PROJECT_NAME

Learn more.

PROJECT_NAME

This is the project's name, subhub, as determined by the second part of the reposlug mozilla/subhub.

REMOTE_ORIGIN_URL

Learn more.

REMOTE_ORIGIN_URL

This is the git remote origin URL of the repository that you are presently in.

REVISION

Learn more.

REVISION

This is the 40 digit sha1 commit hash for the deployed code. This is available in the git repo as well as when deployed to AWS Lambda.

SALESFORCE_BASKET_URI

Learn more.

SALESFORCE_BASKET_URI

A URL to send customer data to Mozilla Basket service.

SRCTAR

Learn more.

STRIPE_LOCAL

Learn more.

STRIPE_MOCK_HOST

Learn more.

STRIPE_MOCK_PORT

Learn more.

STRIPE_API_KEY

Learn more.

Stripe API Key

This value is used for production deployments as well as testing (testing key).

SUPPORT_API_KEY

Learn more.

SUPPORT_API_KEY

This is the support api key. Defaults to fake_support_api_key

VERSION

Learn more.

Application Version

This is the git describe --abbrev=7 value, useful for describing the code version. This is available in the git repo as well as when deployed to AWS Lambda.