-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new step in terraform 13 upgrade guide mentioning need to replace…
… provider (#282) * Add new step in terraform 13 upgrade guide mentioning need to replace provider * Run local regen * Apply suggestions from code review Co-authored-by: Rho <[email protected]> * Regen Co-authored-by: Rho <[email protected]>
- Loading branch information
1 parent
8db1a61
commit 1f8ade8
Showing
9 changed files
with
78 additions
and
28 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...terraform/terraform-13/deployment-walkthrough/step-4-update-provider-sources.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
sidebar_label: Update provider sources | ||
--- | ||
|
||
# Step 4: update provider sources to the new format | ||
|
||
Terraform 0.13 introduced a new registry for managing provider releases. This makes it easier to publish and distribute | ||
third party providers. As a part of this, Terraform changed the way providers are tracked in the state file. When | ||
running `terraform init` for the first time on a module that has been updated from <0.13 to 0.13+, you might notice | ||
Terraform installing two providers: | ||
|
||
- `-/PROVIDER` | ||
- `hashicorp/PROVIDER` | ||
|
||
The first one is used to track legacy provider sources that are mentioned in the old state file, while the latter is | ||
what is configured in your module using the new `required_providers` blocks when you upgraded your modules in step 2. | ||
|
||
To avoid conflict between the two providers, it is recommended to update your state file to use the new provider | ||
references. This can be done by using the `state replace-provider` command. | ||
|
||
For each provider your module uses, run the following command: | ||
|
||
``` | ||
# NOTE: Use terragrunt instead of terraform if you are using terragrunt to manage your resources. | ||
terraform state replace-provider -- -/PROVIDER registry.terraform.io/hashicorp/PROVIDER | ||
``` | ||
|
||
For example, if your module uses `null` and `aws` providers, you will want to run: | ||
|
||
``` | ||
terraform state replace-provider -- -/null registry.terraform.io/hashicorp/null | ||
terraform state replace-provider -- -/aws registry.terraform.io/hashicorp/aws | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...terraform/terraform-13/deployment-walkthrough/step-4-update-provider-sources.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
sidebar_label: Update provider sources | ||
--- | ||
|
||
# Step 4: update provider sources to the new format | ||
|
||
Terraform 0.13 introduced a new registry for managing provider releases. This makes it easier to publish and distribute | ||
third party providers. As a part of this, Terraform changed the way providers are tracked in the state file. When | ||
running `terraform init` for the first time on a module that has been updated from <0.13 to 0.13+, you might notice | ||
Terraform installing two providers: | ||
|
||
- `-/PROVIDER` | ||
- `hashicorp/PROVIDER` | ||
|
||
The first one is used to track legacy provider sources that are mentioned in the old state file, while the latter is | ||
what is configured in your module using the new `required_providers` blocks when you upgraded your modules in step 2. | ||
|
||
To avoid conflict between the two providers, it is recommended to update your state file to use the new provider | ||
references. This can be done by using the `state replace-provider` command. | ||
|
||
For each provider your module uses, run the following command: | ||
|
||
``` | ||
# NOTE: Use terragrunt instead of terraform if you are using terragrunt to manage your resources. | ||
terraform state replace-provider -- -/PROVIDER registry.terraform.io/hashicorp/PROVIDER | ||
``` | ||
|
||
For example, if your module uses `null` and `aws` providers, you will want to run: | ||
|
||
``` | ||
terraform state replace-provider -- -/null registry.terraform.io/hashicorp/null | ||
terraform state replace-provider -- -/aws registry.terraform.io/hashicorp/aws | ||
``` | ||
|
||
|
||
<!-- ##DOCS-SOURCER-START | ||
{"sourcePlugin":"local-copier","hash":"0c5aa574c82b473c254f163ea660dffa"} | ||
##DOCS-SOURCER-END --> |