Skip to content

Commit

Permalink
Added readme for tfstate (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
molund authored Nov 23, 2023
1 parent 72d21e7 commit bfd1f55
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions infrastructure/aws-opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OpenSearch is Amazon's community-driven, 100% open-source version of Elastisearc

## Updating DEV

* Connect to the BC Governemtn AWS login application and get your credentials to paste into a terminal
* Connect to the BC Government AWS login application and get your credentials to paste into a terminal
* `cd infrastructure/aws-opensearch/dev`
* `terragrunt apply`
* Update the main-elasticsearch-secret and develop-elasticsearch-secret on DEV and TEST OpenShift environments to ensure that the settings match AWS.
Expand All @@ -20,13 +20,13 @@ OpenSearch is Amazon's community-driven, 100% open-source version of Elastisearc

## Updating PROD

* Connect to the BC Governemtn AWS login application and get your credentials to paste into a terminal
* Connect to the BC Government AWS login application and get your credentials to paste into a terminal
* `cd infrastructure/aws-opensearch/prod`
* `terragrunt apply`
* Update the main-elasticsearch-secret on the PROD OpenShift environments to ensure that the settings match AWS.

## Tearing down an environment

* Connect to the BC Governemtn AWS login application and get your credentials to paste into a terminal
* Connect to the BC Government AWS login application and get your credentials to paste into a terminal
* `cd infrastructure/aws-opensearch/<ENVIRONMENT>`
* `terragrunt destroy` should work, but you might need to use `terragrunt run-all destroy`
6 changes: 6 additions & 0 deletions infrastructure/aws-opensearch/setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Setting up terraform S3 state

- Log into your terminal with the correct environment creds
- Run `terraform init`
- Run `terraform apply`
- Delete all the extra files and folders that were created
4 changes: 4 additions & 0 deletions infrastructure/aws-opensearch/setup/tfstate.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
variable "environment" {
description = "AWS workload account env (e.g. dev, test, prod, tools)"
}

resource "aws_s3_bucket" "terraform_state" {
bucket = "bcparks-opensearch-${var.environment}-terraform-remote-state"
force_destroy = true
Expand Down

0 comments on commit bfd1f55

Please sign in to comment.