Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update instructions for Terraforming infra and pin some dependencies #45

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ secret-*.yaml
target/
!target/release/dino-park-packs
**/.terraform/*
terraform/**/plan
terraform/**/.tool-versions
.envrc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.dev.env
secret-*.yaml
.terraform
terraform/**/plan
37 changes: 37 additions & 0 deletions terraform/INFRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,40 @@ psql -U dinopark -W oneTimePassword -h XXX.rds.amazonaws.com postgres
alter user dinopark with encrypted password 'XXX';
create database "dino-park-packs";
```

### Setting up Terraform on an ARM Mac

New developers at Mozilla are issued an ARM-based Mac, and so the installation
steps will be different.

To get started, install Terraform (using [asdf](https://asdf-vm.com/)):

```
ASDF_HASHICORP_OVERWRITE_ARCH=amd64 asdf install terraform 0.12.31
```

Next, you'll need to export your credentials:

```
$(aws configure export-credentials --format env --profile iam-admin)
```

(Consider using something like [direnv](https://direnv.net/).)

Next, initialize the working directory:

```
arch -arch x86_64 terraform init
```

And then, finally, when you're ready, generate a plan:

```
arch -arch x86_64 terraform plan -out plan
```

Once you're ready, you can ship your changes using:

```
arch -arch x86_64 terraform apply plan
```
1 change: 1 addition & 0 deletions terraform/codebuild/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform 0.12.31
5 changes: 5 additions & 0 deletions terraform/codebuild/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ provider "aws" {

terraform {
required_version = "~> 0.12"
required_providers {
aws = {
version = "~> 2.62.0"
}
}

backend "s3" {
bucket = "eks-terraform-shared-state"
Expand Down
1 change: 1 addition & 0 deletions terraform/dev/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform 0.12.31
5 changes: 5 additions & 0 deletions terraform/dev/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ provider "aws" {

terraform {
required_version = "~> 0.12"
required_providers {
aws = {
version = "~> 2.62.0"
}
}

backend "s3" {
bucket = "eks-terraform-shared-state"
Expand Down
1 change: 1 addition & 0 deletions terraform/prod/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform 0.12.31
5 changes: 5 additions & 0 deletions terraform/prod/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ provider "aws" {

terraform {
required_version = "~> 0.12"
required_providers {
aws = {
version = "~> 2.62.0"
}
}

backend "s3" {
bucket = "eks-terraform-shared-state"
Expand Down
1 change: 1 addition & 0 deletions terraform/test/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform 0.12.31
5 changes: 5 additions & 0 deletions terraform/test/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ provider "aws" {

terraform {
required_version = "~> 0.12"
required_providers {
aws = {
version = "~> 2.62.0"
}
}

backend "s3" {
bucket = "eks-terraform-shared-state"
Expand Down
Loading