-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
data "aws_iam_policy_document" and other resources are always read during apply #21164
Comments
Hey @dreinhardt-terminus 👋 Thank you for taking the time to file this issue. It sounds like you may be using values from the data source that can't be determined until the apply phase, as is described in the data resource behavior documentation, but it's a bit difficult to say with certainty with the information we have now. Can you update the issue description with the output as well, as noted in the issue template so that we have all of the necessary information to investigate? |
I added in the tf plan output. |
Hey @dreinhardt-terminus 👋 Thank you for the update. I've got a bit of a breakdown here that I hope will help some.
|
For As for resource "aws_elasticsearch_domain" "master-company-es-5" {
domain_name = "master-company-es5"
elasticsearch_version = "6.8"
advanced_options = {
"rest.action.multi.allow_explicit_index" = "true"
}
cluster_config {
instance_type = "m3.medium.elasticsearch"
instance_count = "3"
}
ebs_options {
ebs_enabled = "true"
volume_type = "io1"
volume_size = "80"
iops = "1000"
}
snapshot_options {
automated_snapshot_start_hour = 23
}
tags = merge(
local.dev_billing_tags,
{
ServiceName = "MasterCompany"
Domain = var.convox_unique_prefix
}
)
}
resource "aws_iam_user" "master-company-user" {
name = "${var.convox_unique_prefix}-master-company"
path = "/"
tags = merge(
local.dev_billing_tags,
{
ServiceName = "MasterCompany"
}
)
}
variable "rack-vpccidr" {
default = "10.30.0.0/16"
} |
Hey @dreinhardt-terminus I think this issue may be relevant to what you're seeing: #10300 As far as the additional configs that you provided, are any of those showing up in the plan output that may have been omitted what you provided previously? And is that data source being read more of an "this is not nice to look at" issue, or is it causing similar resource replacement on every run? |
For the As for the
|
Looks like I am also getting the below but I don't know what resource "aws_elasticsearch_domain" "master-company-es-5" {
domain_name = "master-company-es5"
elasticsearch_version = "6.8"
advanced_options = {
"rest.action.multi.allow_explicit_index" = "true"
}
cluster_config {
instance_type = "m3.medium.elasticsearch"
instance_count = "3"
}
ebs_options {
ebs_enabled = "true"
volume_type = "io1"
volume_size = "80"
iops = "1000"
}
snapshot_options {
automated_snapshot_start_hour = 23
}
tags = merge(
local.dev_billing_tags,
{
ServiceName = "MasterCompany"
Domain = var.convox_unique_prefix
}
)
}
|
Hey @dreinhardt-terminus 👋 Thanks again for the updates! Since resources = [aws_elasticsearch_domain.master-company-es-5.arn] |
So @justinretzolk do we have a snake eating it's own tail situation? Is there a workaround for this? |
Hey @dreinhardt-terminus, I don't know that I'd necessarily say it's a snake eating it's own tail, as if In looking at the documentation for the I'm curious - is it possible that this is being set outside of Terraform? If it were, Terraform would read that during the plan phase and try to remove it as it's not defined in the configuration. Some reference for that value can be found on this AWS document. If this value is something that you find should be set, you could update the advanced_options = {
"override_main_response_version" = "true"
} |
After adding the above advanced_option we no longer get a perpetual update in-place. |
Thank you for the udpate @dreinhardt-terminus! Since this seems to have ultimately been a combination of a few things that were configuration related, and doesn't seem to be a (new) bug, we're going to go ahead and close this issue for now. If you feel we've done this in error, please do let us know. |
FWIW, I am seeing this too: a change to the I do realise that I can set a value for |
@knyar Thank you for the additional context - I'm going to reopen this and mark it as a bug so that we can look into it as time permits, since multiple separate reports seems to indicate that it's not something that's a one-off configuration issue. |
On second thought, @knyar, would you mind opening a fresh issue with that information? Since it's a bit different that the initial issue that was reported here, I'd hate to cause additional confusion by having your issue description buried so far down. |
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. |
Community Note
Versions
*Terraform v0.14.11
*hashicorp/aws v3.61.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
TF Plan Output
Expected Behavior
None of the resources were changed so the tf plan should indicate no infrastructure changes
Actual Behavior
Terraform always states the data blocks will be read during apply and some of the resources (using the aws_lambda_function arn are recreated during apply).
Steps to Reproduce
The text was updated successfully, but these errors were encountered: