-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a16b513
commit 05a050a
Showing
5 changed files
with
142 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
crash.*.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sensitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
*.tfvars.json | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Include override files you do wish to add to version control using negated pattern | ||
# !example_override.tf | ||
|
||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan | ||
# example: *tfplan* | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc | ||
|
||
# Ignore Mac/OSX system files | ||
.DS_Store | ||
|
||
# Ignore any compiled binaries | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Ignore any log files | ||
*.log | ||
|
||
# Ignore the dist folder which might contain built artifacts | ||
dist/ | ||
|
||
# Ignore any local environment files | ||
.env | ||
|
||
# Ignore any temporary files | ||
*.tmp | ||
*.bak | ||
*.swp | ||
|
||
# Ignore .pem files | ||
*.pem |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Terraform AWS Configuration | ||
|
||
This folder contains the files necessary to deploy a front-end app, server, and database to AWS. | ||
|
||
## Quickstart | ||
|
||
`cd` into to this folder, then run: | ||
|
||
``` | ||
terraform init | ||
terraform plan | ||
terraform apply | ||
``` | ||
|
||
## Prerequisites | ||
|
||
### 1. [Install AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions) | ||
|
||
### 2. Configure AWS Profile | ||
|
||
Log in to the [console](https://aws.amazon.com/console), and [generate an access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-key-self-managed.html). Then set up a profile for this account locally by running the following command: | ||
|
||
``` | ||
aws configure --profile <profile_name> | ||
``` | ||
|
||
### 3. Initialize Terraform | ||
|
||
If it's your first time deploying from this directory, run `terraform init`. This will download | ||
|
||
### 4. Deploy | ||
|
||
`terraform plan` | ||
|
||
## Reference | ||
|
||
### Terraform | ||
|
||
- [Terraform Docs](https://developer.hashicorp.com/terraform/intro) - _On this page there's a helpful 18 minute video on what Terraform is and how it works, worth watching_ | ||
- [Terraform AWS Tutorial](https://developer.hashicorp.com/terraform/tutorials/aws-get-started) - _You can start from the top and go through everything, or just pick a section you'd like to understand better_ | ||
- [Terraform AWS Provider Docs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) - _This is where you'll find all the details for configuring each of the resources in these configuration files_ | ||
|
||
### AWS | ||
|
||
#### Networking | ||
|
||
- [VPC User Guide](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) - _For understanding `Subnets`, `Route Tables`, and `Internet Gateways`. Also explains `Security Groups`, a fundamental concept_ | ||
- [ELB User Guide](https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html) - _For understanding `Load Balancers`, `Listeners`, and `Target Groups`_ | ||
|
||
#### Access Management | ||
|
||
- [IAM User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started.html) - _For understanding IAM `Identities`, `Roles`, and `Policies`_ | ||
|
||
#### Database | ||
|
||
- [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html) - _For understanding database deployment details_ | ||
|
||
#### Application Deployment | ||
- [ECS Docs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html) - _For understanding how to run Dockerized applications_ |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.0" | ||
} | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-1" | ||
profile = var.aws_profile | ||
} |
3 changes: 3 additions & 0 deletions
3
{{cookiecutter.project_slug}}/terraform/terraform.tfvars.example
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file is where you can store values for variables that are declared in your configuration | ||
# If you provide a value here, you won't be prompted for each value when running `terraform apply` | ||
profile="tn-staging" |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This file is where you'll store any variables used in your configuration | ||
variable "aws_profile" { | ||
type = string | ||
description = "The AWS profile to use for deployment" | ||
default = "default" | ||
} |