Skip to content
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 (R015, R016, R017 linters) #14579

Closed
ewbankkit opened this issue Aug 11, 2020 · 23 comments · Fixed by #15896
Assignees
Labels
bug Addresses a defect in current functionality. linter Pertains to changes to or issues with the various linters. provider Pertains to the provider itself, rather than any interaction with AWS. upstream-terraform Addresses functionality related to the Terraform core binary.
Milestone

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented Aug 11, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.0
AWS Provider v3.1.0

Affected Resource(s)

$ grep 'd.SetId' aws/data_source*.go | grep Now
aws/data_source_aws_acm_certificate.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_autoscaling_group.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_autoscaling_groups.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_availability_zones.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_caller_identity.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ebs_default_kms_key.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ebs_encryption_by_default.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ec2_coip_pools.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ec2_local_gateway_route_tables.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ec2_local_gateways.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ecr_authorization_token.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_ecr_image.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_efs_access_points.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_eks_cluster_auth.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_glue_script.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_iam_account_alias.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_inspector_rules_packages.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_kms_alias.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_kms_ciphertext.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_kms_secrets.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_partition.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_regions.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_route53_resolver_rules.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_sns.go:	d.SetId(time.Now().UTC().String())
aws/data_source_aws_vpcs.go:	d.SetId(time.Now().UTC().String())
$ grep 'd.SetId' aws/data_source*.go | grep Unique
aws/data_source_aws_db_event_categories.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_ebs_volumes.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_ec2_instance_type_offering.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_ec2_instance_type_offerings.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_ec2_local_gateway_virtual_interface_groups.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_ec2_spot_price.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_instances.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_network_acls.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_network_interfaces.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_organizations_organizational_units.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_outposts_outposts.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_outposts_sites.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_route_tables.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_s3_bucket_objects.go:	d.SetId(resource.UniqueId())
aws/data_source_aws_security_groups.go:	d.SetId(resource.UniqueId())

Actual Behavior

