mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Added 0.7 upgrade documentation for remote state references.
This commit is contained in:
parent
258005408b
commit
14e5c2d3f2
@ -134,6 +134,34 @@ resource "aws_instance" "example" {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
References to remote state outputs has also changed, the `.output` keyword is no longer required.
|
||||||
|
|
||||||
|
For example, a config like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
resource "terraform_remote_state" "example" {
|
||||||
|
# ...
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_instance" "example" {
|
||||||
|
ami = "${terraform_remote_state.example.output.ami_id}"
|
||||||
|
# ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Would now look like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
data "terraform_remote_state" "example" {
|
||||||
|
# ...
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_instance" "example" {
|
||||||
|
ami = "${data.terraform_remote_state.example.ami_id}"
|
||||||
|
# ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
<a id="listmap"></a>
|
<a id="listmap"></a>
|
||||||
|
|
||||||
## Migrating to native lists and maps
|
## Migrating to native lists and maps
|
||||||
|
Loading…
Reference in New Issue
Block a user