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

Added Backend Configuration to Terraform #595

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

alexrdrgz
Copy link
Contributor

@alexrdrgz alexrdrgz commented Jun 21, 2022

Changes

List Changes Introduced by this PR

  1. Added Backend Configurations files to make state more dynamic
  2. Added terraform plan to the custom npm scripts

Purpose

Within backend section of terraform you cant add vars. Instead the backend.conf let you have that section dynamic

Approach

Looked at porterville CMS project and mimicked how their terraform is setup.

Note

This PR will likely not be merged, as we don't want to change the way we use terraform to much and too fast. This is to shwo proof of concept to devops team

Closes #587

Copy link

@mwallert mwallert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are really good, but we want to make them more generic. Let's set up some time to all chat about this next week!

Copy link
Contributor

@michaelachrisco michaelachrisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexrdrgz I believe we will need to resolve the package.json conflicts before we can review again.

bucket = "shift3-terraform-state"
key = "test-staging-boilerplate-client-react/terraform.tfstate"
region = "us-west-2"
profile = "shift3"
Copy link

@mwallert mwallert Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexrdrgz I think shift3-super is the new default, let's swap this out, update the merge conflicts and this should be good to merge!

@coreyshuman coreyshuman marked this pull request as draft April 3, 2023 23:34
@coreyshuman
Copy link
Member

Converting to draft to reduce code review reminder noise.

@coreyshuman coreyshuman removed the request for review from DropsOfSerenity April 3, 2023 23:35
@alexrdrgz
Copy link
Contributor Author

thanks corey!

@alexrdrgz
Copy link
Contributor Author

alexrdrgz commented Apr 5, 2023

@michaelachrisco I've updated the documentation on here and have updated the code and fixed merge conflicts. I talked to wallert and he agreed before merging we need to setup some sort of training for devs on this new configuration.

It requires a new workflow that could confuse devs without a headsup

@michaelachrisco
Copy link
Contributor

@michaelachrisco I've updated the documentation on here and have updated the code and fixed merge conflicts. I talked to wallert and he agreed before merging we need to setup some sort of training for devs on this new configuration.

It requires a new workflow that could confuse devs without a headsup

Gotcha. Lets take a look.

Copy link
Contributor

@michaelachrisco michaelachrisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a quick look at the PR and found a couple of git merge conflict lines that seem to have made their way into the code. Lets go ahead and remove those.

Terraform looks cool! Throwing things into their respective environments. I like it!

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
"switch-state:stg": "npm run switch-state -target=staging",
"switch-state:prod": "npm run switch-state -target=production",
"terra:init": "cd terraform && terraform init -backend-config=\"environment/$npm_config_target.backend.conf\"",
"terra:init-wrks": "cd terraform && if ! terraform workspace list | grep -q \"\\s$npm_config_name$\"; then terraform workspace new \"$npm_config_name\"; fi",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is terra:init-wrks needed here? Was this added to test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah and for the pre-provision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants