Hi @jbardin ,
Sorry, maybe my question was not clear enough.
Let’s say I have a main.tf
file like this:
provider "aws" {
region = "us-east-1"
}
data "aws_vpc" "default" {
tags = {
Name = "main-us-east-1"
}
}
resource "aws_security_group" "sg" {
vpc_id = data.aws_vpc.default.id
ingress {
description = "SSH"
protocol = "tcp"
from_port = 22
to_port = 22
cidr_blocks = ["0.0.0.0/0"]
}
egress {
description = "egress all"
protocol = "all"
from_port = 0
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
When I run terraform apply
, I see this:
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_security_group.sg: Creating...
aws_security_group.sg: Creation complete after 4s [id=sg-04fa708c5de871ab9]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Nowhere, I see that TF has fetched the Data Source data.aws_vpc.default
, and more importantly, WHEN it did so. In a more complex stack, it can be important to be able to see it.
In older TF versions, I remember that the Data Sources fetch actions were displayed during terraform plan
or terraform apply
.
I would be curious if there is a way to have a flag to add it back. For example:
terraform plan -show-data-sources=true
terraform apply -show-data-sources=true
And having something like this:
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
data.aws_vpc.default: Fetching... <-- Data source fetching...
aws_security_group.sg: Creating...
aws_security_group.sg: Creation complete after 4s [id=sg-04fa708c5de871ab9]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.