website: Terraform import and remote backends (#26241)

* Put link to tutorial in its own section, call it a tutorial instead of guide, and use new canonical URL.

* Mention limitations of using import with a remote backed

* Typo fix

Co-authored-by: Nick Fagerlund <nick.fagerlund@gmail.com>
This commit is contained in:
Robin Norwood 2020-09-28 18:03:15 -05:00 committed by GitHub
parent d2247294c7
commit 7ccea30b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -41,5 +41,20 @@ imported object will be mapped.
While this may seem tedious, it still gives Terraform users an avenue for
importing existing resources.
You can follow the [Terraform Import guide](https://learn.hashicorp.com/terraform/state/import?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) on HashiCorp learn for a hands-on
introduction to using the `terraform import` command.
## Remote Backends
When using Terraform import on the command line with a [remote
backend](/docs/backends/types/remote.html), such as Terraform Cloud, the import
command runs locally, unlike commands such as apply, which run inside your
Terraform Cloud environment. Because of this, the import command will not have
access to information from the remote backend, such as workspace variables.
In order to use Terraform import with a remote state backend, you may need to
set local variables equivalent to the remote workspace variables.
## Hands-On Tutorial
You can follow the [Terraform Import
tutorial](https://learn.hashicorp.com/tutorials/terraform/state-import?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS)
on HashiCorp learn for a hands-on introduction to using the `terraform import`
command.

View File

@ -85,5 +85,7 @@ not done, Terraform will plan to destroy the imported objects on the next run.
If you want to rename or otherwise move the imported resources, the
[state management commands](/docs/commands/state/index.html) can be used.
You can also follow the [Terraform Import guide](https://learn.hashicorp.com/terraform/state/import?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) on HashiCorp learn for a hands-on
## Hands-On Tutorial
You can also follow the [Terraform Import tutorial](https://learn.hashicorp.com/tutorials/terraform/state-import?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) on HashiCorp learn for a hands-on
introduction to using the `terraform import` command.