mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
core: Fix TargetsTransformer tests
Resolution of dependencies automatically from expressions now requires a schema to be available. To avoid the need to provide mock schemas for all of these different resource types, we instead use the depends_on argument here to mark the dependencies explicitly.
This commit is contained in:
parent
17d8ec6b6f
commit
a6ca01f49d
@ -1,16 +1,22 @@
|
|||||||
resource "aws_vpc" "me" {}
|
resource "aws_vpc" "me" {}
|
||||||
|
|
||||||
resource "aws_subnet" "me" {
|
resource "aws_subnet" "me" {
|
||||||
vpc_id = "${aws_vpc.me.id}"
|
depends_on = [
|
||||||
|
aws_vpc.me,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_instance" "me" {
|
resource "aws_instance" "me" {
|
||||||
subnet_id = "${aws_subnet.me.id}"
|
depends_on = [
|
||||||
|
aws_subnet.me,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_vpc" "notme" {}
|
resource "aws_vpc" "notme" {}
|
||||||
resource "aws_subnet" "notme" {}
|
resource "aws_subnet" "notme" {}
|
||||||
resource "aws_instance" "notme" {}
|
resource "aws_instance" "notme" {}
|
||||||
resource "aws_instance" "notmeeither" {
|
resource "aws_instance" "notmeeither" {
|
||||||
name = "${aws_instance.me.id}"
|
depends_on = [
|
||||||
|
aws_instance.me,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,26 @@
|
|||||||
resource "aws_vpc" "notme" {}
|
resource "aws_vpc" "notme" {}
|
||||||
|
|
||||||
resource "aws_subnet" "notme" {
|
resource "aws_subnet" "notme" {
|
||||||
vpc_id = "${aws_vpc.notme.id}"
|
depends_on = [
|
||||||
|
aws_vpc.notme,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_instance" "me" {
|
resource "aws_instance" "me" {
|
||||||
subnet_id = "${aws_subnet.notme.id}"
|
depends_on = [
|
||||||
|
aws_subnet.notme,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_instance" "notme" {}
|
resource "aws_instance" "notme" {}
|
||||||
resource "aws_instance" "metoo" {
|
resource "aws_instance" "metoo" {
|
||||||
name = "${aws_instance.me.id}"
|
depends_on = [
|
||||||
|
aws_instance.me,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_elb" "me" {
|
resource "aws_elb" "me" {
|
||||||
instances = "${aws_instance.me.*.id}"
|
depends_on = [
|
||||||
|
aws_instance.me,
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user