-
Notifications
You must be signed in to change notification settings - Fork 691
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 sources with non-deterministic IDs show perpetual diff with Terraform 0.13.0 #1148
Comments
Hi @tutorialbyexample -- thanks for raising this issue. We are tracking this issue with terraform core: hashicorp/terraform#25812 |
@tutorialbyexample , this is an issue in the Terraform v0.13.0 CLI which broke compatibility with the previous v0.12.X behavior. The v0.13.1 of the Terraform CLI was released recently and should resolve this issue. Closing the ticket. https://www.terraform.io/downloads.html https://github.com/hashicorp/terraform/blob/v0.13.1/CHANGELOG.md |
I just tried and I am still seeing this in 0.13.1 |
@sblask , what configuration are you trying this with and what output are you seeing? For reference, I tried this with 0.13.1 and no longer get perpetual diffs on data source IDs: // Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Mozilla Public License v2.0
variable "tenancy_ocid" {
}
variable "user_ocid" {
}
variable "fingerprint" {
}
variable "private_key_path" {
}
variable "compartment_ocid" {
}
variable "region" {
}
provider "oci" {
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
region = var.region
}
data "oci_identity_compartments" "compartments" {
#Required
compartment_id = var.tenancy_ocid
#Optional
access_level = "ANY"
}
resource "oci_core_vcn" "vcn1" {
cidr_block = "10.0.0.0/16"
dns_label = "vcn1"
compartment_id = var.compartment_ocid
display_name = "vcn1"
}
data "oci_core_vcns" "vcns" {
compartment_id = var.compartment_ocid
depends_on = [oci_core_vcn.vcn1]
}
output "vcn_id" {
value = oci_core_vcn.vcn1.id
} I first ran I then ran
|
This is what I am seeing (this is for an existing module, so I slightly modified the output to only show relevant stuff):
|
@sblask , it seems like you're encountering this issue with non-OCI providers like AWS/Vault/etc... This github repo is for Oracle Cloud provider issues. Can you redirect your question to github.com/hashicorp/terraform? I believe the issue you're encountering is in Terraform core behavior. |
Sorry about that, this issue was linked in another issue and I didn't realise it's a different repository. |
Hello Alexng, Still i'm facing this issue in OCI provider as well with terraform version 0.13.1. `
======================================== Terraform will perform the following actions: data.oci_file_storage_export_sets.export_sets will be read during apply data.oci_file_storage_file_systems.fss will be read during apply data.oci_file_storage_mount_targets.mount_targets will be read during apply module.export["phxl1-dbbackend-001"].oci_file_storage_export.export[0] must be replaced
Plan: 1 to add, 0 to change, 1 to destroy. Changes to Outputs:
Do you want to perform these actions? |
Reopening this for investigation. |
@tutorialbyexample : Tried reproducing this error with the last plan output's config but i dont see a diff. Following for your reference : An execution plan has been generated and is shown below. Terraform will perform the following actions: data.oci_core_private_ips.ip_mount_target1 will be read during apply
data.oci_file_storage_export_sets.export_sets will be read during apply data.oci_file_storage_exports.exports will be read during apply data.oci_file_storage_file_systems.file_systems will be read during apply data.oci_file_storage_mount_targets.mount_targets will be read during apply data.oci_file_storage_snapshots.snapshots will be read during apply Plan: 0 to add, 0 to change, 0 to destroy. ` ` $ tf13 -v
|
++++++++++++++++++++++++++++++++++++++++
Initializing the backend... Initializing provider plugins...
Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see If you ever set or change modules or backend configuration for Terraform,
|
data "oci_file_storage_mount_targets" "mount_targets" {
} locals { output mount_targets_id { |
A new terraform provider version has been released with deterministic data source ids https://github.com/terraform-providers/terraform-provider-oci/releases/tag/v4.0.0 |
In terraform version 0.12.0, once we run plan after apply, while using the data source there will be no changes however, in version terraform 0.13.0 which doing the apply we are getting change in data source and causing for recreation of resource as ID of data source are getting change every time. This has been reported for aws provide as well in "hashicorp/terraform-provider-aws#14579"
Terraform Version and Provider Version
terraform -version
Terraform v0.13.0
Affected Resource(s)
data "oci_file_storage_export_sets" "test_export_sets"
or any data source which have module implementation and depends_on.
Terraform Configuration Files
Expected Behavior
data source id should not change.
Actual Behavior
data source id getting change.
Steps to Reproduce
terraform init
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: