-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: Consistent Environment Variable and Application Names (#141)
* refactor!(envar): Standardize Env Var * refactor!(cmd): Standardize Cmd Main Files * docs(terraform): Update Terraform Docs * docs(cmd): Update Autoscale Env Var
- Loading branch information
Showing
27 changed files
with
54 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,28 @@ | ||
# terraform | ||
|
||
This directory contains Terraform configuration files for deploying Substation to AWS. | ||
This directory contains Terraform modules for deploying Substation to AWS. | ||
|
||
## Using Terraform | ||
|
||
An overview on how Terraform is used and the write, plan, apply workflow is available [here](https://www.terraform.io/intro). | ||
|
||
Please use the official [Terraform documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) for further details on using Terraform to deploy AWS applications or for boiler plate examples. | ||
An overview on how Terraform is used and the write, plan, apply workflow is available [here](https://www.terraform.io/intro). Refer to the [AWS provider documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) for more information on using Terraform with AWS. | ||
|
||
## Modules | ||
|
||
Due to the potentially endless number of deployment configurations, Substation comes with Terraform modules that act as component templates for different parts of the system. These modules are designed to be flexible enough to support every known deployment configuration. For an example deployment, see `example.tf` . | ||
|
||
### API Gateway | ||
|
||
This module is used as a template for deploying new API Gateway endpoints. | ||
|
||
Read more about API Gateway [here](https://aws.amazon.com/api-gateway/). | ||
|
||
#### Kinesis | ||
|
||
This module creates an API Gateway that sends a record to a Kinesis Data Stream. To prevent hot shards, the partition key is the request ID of the HTTP request. | ||
|
||
#### Lambda | ||
|
||
This module creates an API Gateway that invokes and sends a record to a Lambda function. | ||
|
||
### CloudWatch | ||
|
||
#### Destination | ||
|
||
This module creates a CloudWatch Logs destination that can be used to receive logs from any AWS account or region and send them to a destination. | ||
|
||
#### Subscription | ||
|
||
This module creates a CloudWatch Logs subscription filter that can be used to send logs from a CloudWatch Logs group to a destination. Use this with the `Destination` module to send logs from any AWS account or region to a single destination. | ||
|
||
### DynamoDB | ||
|
||
This module is used as a template for deploying new DynamoDB tables with autoscaling enabled. These tables have [time to live](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) enabled and users can optionally use it by writing values to the `ttl` column. | ||
|
||
Read more about DynamoDB [here](https://aws.amazon.com/dynamodb/). | ||
|
||
### ECR | ||
|
||
This module is used as a template for deploying new image repositories to the AWS Elastic Container Registry (ECR) service. | ||
|
||
There are two things to be aware of when deploying new image repositories: | ||
|
||
* Terraform does not manage the build and deployment of container images; after an image repository is created, then container build and upload should happen externally via Docker (see `build/docker` for more information) | ||
* By default all Lambda deployments use containers, but a Lambda deployment will fail if the image repository is empty; prevent deployment failures by building and uploading images before deploying Lambda | ||
|
||
Read more about ECR [here](https://aws.amazon.com/ecr/). | ||
|
||
### Event Bridge | ||
|
||
#### Lambda | ||
|
||
This module is used to create Event Bridge rules that trigger a Lambda. | ||
|
||
Read more about Event Bridge [here](https://aws.amazon.com/eventbridge/). | ||
|
||
### Kinesis | ||
|
||
This module is used to create new Kinesis Data Streams (KDS) and accompanying CloudWatch alarms. The streams created by this module are intended to be used with Substation's autoscaling application -- this feature provides stream autoscaling at a significantly reduced cost compared to Kinesis Firehose. | ||
|
||
For best practices, we recommend users deploy data pipelines that use two Kinesis streams: a stream for pre-processed (i.e., raw) data and a stream for post-processed (i.e., processed) data. This deployment strategy is useful for supporting concurrent access to data across many applications. | ||
|
||
Read more about Kinesis Data Streams [here](https://aws.amazon.com/kinesis/data-streams/). | ||
|
||
### KMS | ||
|
||
This module is used to create encryption keys used across a deployment. Any number of keys can be made, but by default we create one key that is shared by all encrypted resources and data. | ||
|
||
Read more about the Key Management Service [here](https://aws.amazon.com/kms/). | ||
|
||
### Lambda | ||
|
||
This module is used to create and manage Lambda, which is the recommended service for data processing. | ||
|
||
This module is flexible enough to deploy supporting apps (such as `cmd/aws/lambda/kinesis_autoscaling`) and custom apps (such as apps that provide data enrichment functionality). When new Lambda are created with this module, an accompanying AppConfig configuration profile is created under the `substation` application. | ||
|
||
Read more about AWS Lambda [here](https://aws.amazon.com/lambda/). | ||
|
||
### S3 | ||
|
||
This module is used as a template for deploying new S3 buckets. These buckets are private and objects are encrypted. | ||
|
||
Read more about S3 [here](https://aws.amazon.com/s3/). | ||
|
||
#### WORM | ||
|
||
This module creates a write once, read many (WORM) S3 bucket using [Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html) and applies the [Compliance](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html#object-lock-retention-modes) retention mode setting. Objects written to these buckets _*cannot be deleted*_. | ||
|
||
### SNS | ||
|
||
This module is used for creating SNS topics. Topics can be standard or first-in-first-out (FIFO). | ||
|
||
Read more about SNS [here](https://aws.amazon.com/sns/). | ||
|
||
### SQS | ||
|
||
This module is used for creating SQS queues. Queues can be standard or first-in-first-out (FIFO). | ||
|
||
Read more about SQS [here](https://aws.amazon.com/sqs/). | ||
|
||
### Networking | ||
|
||
This module can be used to create a custom VPC with outbound connectivity via a NAT gateway to a public subnet that contains an IGW. This allows for connectivity with VPC only services. | ||
|
||
Read more about VPCs [here](https://aws.amazon.com/vpc/). | ||
Due to the potentially endless number of deployment configurations, Substation includes Terraform modules for these AWS services: | ||
|
||
* API Gateway | ||
* AppConfig | ||
* CloudWatch | ||
* DynamoDB | ||
* Elastic Container Registry (ECR) | ||
* Event Bridge | ||
* Kinesis Data Streams | ||
* Key Management Service (KMS) | ||
* Lambda | ||
* S3 | ||
* Secrets Manager | ||
* SNS | ||
* SQS | ||
* VPC Networking | ||
|
||
Refer to each module's README for more information. Several examples of how to use these modules are available [here](/examples/terraform/aws/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.