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

Terraform multi-state #472

Merged
merged 22 commits into from
Sep 30, 2022
Merged

Terraform multi-state #472

merged 22 commits into from
Sep 30, 2022

Conversation

psihachina
Copy link
Contributor

@psihachina psihachina commented Sep 28, 2022

Changelog:

  • added support multiple terraform states & configurations
  • added new command ize uo apps
  • command ize up infra to up all terraform states
  • command `ize up to up the specified app or state
  • changed logic of generating terraform state key ( IZE-583 )

Tests:

asciicast

asciicast

asciicast

asciicast

asciicast

asciicast

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2022

Codecov Report

Merging #472 (96cc544) into main (8ebc316) will decrease coverage by 0.62%.
The diff coverage is 8.21%.

@@            Coverage Diff             @@
##             main     #472      +/-   ##
==========================================
- Coverage   30.49%   29.87%   -0.63%     
==========================================
  Files          59       60       +1     
  Lines        7351     7584     +233     
==========================================
+ Hits         2242     2266      +24     
- Misses       4905     5108     +203     
- Partials      204      210       +6     
Impacted Files Coverage Δ
internal/commands/down.go 8.94% <0.00%> (+0.54%) ⬆️
internal/config/config.go 1.37% <0.00%> (-0.28%) ⬇️
internal/config/project.go 0.00% <0.00%> (ø)
internal/terraform/docker.go 0.00% <0.00%> (ø)
internal/commands/up_infra.go 7.85% <0.52%> (-16.48%) ⬇️
internal/commands/down_infra.go 20.98% <2.94%> (-2.55%) ⬇️
internal/commands/up.go 15.03% <3.44%> (+8.15%) ⬆️
internal/commands/up_apps.go 11.81% <11.81%> (ø)
internal/terraform/local.go 68.22% <29.41%> (-3.44%) ⬇️
internal/commands/terraform.go 80.48% <50.00%> (ø)
... and 8 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@AutomationD AutomationD left a comment

Choose a reason for hiding this comment

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

Good work!

Let's make sure we call new sub-infras as a "stack": vpc stack, api stack, etc. They store states in s3.

Also, please let's add a tag to backend.tf called stack (next to namespace), if we are using multiple stacks.

Thansks

examples/multistate-monorepo/.ize/env/testnut/ize.toml Outdated Show resolved Hide resolved
examples/multistate-monorepo/.ize/env/testnut/ize.toml Outdated Show resolved Hide resolved
examples/sls-apps-monorepo/ize.toml Outdated Show resolved Hide resolved
internal/commands/tfenv.go Outdated Show resolved Hide resolved
When `explain` flag is set, the command shows an alternative to bash that will do exactly what the ize command does
Copy link
Contributor

@AutomationD AutomationD left a comment

Choose a reason for hiding this comment

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

  1. Config file location
  2. Please show a test when [terraform.infra] section is not present, and only [terraform.api] and [terraform.vpc] exists

examples/sls-apps-monorepo/ize.toml Outdated Show resolved Hide resolved
…un-terraform-init

IZE-599 ize infra down doesnt run terraform init
…sh-alternative-shown

IZE-516 ize up infra explain bash alternative shown
Copy link
Contributor

@AutomationD AutomationD left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for a good work!

examples/multistate-monorepo/.ize/env/testnut/ize.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@AutomationD AutomationD left a comment

Choose a reason for hiding this comment

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

Great work, thank you @psihachina

@psihachina psihachina merged commit 9153744 into main Sep 30, 2022
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.

3 participants