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

Stop using upgrade in terraform init calls #2673

Merged
merged 5 commits into from
Oct 2, 2022

Conversation

tamirkamara
Copy link
Collaborator

@tamirkamara tamirkamara commented Oct 2, 2022

Resolves #2672

What is being addressed

Unmarshal terraform errors in migrate.sh.
This is a result of providers being upgraded and their schema changes. This is usually handled by terraform apply but we call other commands in the migrate script before the apply which might produce an error.

How is this addressed

  • Call terraform refresh before we call show to sort out any schema changes
  • Upgrade all providers in core to their latest version (apart from azurerm). The reason is we didn't have all listed in required_providers block until recently and some deployments might see providers version move backward when then upgrade to the latest AzureTRE (mostly the random provider).
  • Remove all uses of -upgrade when calling terraform init as that causes an upgrade and disregard the locks file. We don't need that behavior to happen automatically.

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Unit Test Results

0 tests   - 5   0 ✔️  - 4   0s ⏱️ - 2h 25m 44s
0 suites  - 1   0 💤 ±0 
0 files    - 1   0  - 1 

Results for commit 5484475. ± Comparison against base commit 0df13fd.

♻️ This comment has been updated with latest results.

@tamirkamara
Copy link
Collaborator Author

/test-extended

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/3167341023 (with refid 6e748707)

(in response to this comment from @tamirkamara)

@tamirkamara tamirkamara marked this pull request as ready for review October 2, 2022 06:27
@tamirkamara
Copy link
Collaborator Author

/test

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3167580409 (with refid 6e748707)

(in response to this comment from @tamirkamara)

Copy link
Contributor

@guybartal guybartal left a comment

Choose a reason for hiding this comment

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

LGTM

@tamirkamara tamirkamara merged commit 7d4b101 into main Oct 2, 2022
@tamirkamara tamirkamara deleted the tamirkamara/fix-tf-provider-bug branch October 2, 2022 08:23
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.

Terraform "Failed to marshal state to json"
2 participants