Data sources whose ID is set to a non-deterministic value (e.g. the current timestamp or a unique ID) that changes every time a refresh (the data source's Read method) runs show a perpetual diff starting with Terraform 0.13.0.

For example

provider "aws" {
  region = "us-west-2"
}

data "aws_availability_zones" "a" {}
Terraform 0.12
$ terraform apply
data.aws_availability_zones.a: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.aws_availability_zones.a: Refreshing state...

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
Terraform 0.13
$ terraform apply
data.aws_availability_zones.a: Refreshing state...

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
 <= read (data resources)

Terraform will perform the following actions:

  # data.aws_availability_zones.a will be read during apply
  # (config refers to values not yet known)
 <= data "aws_availability_zones" "a"  {
        group_names = [
            "us-west-2",
            "us-west-2-lax-1",
        ]
      ~ id          = "2020-08-11 20:23:08.230813894 +0000 UTC" -> "2020-08-11 20:23:09.61125009 +0000 UTC"
        names       = [
            "us-west-2-lax-1a",
            "us-west-2a",
            "us-west-2b",
            "us-west-2c",
            "us-west-2d",
        ]
        zone_ids    = [
            "usw2-lax1-az1",
            "usw2-az1",
            "usw2-az2",
            "usw2-az3",
            "usw2-az4",
        ]
    }

Plan: 0 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_availability_zones.a: Reading... [id=2020-08-11 20:23:08.230813894 +0000 UTC]
data.aws_availability_zones.a: Read complete after 0s [id=2020-08-11 20:23:09.61125009 +0000 UTC]

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.aws_availability_zones.a: Refreshing state... [id=2020-08-11 20:23:09.61125009 +0000 UTC]

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
 <= read (data resources)

Terraform will perform the following actions:

  # data.aws_availability_zones.a will be read during apply
  # (config refers to values not yet known)
 <= data "aws_availability_zones" "a"  {
        group_names = [
            "us-west-2",
            "us-west-2-lax-1",
        ]
      ~ id          = "2020-08-11 20:23:19.963587604 +0000 UTC" -> "2020-08-11 20:23:21.360002629 +0000 UTC"
        names       = [
            "us-west-2-lax-1a",
            "us-west-2a",
            "us-west-2b",
            "us-west-2c",
            "us-west-2d",
        ]
        zone_ids    = [
            "usw2-lax1-az1",
            "usw2-az1",
            "usw2-az2",
            "usw2-az3",
            "usw2-az4",
        ]
    }

Plan: 0 to add, 0 to change, 0 to destroy.

------------------------------------------------------------------------

References

Related:

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Aug 11, 2020
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. and removed service/ec2 Issues and PRs that pertain to the ec2 service. labels Aug 11, 2020
@bflad bflad added the upstream-terraform Addresses functionality related to the Terraform core binary. label Aug 12, 2020
@mendhak
Copy link

mendhak commented Aug 12, 2020

In our case, we use terraform plan as part of a CI Pipeline, and this means there are a lot of data blocks with will be read during apply messages in the terraform plan output.

This makes pull requests/reviews quite difficult as some of our Terraform repositories are quite large, and make use of a lot of data resources.

@bflad
Copy link
Contributor

bflad commented Aug 12, 2020

A few notes since this change was unexpected for Terraform Providers.

There may be some additional work the Terraform core team can do to prevent this unexpected plan output issue from occurring in later Terraform 0.13 releases, but it is unknown if/what that might entail at the moment, so unable to provide any estimates on timelines. For example: hashicorp/terraform#25812

We just migrated this provider to the newly released version 2 of the Terraform Plugin SDK which should allow us to run the acceptance testing against Terraform 0.13.0 directly (currently running against 0.12.26). Bumping our testing to that version would potentially make this class of issue more visible. However, I just submitted a bunch of issues here and in the SDK to cover the 30 or so new consistent test failures caused by the SDK version 2 upgrade. Ideally we need to get through those before potentially adding more uncertainty about the causes for test failures since the SDK v2 framework may not fully be compatible with Terraform 0.13 yet.

New tfproviderlint/awsproviderlint checks are now available for this specific issue (not enabled in our CI yet, fresh off the press):

Longterm this is certainly something we will need to address more holistically as this behavior change will be the default in Terraform core, but we should come up with a game plan before jumping to code changes.

@jbardin
Copy link
Member

jbardin commented Aug 20, 2020

To clarify the issue here, since this is being referenced from many places, the apparent diffs from a non-deterministic ID is only the symptom, and not the underlying problem. While it may be better in the long run to have deterministic attributes when possible (remember that core attributes to special meaning to id, it is simply another attribute), unnecessarily changing an attribute is not technically incorrect.

The problems here are mostly stemming from 2 places; either the schema is incorrectly defined with data being written to a non-computed field; or the SDK is altering a zero value for a schema block. The former problem is usually a simple change in the resource definition, while the latter should be remedied with with a patch in core for 0.13.1.

@avvi00
Copy link

avvi00 commented Sep 8, 2020

Just adding in another data source affected is aws_kms_secrets. It's leaking a password encrypted with KMS to the console.

image

I'm running 0.13.2

@ktmorgan
Copy link
Contributor

I was experiencing the same issue, and found that upgrading my version of Terraform fixed my issue.

Using latest version of the AWS provider (3.7.0 at the time of comment) and version 0.13.1+ (tested 0.13.1, 0.13.2, 0.13.3), this does not seem to be an issue. I tested with the aws_availability_zones data source.

Just a note here, I did test with Terraform version 0.13.0 with AWS provider version 3.7.0, and the issue persisted when doing that.

@dimisjim
Copy link
Contributor

can also confirm @ktmorgan 's account

@der-eismann
Copy link
Contributor

I still experience this issue with terraform 0.13.3 and aws provider 3.8.0

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
 <= read (data resources)

Terraform will perform the following actions:

  # module.ingress_apiserver.data.aws_acm_certificate.private_ingress will be read during apply
  # (config refers to values not yet known)
 <= data "aws_acm_certificate" "private_ingress"  {
        arn         = ""
        domain      = ""
      ~ id          = "2020-09-25 16:30:34.614684996 +0000 UTC" -> "2020-09-25 16:31:58.10270239 +0000 UTC"
        most_recent = false
        tags        = {}
    }

  # module.ingress_traefik.data.aws_acm_certificate.private_ingress will be read during apply
  # (config refers to values not yet known)
 <= data "aws_acm_certificate" "private_ingress"  {
        arn         = ""
        domain      = ""
      ~ id          = "2020-09-25 16:30:40.318109288 +0000 UTC" -> "2020-09-25 16:31:58.333672281 +0000 UTC"
        most_recent = false
        tags        = {}
    }

  # module.ingress_traefik.data.aws_acm_certificate.cloud will be read during apply
  # (config refers to values not yet known)
 <= data "aws_acm_certificate" "cloud"  {
        arn         = ""
        domain      = ""
      ~ id          = "2020-09-25 16:30:38.512641469 +0000 UTC" -> "2020-09-25 16:31:58.337586459 +0000 UTC"
        most_recent = false
        tags        = {}
    }

  # module.ingress_traefik.module.traefik_public.data.aws_acm_certificate.cloud will be read during apply
  # (config refers to values not yet known)
 <= data "aws_acm_certificate" "cloud"  {
        arn         = ""
        domain      = ""
      ~ id          = "2020-09-25 16:30:36.56696734 +0000 UTC" -> "2020-09-25 16:31:58.350688577 +0000 UTC"
        most_recent = false
        tags        = {}
    }

  # module.ingress_traefik.module.traefik_waf.data.aws_acm_certificate.cloud will be read during apply
  # (config refers to values not yet known)
 <= data "aws_acm_certificate" "cloud"  {
        arn         = ""
        domain      = ""
      ~ id          = "2020-09-25 16:30:34.648220862 +0000 UTC" -> "2020-09-25 16:31:57.940237258 +0000 UTC"
        most_recent = false
        tags        = {}
    }

Plan: 0 to add, 0 to change, 0 to destroy.

@sporokh
Copy link

sporokh commented Sep 29, 2020

Same issue for me with latest Terraform 0.13.3, and 3.8.0 AWS provider.
This keeps happening with every plan/apply for all our TF repos.

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
 <= read (data resources)

Terraform will perform the following actions:

  # data.aws_availability_zones.available will be read during apply
  # (config refers to values not yet known)
 <= data "aws_availability_zones" "available"  {
        group_names = [
            "us-east-1",
        ]
      ~ id          = "2020-09-29 16:55:42.830182 +0000 UTC" -> "2020-09-29 16:55:50.433126 +0000 UTC"
        names       = [
            "us-east-1a",
            "us-east-1b",
            "us-east-1c",
            "us-east-1d",
            "us-east-1e",
            "us-east-1f",
        ]
        state       = "available"
        zone_ids    = [
            "use1-az1",
            "use1-az2",
            "use1-az4",
            "use1-az6",
            "use1-az3",
            "use1-az5",
        ]
    }

Plan: 0 to add, 0 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

Releasing state lock. This may take a few moments...

Any estimates for the fix?

bflad added a commit that referenced this issue Sep 30, 2020
…ear identifiers

Reference: #14579
Reference: https://github.com/bflad/tfproviderlint/tree/master/passes/R015
Reference: https://github.com/bflad/tfproviderlint/tree/master/passes/R016
Reference: https://github.com/bflad/tfproviderlint/tree/master/passes/R017
Reference: https://www.terraform.io/docs/extend/best-practices/versioning.html#example-major-number-increments
Reference: https://registry.terraform.io/providers/hashicorp/random/
Reference: https://registry.terraform.io/providers/hashicorp/time/

Terraform 0.13 reworked data source reads into the plan graph, which had some unintentional consequences with Terraform Plugin SDK and provider behaviors that were previously ignored when displaying plan differences. While some of these differences  dealing with empty and missing blocks could be addressed with extra graph logic, there remains problematic behaviors that will not be addressable in the near future in core or the SDK.

This change set uses the `tfproviderlint` R015, R016, and R017 checks to find `(*schema.ResourceData).SetId()` usage with unstable values such as the current time and per-execution random identifiers and where the identifier can be stablized based on the data source purpose and surrounding context. For example, singular data sources that represent an analogous managed resource can use the same identifier (e.g. `aws_acm_certificate`, `aws_autoscaling_group`). Other cases where the data source represents information from an AWS Partition or AWS Region are stabilized with those as identifiers (e.g. `aws_regions`).

Importantly, its worth noting that while the unstable `id` attribute is the most visible in the plan difference output, it does not necessarily represent the underlying issue that is causing the output to show. There are two known cases, first with providers unexpectedly writing values to unconfigured and uncomputed attributes and second with Default usage in data source schemas, that are the real triggers of the unexpected difference output. Additional upstream bug reports to properly show difference sigils in the plan difference output are likely necessary, since in many of the real world cases of this particular issue they are missing. Potential future bug reports containing these data sources may help guide those.

Another important note here is that per the Extending Terraform documentation for versioning, that resource identifier changes typically fall under a best practice of a major version increment for Terraform Providers. Given the widespread reports of unexpected behavior as practitioners are upgrading to Terraform 0.13 and since the old identifiers did not represent meaningful information for the lookup context, these changes are not lightly being considered a bug fix. If the usage of a changing time stamp is necessary, the `timestamp()` function and Terraform Time Provider are recommended methodologies for this information. If the usage of a changing random identifier is necessary, the Terraform Random Provider is the recommended methodology.

There still remains other data sources and resources that suffer from known unstable identifiers, such as many plural data sources. Determination of the path forward for these is still undetermined, since ideally Terraform Providers should no longer need to set an `id` attribute after Terraform 0.12, however the Terraform Plugin SDK does not provide functionality to avoid this yet. Future changes may involve a standardized pattern for these within the provider itself.

Changes:

```
NOTES:

* data-source/aws_acm_certificate: The `id` attribute has changed to the ARN of the ACM Certificate. The first apply of this updated data source may show this difference.
* data-source/aws_autoscaling_group: The `id` attribute has changed to the name of the Auto Scaling Group. The first apply of this updated data source may show this difference.
* data-source/aws_availability_zones: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_db_event_categories: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ebs_default_kms_key: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ebs_encryption_by_default: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ec2_instance_type_offering: The `id` attribute has changed to the EC2 Instance Type. The first apply of this updated data source may show this difference.
* data-source/aws_ecr_authorization_token: The `id` attribute has changed to the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ecr_image: The `id` attribute has changed to the SHA256 digest of the ECR Image. The first apply of this updated data source may show this difference.
* data-source/aws_eks_cluster_auth: The `id` attribute has changed to the name of the EKS Cluster. The first apply of this updated data source may show this difference.
* data-source/aws_iam_account_alias: The `id` attribute has changed to the AWS Account Alias. The first apply of this updated data source may show this difference.
* data-source/aws_kms_alias: The `id` attribute has changed to the ARN of the KMS Alias. The first apply of this updated data source may show this difference.
* data-source/aws_partition: The `id` attribute has changed to the identifier of the AWS Partition. The first apply of this updated data source may show this difference.
* data-source/aws_regions: The `id` attribute has changed to the identifier of the AWS Partition. The first apply of this updated data source may show this difference.
* data-source/aws_sns_topic: The `id` attribute has changed to the ARN of the SNS Topic. The first apply of this updated data source may show this difference.

FIXES:

* data-source/aws_acm_certificate: Prevent plan differences with the `id` attribute
* data-source/aws_autoscaling_group: Prevent plan differences with the `id` attribute
* data-source/aws_availability_zones: Prevent plan differences with the `id` attribute
* data-source/aws_db_event_categories: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_default_kms_key: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_encryption_by_default: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_instance_type_offering: Prevent plan differences with the `id` attribute
* data-source/aws_ecr_authorization_token: Prevent plan differences with the `id` attribute
* data-source/aws_ecr_image: Prevent plan differences with the `id` attribute
* data-source/aws_eks_cluster_auth: Prevent plan differences with the `id` attribute
* data-source/aws_iam_account_alias: Prevent plan differences with the `id` attribute
* data-source/aws_kms_alias: Prevent plan differences with the `id` attribute
* data-source/aws_partition: Prevent plan differences with the `id` attribute
* data-source/aws_regions: Prevent plan differences with the `id` attribute
* data-source/aws_sns_topic: Prevent plan differences with the `id` attribute
```

Output from acceptance testing:

```
--- PASS: TestAccAwsAutoScalingGroupDataSource_basic (38.65s)

--- PASS: TestAccAWSAvailabilityZones_AllAvailabilityZones (23.55s)
--- PASS: TestAccAWSAvailabilityZones_basic (23.40s)
--- PASS: TestAccAWSAvailabilityZones_ExcludeNames (14.32s)
--- PASS: TestAccAWSAvailabilityZones_ExcludeZoneIds (24.34s)
--- PASS: TestAccAWSAvailabilityZones_Filter (23.32s)
--- PASS: TestAccAWSAvailabilityZones_stateFilter (23.23s)

--- PASS: TestAccAWSDbEventCategories_basic (15.76s)
--- PASS: TestAccAWSDbEventCategories_sourceType (14.71s)

--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_Filter (23.91s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_LocationType (24.65s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_PreferredInstanceTypes (23.58s)

--- PASS: TestAccAWSEcrAuthorizationTokenDataSource_basic (23.96s)

--- PASS: TestAccAWSEcrDataSource_ecrImage (24.22s)

--- PASS: TestAccAWSEksClusterAuthDataSource_basic (19.59s)

--- PASS: TestAccDataSourceAwsEBSDefaultKmsKey_basic (20.11s)

--- PASS: TestAccDataSourceAwsEBSEncryptionByDefault_basic (23.26s)

--- PASS: TestAccDataSourceAwsKmsAlias_AwsService (24.27s)
--- PASS: TestAccDataSourceAwsKmsAlias_CMK (28.03s)

--- PASS: TestAccDataSourceAwsRegions_AllRegions (23.30s)
--- PASS: TestAccDataSourceAwsRegions_basic (23.44s)
--- PASS: TestAccDataSourceAwsRegions_Filter (22.16s)

--- PASS: TestAccDataSourceAwsSnsTopic_basic (26.41s)
```
bflad added a commit that referenced this issue Oct 5, 2020
…ear identifiers (#15399)

Reference: #14579
Reference: https://github.com/bflad/tfproviderlint/tree/master/passes/R015
Reference: https://github.com/bflad/tfproviderlint/tree/master/passes/R016
Reference: https://github.com/bflad/tfproviderlint/tree/master/passes/R017
Reference: https://www.terraform.io/docs/extend/best-practices/versioning.html#example-major-number-increments
Reference: https://registry.terraform.io/providers/hashicorp/random/
Reference: https://registry.terraform.io/providers/hashicorp/time/

Terraform 0.13 reworked data source reads into the plan graph, which had some unintentional consequences with Terraform Plugin SDK and provider behaviors that were previously ignored when displaying plan differences. While some of these differences  dealing with empty and missing blocks could be addressed with extra graph logic, there remains problematic behaviors that will not be addressable in the near future in core or the SDK.

This change set uses the `tfproviderlint` R015, R016, and R017 checks to find `(*schema.ResourceData).SetId()` usage with unstable values such as the current time and per-execution random identifiers and where the identifier can be stablized based on the data source purpose and surrounding context. For example, singular data sources that represent an analogous managed resource can use the same identifier (e.g. `aws_acm_certificate`, `aws_autoscaling_group`). Other cases where the data source represents information from an AWS Partition or AWS Region are stabilized with those as identifiers (e.g. `aws_regions`).

Importantly, its worth noting that while the unstable `id` attribute is the most visible in the plan difference output, it does not necessarily represent the underlying issue that is causing the output to show. There are two known cases, first with providers unexpectedly writing values to unconfigured and uncomputed attributes and second with Default usage in data source schemas, that are the real triggers of the unexpected difference output. Additional upstream bug reports to properly show difference sigils in the plan difference output are likely necessary, since in many of the real world cases of this particular issue they are missing. Potential future bug reports containing these data sources may help guide those.

Another important note here is that per the Extending Terraform documentation for versioning, that resource identifier changes typically fall under a best practice of a major version increment for Terraform Providers. Given the widespread reports of unexpected behavior as practitioners are upgrading to Terraform 0.13 and since the old identifiers did not represent meaningful information for the lookup context, these changes are not lightly being considered a bug fix. If the usage of a changing time stamp is necessary, the `timestamp()` function and Terraform Time Provider are recommended methodologies for this information. If the usage of a changing random identifier is necessary, the Terraform Random Provider is the recommended methodology.

There still remains other data sources and resources that suffer from known unstable identifiers, such as many plural data sources. Determination of the path forward for these is still undetermined, since ideally Terraform Providers should no longer need to set an `id` attribute after Terraform 0.12, however the Terraform Plugin SDK does not provide functionality to avoid this yet. Future changes may involve a standardized pattern for these within the provider itself.

Changes:

```
NOTES:

* data-source/aws_acm_certificate: The `id` attribute has changed to the ARN of the ACM Certificate. The first apply of this updated data source may show this difference.
* data-source/aws_autoscaling_group: The `id` attribute has changed to the name of the Auto Scaling Group. The first apply of this updated data source may show this difference.
* data-source/aws_availability_zones: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_db_event_categories: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ebs_default_kms_key: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ebs_encryption_by_default: The `id` attribute has changed to the name of the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ec2_instance_type_offering: The `id` attribute has changed to the EC2 Instance Type. The first apply of this updated data source may show this difference.
* data-source/aws_ecr_authorization_token: The `id` attribute has changed to the AWS Region. The first apply of this updated data source may show this difference.
* data-source/aws_ecr_image: The `id` attribute has changed to the SHA256 digest of the ECR Image. The first apply of this updated data source may show this difference.
* data-source/aws_eks_cluster_auth: The `id` attribute has changed to the name of the EKS Cluster. The first apply of this updated data source may show this difference.
* data-source/aws_iam_account_alias: The `id` attribute has changed to the AWS Account Alias. The first apply of this updated data source may show this difference.
* data-source/aws_kms_alias: The `id` attribute has changed to the ARN of the KMS Alias. The first apply of this updated data source may show this difference.
* data-source/aws_partition: The `id` attribute has changed to the identifier of the AWS Partition. The first apply of this updated data source may show this difference.
* data-source/aws_regions: The `id` attribute has changed to the identifier of the AWS Partition. The first apply of this updated data source may show this difference.
* data-source/aws_sns_topic: The `id` attribute has changed to the ARN of the SNS Topic. The first apply of this updated data source may show this difference.

FIXES:

* data-source/aws_acm_certificate: Prevent plan differences with the `id` attribute
* data-source/aws_autoscaling_group: Prevent plan differences with the `id` attribute
* data-source/aws_availability_zones: Prevent plan differences with the `id` attribute
* data-source/aws_db_event_categories: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_default_kms_key: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_encryption_by_default: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_instance_type_offering: Prevent plan differences with the `id` attribute
* data-source/aws_ecr_authorization_token: Prevent plan differences with the `id` attribute
* data-source/aws_ecr_image: Prevent plan differences with the `id` attribute
* data-source/aws_eks_cluster_auth: Prevent plan differences with the `id` attribute
* data-source/aws_iam_account_alias: Prevent plan differences with the `id` attribute
* data-source/aws_kms_alias: Prevent plan differences with the `id` attribute
* data-source/aws_partition: Prevent plan differences with the `id` attribute
* data-source/aws_regions: Prevent plan differences with the `id` attribute
* data-source/aws_sns_topic: Prevent plan differences with the `id` attribute
```

Output from acceptance testing:

```
--- PASS: TestAccAwsAutoScalingGroupDataSource_basic (38.65s)

--- PASS: TestAccAWSAvailabilityZones_AllAvailabilityZones (23.55s)
--- PASS: TestAccAWSAvailabilityZones_basic (23.40s)
--- PASS: TestAccAWSAvailabilityZones_ExcludeNames (14.32s)
--- PASS: TestAccAWSAvailabilityZones_ExcludeZoneIds (24.34s)
--- PASS: TestAccAWSAvailabilityZones_Filter (23.32s)
--- PASS: TestAccAWSAvailabilityZones_stateFilter (23.23s)

--- PASS: TestAccAWSDbEventCategories_basic (15.76s)
--- PASS: TestAccAWSDbEventCategories_sourceType (14.71s)

--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_Filter (23.91s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_LocationType (24.65s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingDataSource_PreferredInstanceTypes (23.58s)

--- PASS: TestAccAWSEcrAuthorizationTokenDataSource_basic (23.96s)

--- PASS: TestAccAWSEcrDataSource_ecrImage (24.22s)

--- PASS: TestAccAWSEksClusterAuthDataSource_basic (19.59s)

--- PASS: TestAccDataSourceAwsEBSDefaultKmsKey_basic (20.11s)

--- PASS: TestAccDataSourceAwsEBSEncryptionByDefault_basic (23.26s)

--- PASS: TestAccDataSourceAwsKmsAlias_AwsService (24.27s)
--- PASS: TestAccDataSourceAwsKmsAlias_CMK (28.03s)

--- PASS: TestAccDataSourceAwsRegions_AllRegions (23.30s)
--- PASS: TestAccDataSourceAwsRegions_basic (23.44s)
--- PASS: TestAccDataSourceAwsRegions_Filter (22.16s)

--- PASS: TestAccDataSourceAwsSnsTopic_basic (26.41s)
```
@samsullivan
Copy link

AWS provider v3.10.0 fixed this as the changelog suggested; updating from v2.70.0, I had to manually modify my state to remove some blacklisted_* properties. Nothing too difficult, though!

@jurgenweber
Copy link
Contributor

jurgenweber commented Oct 15, 2020

it has not fixed everything. For example aws_kms_secrets still has the issue.

@sgrimm
Copy link

sgrimm commented Oct 15, 2020

I'm seeing this with aws_route_tables on provider v3.10.0. This is in a brand-new Terraform project that has never used an older provider version.

Terraform will perform the following actions:

  # module.internal_peering.data.aws_route_tables.requestor[0] will be read during apply
  # (config refers to values not yet known)
 <= data "aws_route_tables" "requestor"  {
      ~ id     = "terraform-20201015222743753200000002" -> "terraform-20201015222746318200000001"
        ids    = [
            ...
        ]
        vpc_id = "vpc-XXX"
    }

Plan: 0 to add, 0 to change, 0 to destroy.

@eirc
Copy link

eirc commented Oct 19, 2020

Is there something we can do about this if we're on 2.x version of the provider? We upgraded TF to 0.13 and all seemed fine until this hit. Upgrading the provider's major version was not something we expected the TF upgrade to depend on.

EDIT: It appears I was mistaken, it was another bug that looked like this and confused me. We eventually upgraded everything successfully though. Sorry for this.

@jurgenweber
Copy link
Contributor

jurgenweber commented Oct 21, 2020

not sure how to get my PR looked at, could use some +1's on it and we solve another resource with this problem!

@bflad bflad changed the title Data sources with non-deterministic IDs show perpetual diff with Terraform 0.13 Data sources with non-deterministic IDs show perpetual diff with Terraform 0.13 (R015, R016, R017 linters) Oct 28, 2020
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Oct 28, 2020
@bflad bflad added linter Pertains to changes to or issues with the various linters. and removed service/ec2 Issues and PRs that pertain to the ec2 service. labels Oct 28, 2020
bflad added a commit that referenced this issue Oct 28, 2020
…able R015, R016, R017 linters

Reference: #14579

Changes:

* data-source/aws_autoscaling_groups: Prevent plan differences with the `id` attribute
* data-source/aws_caller_identity: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_snapshot_ids: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_volumes: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_coip_pools: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_instance_type_offerings: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateway_route_tables: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateway_virtual_interface_groups: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateways: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_spot_price: Prevent plan differences with the `id` attribute
* data-source/aws_efs_access_points: Prevent plan differences with the `id` attribute
* data-source/aws_glue_script: Prevent plan differences with the `id` attribute
* data-source/aws_inspector_rules_packages: Prevent plan differences with the `id` attribute
* data-source/aws_instances: Prevent plan differences with the `id` attribute
* data-source/aws_kms_ciphertext: Prevent plan differences with the `id` attribute
* data-source/aws_network_acls: Prevent plan differences with the `id` attribute
* data-source/aws_network_interfaces: Prevent plan differences with the `id` attribute
* data-source/aws_organizations_organizational_units: Prevent plan differences with the `id` attribute
* data-source/aws_outposts_outposts: Prevent plan differences with the `id` attribute
* data-source/aws_outposts_sites: Prevent plan differences with the `id` attribute
* data-source/aws_route_tables: Prevent plan differences with the `id` attribute
* data-source/aws_route53_resolver_rules: Prevent plan differences with the `id` attribute
* data-source/aws_s3_bucket_objects: Prevent plan differences with the `id` attribute
* data-source/aws_security_groups: Prevent plan differences with the `id` attribute
* data-source/aws_vpc_peering_connections: Prevent plan differences with the `id` attribute
* data-source/aws_vpcs: Prevent plan differences with the `id` attribute

Output from acceptance testing:

```
Pending
```
bflad added a commit that referenced this issue Oct 29, 2020
…able R015, R016, R017 linters

Reference: #14579

Changes:

* data-source/aws_autoscaling_groups: Prevent plan differences with the `id` attribute
* data-source/aws_caller_identity: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_snapshot_ids: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_volumes: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_coip_pools: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_instance_type_offerings: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateway_route_tables: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateway_virtual_interface_groups: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateways: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_spot_price: Prevent plan differences with the `id` attribute
* data-source/aws_efs_access_points: Prevent plan differences with the `id` attribute
* data-source/aws_glue_script: Prevent plan differences with the `id` attribute
* data-source/aws_inspector_rules_packages: Prevent plan differences with the `id` attribute
* data-source/aws_instances: Prevent plan differences with the `id` attribute
* data-source/aws_kms_ciphertext: Prevent plan differences with the `id` attribute
* data-source/aws_network_acls: Prevent plan differences with the `id` attribute
* data-source/aws_network_interfaces: Prevent plan differences with the `id` attribute
* data-source/aws_organizations_organizational_units: Prevent plan differences with the `id` attribute
* data-source/aws_outposts_outposts: Prevent plan differences with the `id` attribute
* data-source/aws_outposts_sites: Prevent plan differences with the `id` attribute
* data-source/aws_route_tables: Prevent plan differences with the `id` attribute
* data-source/aws_route53_resolver_rules: Prevent plan differences with the `id` attribute
* data-source/aws_s3_bucket_objects: Prevent plan differences with the `id` attribute
* data-source/aws_security_groups: Prevent plan differences with the `id` attribute
* data-source/aws_vpc_peering_connections: Prevent plan differences with the `id` attribute
* data-source/aws_vpcs: Prevent plan differences with the `id` attribute

Output from acceptance testing:

```
--- PASS: TestAccAWSAutoscalingAttachment_albTargetGroup (111.36s)
--- PASS: TestAccAWSAutoscalingAttachment_elb (118.66s)

--- PASS: TestAccAWSAutoscalingGroups_basic (162.22s)

--- PASS: TestAccAWSCallerIdentity_basic (55.69s)

--- PASS: TestAccAWSEBSEncryptionByDefault_basic (52.71s)

--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter (57.28s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType (58.79s)

--- PASS: TestAccAwsEc2SpotPriceDataSource_basic (54.47s)
--- PASS: TestAccAwsEc2SpotPriceDataSource_Filter (59.40s)

--- PASS: TestAccAWSELBAttachment_basic (185.93s)
--- PASS: TestAccAWSELBAttachment_drift (113.04s)

--- PASS: TestAccAWSInspectorRulesPackages_basic (58.00s)

--- PASS: TestAccAWSInstancesDataSource_basic (137.19s)
--- PASS: TestAccAWSInstancesDataSource_instance_state_names (122.56s)
--- PASS: TestAccAWSInstancesDataSource_tags (120.98s)

--- PASS: TestAccDataSourceAwsEbsSnapshotIds_basic (92.82s)
--- PASS: TestAccDataSourceAwsEbsSnapshotIds_empty (57.58s)
--- PASS: TestAccDataSourceAwsEbsSnapshotIds_sorted (195.34s)

--- PASS: TestAccDataSourceAwsEbsVolumes_basic (178.56s)

--- PASS: TestAccDataSourceAWSEFSAccessPoints_basic (71.87s)

--- PASS: TestAccDataSourceAWSGlueScript_Language_Python (57.14s)
--- PASS: TestAccDataSourceAWSGlueScript_Language_Scala (57.67s)

--- PASS: TestAccDataSourceAwsKmsCiphertext_basic (61.22s)
--- PASS: TestAccDataSourceAwsKmsCiphertext_validate (60.99s)
--- PASS: TestAccDataSourceAwsKmsCiphertext_validate_withContext (60.77s)

--- PASS: TestAccDataSourceAwsNetworkAcls_basic (112.54s)
--- PASS: TestAccDataSourceAwsNetworkAcls_Filter (62.55s)
--- PASS: TestAccDataSourceAwsNetworkAcls_Tags (58.95s)
--- PASS: TestAccDataSourceAwsNetworkAcls_VpcID (60.22s)

--- PASS: TestAccDataSourceAwsNetworkInterfaces_Filter (95.49s)
--- PASS: TestAccDataSourceAwsNetworkInterfaces_Tags (97.05s)

--- PASS: TestAccDataSourceAwsRoute53ResolverRules_basic (57.40s)
--- PASS: TestAccDataSourceAwsRoute53ResolverRules_ResolverEndpointId (264.98s)

--- PASS: TestAccDataSourceAwsRouteTables_basic (120.92s)

--- PASS: TestAccDataSourceAWSS3BucketObjects_all (120.73s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_basic (122.61s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_basicViaAccessPoint (122.87s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_encoded (115.55s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_fetchOwner (102.52s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_maxKeys (100.50s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_prefixes (117.61s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_startAfter (102.55s)

--- PASS: TestAccDataSourceAwsSecurityGroups_filter (70.25s)
--- PASS: TestAccDataSourceAwsSecurityGroups_tag (68.53s)

--- PASS: TestAccDataSourceAwsVpcPeeringConnections_basic (70.67s)

--- PASS: TestAccDataSourceAwsVpcs_basic (65.12s)
--- PASS: TestAccDataSourceAwsVpcs_filters (56.35s)
--- PASS: TestAccDataSourceAwsVpcs_tags (58.15s)

--- SKIP: TestAccAWSOutpostsOutpostsDataSource_basic (2.12s)

--- SKIP: TestAccAWSOutpostsSitesDataSource_basic (1.42s)

--- SKIP: TestAccDataSourceAwsEc2CoipPools_basic (15.89s)
--- SKIP: TestAccDataSourceAwsEc2CoipPools_Filter (14.35s)

--- SKIP: TestAccDataSourceAwsEc2LocalGatewayRouteTables_basic (14.72s)
--- SKIP: TestAccDataSourceAwsEc2LocalGatewayRouteTables_Filter (2.24s)

--- SKIP: TestAccDataSourceAwsEc2LocalGateways_basic (2.51s)

--- SKIP: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (3.57s)
--- SKIP: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (2.13s)
--- SKIP: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Tags (1.99s)
```
@bflad bflad added this to the v3.13.0 milestone Oct 29, 2020
bflad added a commit that referenced this issue Oct 29, 2020
…able R015, R016, R017 linters (#15896)

* provider: Stabilization of remaining data source id attributes and enable R015, R016, R017 linters

Reference: #14579

Changes:

* data-source/aws_autoscaling_groups: Prevent plan differences with the `id` attribute
* data-source/aws_caller_identity: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_snapshot_ids: Prevent plan differences with the `id` attribute
* data-source/aws_ebs_volumes: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_coip_pools: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_instance_type_offerings: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateway_route_tables: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateway_virtual_interface_groups: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_local_gateways: Prevent plan differences with the `id` attribute
* data-source/aws_ec2_spot_price: Prevent plan differences with the `id` attribute
* data-source/aws_efs_access_points: Prevent plan differences with the `id` attribute
* data-source/aws_glue_script: Prevent plan differences with the `id` attribute
* data-source/aws_inspector_rules_packages: Prevent plan differences with the `id` attribute
* data-source/aws_instances: Prevent plan differences with the `id` attribute
* data-source/aws_kms_ciphertext: Prevent plan differences with the `id` attribute
* data-source/aws_network_acls: Prevent plan differences with the `id` attribute
* data-source/aws_network_interfaces: Prevent plan differences with the `id` attribute
* data-source/aws_organizations_organizational_units: Prevent plan differences with the `id` attribute
* data-source/aws_outposts_outposts: Prevent plan differences with the `id` attribute
* data-source/aws_outposts_sites: Prevent plan differences with the `id` attribute
* data-source/aws_route_tables: Prevent plan differences with the `id` attribute
* data-source/aws_route53_resolver_rules: Prevent plan differences with the `id` attribute
* data-source/aws_s3_bucket_objects: Prevent plan differences with the `id` attribute
* data-source/aws_security_groups: Prevent plan differences with the `id` attribute
* data-source/aws_vpc_peering_connections: Prevent plan differences with the `id` attribute
* data-source/aws_vpcs: Prevent plan differences with the `id` attribute

Output from acceptance testing:

```
--- PASS: TestAccAWSAutoscalingAttachment_albTargetGroup (111.36s)
--- PASS: TestAccAWSAutoscalingAttachment_elb (118.66s)

--- PASS: TestAccAWSAutoscalingGroups_basic (162.22s)

--- PASS: TestAccAWSCallerIdentity_basic (55.69s)

--- PASS: TestAccAWSEBSEncryptionByDefault_basic (52.71s)

--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter (57.28s)
--- PASS: TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType (58.79s)

--- PASS: TestAccAwsEc2SpotPriceDataSource_basic (54.47s)
--- PASS: TestAccAwsEc2SpotPriceDataSource_Filter (59.40s)

--- PASS: TestAccAWSELBAttachment_basic (185.93s)
--- PASS: TestAccAWSELBAttachment_drift (113.04s)

--- PASS: TestAccAWSInspectorRulesPackages_basic (58.00s)

--- PASS: TestAccAWSInstancesDataSource_basic (137.19s)
--- PASS: TestAccAWSInstancesDataSource_instance_state_names (122.56s)
--- PASS: TestAccAWSInstancesDataSource_tags (120.98s)

--- PASS: TestAccDataSourceAwsEbsSnapshotIds_basic (92.82s)
--- PASS: TestAccDataSourceAwsEbsSnapshotIds_empty (57.58s)
--- PASS: TestAccDataSourceAwsEbsSnapshotIds_sorted (195.34s)

--- PASS: TestAccDataSourceAwsEbsVolumes_basic (178.56s)

--- PASS: TestAccDataSourceAWSEFSAccessPoints_basic (71.87s)

--- PASS: TestAccDataSourceAWSGlueScript_Language_Python (57.14s)
--- PASS: TestAccDataSourceAWSGlueScript_Language_Scala (57.67s)

--- PASS: TestAccDataSourceAwsKmsCiphertext_basic (61.22s)
--- PASS: TestAccDataSourceAwsKmsCiphertext_validate (60.99s)
--- PASS: TestAccDataSourceAwsKmsCiphertext_validate_withContext (60.77s)

--- PASS: TestAccDataSourceAwsNetworkAcls_basic (112.54s)
--- PASS: TestAccDataSourceAwsNetworkAcls_Filter (62.55s)
--- PASS: TestAccDataSourceAwsNetworkAcls_Tags (58.95s)
--- PASS: TestAccDataSourceAwsNetworkAcls_VpcID (60.22s)

--- PASS: TestAccDataSourceAwsNetworkInterfaces_Filter (95.49s)
--- PASS: TestAccDataSourceAwsNetworkInterfaces_Tags (97.05s)

--- PASS: TestAccDataSourceAwsRoute53ResolverRules_basic (57.40s)
--- PASS: TestAccDataSourceAwsRoute53ResolverRules_ResolverEndpointId (264.98s)

--- PASS: TestAccDataSourceAwsRouteTables_basic (120.92s)

--- PASS: TestAccDataSourceAWSS3BucketObjects_all (120.73s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_basic (122.61s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_basicViaAccessPoint (122.87s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_encoded (115.55s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_fetchOwner (102.52s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_maxKeys (100.50s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_prefixes (117.61s)
--- PASS: TestAccDataSourceAWSS3BucketObjects_startAfter (102.55s)

--- PASS: TestAccDataSourceAwsSecurityGroups_filter (70.25s)
--- PASS: TestAccDataSourceAwsSecurityGroups_tag (68.53s)

--- PASS: TestAccDataSourceAwsVpcPeeringConnections_basic (70.67s)

--- PASS: TestAccDataSourceAwsVpcs_basic (65.12s)
--- PASS: TestAccDataSourceAwsVpcs_filters (56.35s)
--- PASS: TestAccDataSourceAwsVpcs_tags (58.15s)

--- SKIP: TestAccAWSOutpostsOutpostsDataSource_basic (2.12s)

--- SKIP: TestAccAWSOutpostsSitesDataSource_basic (1.42s)

--- SKIP: TestAccDataSourceAwsEc2CoipPools_basic (15.89s)
--- SKIP: TestAccDataSourceAwsEc2CoipPools_Filter (14.35s)

--- SKIP: TestAccDataSourceAwsEc2LocalGatewayRouteTables_basic (14.72s)
--- SKIP: TestAccDataSourceAwsEc2LocalGatewayRouteTables_Filter (2.24s)

--- SKIP: TestAccDataSourceAwsEc2LocalGateways_basic (2.51s)

--- SKIP: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic (3.57s)
--- SKIP: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter (2.13s)
--- SKIP: TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Tags (1.99s)
```

* Apply suggestions from code review

Co-authored-by: angie pinilla <[email protected]>

Co-authored-by: angie pinilla <[email protected]>
@bflad
Copy link
Contributor

bflad commented Oct 29, 2020

Hi folks 👋 The remaining data sources with clear id attributes issues have been adjusted and will release with version 3.13.0 of the Terraform AWS Provider, likely later today. Please see the CHANGELOG for specifics on how they were updated.

If you are still having problems with perpetual differences in data sources after that release, please file a separate GitHub issue for each data source as each cause may be different. Thanks!

@ghost
Copy link

ghost commented Oct 29, 2020

This has been released in version 3.13.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@juliosantos
Copy link

If you are still having problems with perpetual differences in data sources after that release

Just filed #16239. Seeing a similar issue with aws_iam_policy_document and aws_kms_key.

@jurgenweber
Copy link
Contributor

I am using 'aws_iam_policy_document' currently without issue, I had some problems here hashicorp/terraform#26899 with v14 though.

@ghost
Copy link

ghost commented Nov 29, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. linter Pertains to changes to or issues with the various linters. provider Pertains to the provider itself, rather than any interaction with AWS. upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet