-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
provider/aws: Route Table Data Source resource ordering #23604
Comments
To do this you should set |
Sorry should have left
|
Believe this is now fixed. |
Spoke too soon, still occurring. |
Experiencing same "plan was not empty" symptom with a data source using depends_on in acceptance tests in the Oracle provider as well. In actual use this causes subsequent plan/apply calls to refresh the data source. |
I have extracted the config from linked acceptance test and upgraded to 0.12 syntax. I can't tell if this is still reproducible in the same way as (1) the report is quite old now, and (2) testing framework makes certain assumptions that Terraform itself may not. That said I see that there's still something possibly weird happening. Usually data sources themselves never trigger confirmation from the user, but that's exactly what's happening here. When you
terraform {
required_version = ">= 0.12"
}
provider "aws" {
region = "eu-central-1"
}
resource "aws_vpc" "test" {
cidr_block = "172.16.0.0/16"
tags = {
Name = "terraform-testacc-data-source"
}
}
resource "aws_subnet" "test" {
cidr_block = "172.16.0.0/24"
vpc_id = aws_vpc.test.id
tags = {
Name = "terraform-testacc-data-source"
}
}
resource "aws_route_table" "test" {
vpc_id = aws_vpc.test.id
tags = {
Name = "terraform-testacc-routetable-data-source"
}
}
resource "aws_route_table_association" "a" {
subnet_id = aws_subnet.test.id
route_table_id = aws_route_table.test.id
}
data "aws_route_table" "by_filter" {
filter {
name = "association.route-table-association-id"
values = [aws_route_table_association.a.id]
}
depends_on = [aws_route_table_association.a]
}
data "aws_route_table" "by_tag" {
tags = {
Name = aws_route_table.test.tags["Name"]
}
depends_on = [aws_route_table_association.a]
}
data "aws_route_table" "by_subnet" {
subnet_id = aws_subnet.test.id
depends_on = [aws_route_table_association.a]
}
data "aws_route_table" "by_id" {
route_table_id = aws_route_table.test.id
depends_on = [aws_route_table_association.a]
} If there is a bug related to ordering, it's core that decides how to order nodes in the graph anyway, so I'm going to migrate this back there. |
Thanks @radeksimko, not sure how this issue laid around open for so long. |
@grubernaut, #17034 is a good reference, and will likely be the the solution to allow them. |
most excellent, thanks! 😄 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
0.8.3
and masterAffected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
https://gist.github.com/grubernaut/8343042b560fd88a1f08c247c5d499d7
Expected Behavior
The data resource be ordered after the
aws_route_table
andaws_route_table_association
resourcesActual Behavior
The data resource was ordered before the route table resources, causing an error.
Steps to Reproduce
terraform plan
terraform apply
Important Factoids
Reason the acceptance test
TestAccDataSourceAwsRouteTable
is failing.References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: