Skip to content

Commit 9d9bcbd

Browse files
authored
provider: Stabilization of singular data source id attributes with clear 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) ```
1 parent afafdbf commit 9d9bcbd

30 files changed

+40
-43
lines changed

aws/data_source_aws_acm_certificate.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package aws
33
import (
44
"fmt"
55
"log"
6-
"time"
76

87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/service/acm"
@@ -169,7 +168,7 @@ func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) e
169168
return fmt.Errorf("No certificate for domain %q found in this region", target)
170169
}
171170

172-
d.SetId(time.Now().UTC().String())
171+
d.SetId(aws.StringValue(matchedCertificate.CertificateArn))
173172
d.Set("arn", matchedCertificate.CertificateArn)
174173

175174
tags, err := keyvaluetags.AcmListTags(conn, aws.StringValue(matchedCertificate.CertificateArn))

aws/data_source_aws_autoscaling_group.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package aws
33
import (
44
"fmt"
55
"log"
6-
"time"
76

87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/service/autoscaling"
@@ -105,7 +104,6 @@ func dataSourceAwsAutoscalingGroup() *schema.Resource {
105104

106105
func dataSourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) error {
107106
conn := meta.(*AWSClient).autoscalingconn
108-
d.SetId(time.Now().UTC().String())
109107

110108
groupName := d.Get("name").(string)
111109

@@ -142,13 +140,7 @@ func dataSourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{})
142140

143141
log.Printf("[DEBUG] aws_autoscaling_group - Single Auto Scaling Group found: %s", *group.AutoScalingGroupName)
144142

145-
err1 := groupDescriptionAttributes(d, group)
146-
return err1
147-
}
148-
149-
// Populate group attribute fields with the returned group
150-
func groupDescriptionAttributes(d *schema.ResourceData, group *autoscaling.Group) error {
151-
log.Printf("[DEBUG] Setting attributes: %s", group)
143+
d.SetId(aws.StringValue(group.AutoScalingGroupName))
152144
d.Set("name", group.AutoScalingGroupName)
153145
d.Set("arn", group.AutoScalingGroupARN)
154146
if err := d.Set("availability_zones", aws.StringValueSlice(group.AvailabilityZones)); err != nil {

aws/data_source_aws_availability_zones.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"log"
66
"sort"
7-
"time"
87

98
"github.com/aws/aws-sdk-go/aws"
109
"github.com/aws/aws-sdk-go/service/ec2"
@@ -65,7 +64,6 @@ func dataSourceAwsAvailabilityZonesRead(d *schema.ResourceData, meta interface{}
6564
conn := meta.(*AWSClient).ec2conn
6665

6766
log.Printf("[DEBUG] Reading Availability Zones.")
68-
d.SetId(time.Now().UTC().String())
6967

7068
request := &ec2.DescribeAvailabilityZonesInput{}
7169

@@ -130,6 +128,8 @@ func dataSourceAwsAvailabilityZonesRead(d *schema.ResourceData, meta interface{}
130128
zoneIds = append(zoneIds, zoneID)
131129
}
132130

131+
d.SetId(meta.(*AWSClient).region)
132+
133133
if err := d.Set("group_names", groupNames); err != nil {
134134
return fmt.Errorf("error setting group_names: %s", err)
135135
}

aws/data_source_aws_db_event_categories.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66

77
"github.com/aws/aws-sdk-go/aws"
88
"github.com/aws/aws-sdk-go/service/rds"
9-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
109
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1110
)
1211

@@ -56,7 +55,7 @@ func dataSourceAwsDbEventCategoriesRead(d *schema.ResourceData, meta interface{}
5655
}
5756
}
5857

59-
d.SetId(resource.UniqueId())
58+
d.SetId(meta.(*AWSClient).region)
6059
if err := d.Set("event_categories", eventCategories); err != nil {
6160
return fmt.Errorf("Error setting Event Categories: %s", err)
6261
}

aws/data_source_aws_ebs_default_kms_key.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package aws
22

33
import (
44
"fmt"
5-
"time"
65

76
"github.com/aws/aws-sdk-go/service/ec2"
87
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -28,7 +27,7 @@ func dataSourceAwsEbsDefaultKmsKeyRead(d *schema.ResourceData, meta interface{})
2827
return fmt.Errorf("Error reading EBS default KMS key: %q", err)
2928
}
3029

31-
d.SetId(time.Now().UTC().String())
30+
d.SetId(meta.(*AWSClient).region)
3231
d.Set("key_arn", res.KmsKeyId)
3332

3433
return nil

aws/data_source_aws_ebs_encryption_by_default.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package aws
22

33
import (
44
"fmt"
5-
"time"
65

76
"github.com/aws/aws-sdk-go/service/ec2"
87
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -28,7 +27,7 @@ func dataSourceAwsEbsEncryptionByDefaultRead(d *schema.ResourceData, meta interf
2827
return fmt.Errorf("Error reading default EBS encryption toggle: %q", err)
2928
}
3029

31-
d.SetId(time.Now().UTC().String())
30+
d.SetId(meta.(*AWSClient).region)
3231
d.Set("enabled", res.EbsEncryptionByDefault)
3332

3433
return nil

aws/data_source_aws_ec2_instance_type_offering.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/aws/aws-sdk-go/aws"
77
"github.com/aws/aws-sdk-go/service/ec2"
8-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
98
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
109
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1110
)
@@ -122,7 +121,7 @@ func dataSourceAwsEc2InstanceTypeOfferingRead(d *schema.ResourceData, meta inter
122121

123122
d.Set("instance_type", resultInstanceType)
124123

125-
d.SetId(resource.UniqueId())
124+
d.SetId(resultInstanceType)
126125

127126
return nil
128127
}

aws/data_source_aws_ecr_authorization_token.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func dataSourceAwsEcrAuthorizationTokenRead(d *schema.ResourceData, meta interfa
7474
}
7575
userName := basicAuthorization[0]
7676
password := basicAuthorization[1]
77-
d.SetId(time.Now().UTC().String())
77+
d.SetId(meta.(*AWSClient).region)
7878
d.Set("authorization_token", authorizationToken)
7979
d.Set("proxy_endpoint", proxyEndpoint)
8080
d.Set("expires_at", expiresAt)

aws/data_source_aws_ecr_image.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package aws
33
import (
44
"fmt"
55
"log"
6-
"time"
76

87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/service/ecr"
@@ -98,7 +97,7 @@ func dataSourceAwsEcrImageRead(d *schema.ResourceData, meta interface{}) error {
9897

9998
image := imageDetails[0]
10099

101-
d.SetId(time.Now().UTC().String())
100+
d.SetId(aws.StringValue(image.ImageDigest))
102101
if err = d.Set("registry_id", aws.StringValue(image.RegistryId)); err != nil {
103102
return fmt.Errorf("failed to set registry_id: %s", err)
104103
}

aws/data_source_aws_eks_cluster_auth.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package aws
22

33
import (
44
"fmt"
5-
"time"
65

76
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
87
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
@@ -41,7 +40,7 @@ func dataSourceAwsEksClusterAuthRead(d *schema.ResourceData, meta interface{}) e
4140
return fmt.Errorf("error getting token: %v", err)
4241
}
4342

44-
d.SetId(time.Now().UTC().String())
43+
d.SetId(name)
4544
d.Set("token", token.Token)
4645

4746
return nil

aws/data_source_aws_iam_account_alias.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package aws
33
import (
44
"fmt"
55
"log"
6-
"time"
76

87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/service/iam"
@@ -27,7 +26,6 @@ func dataSourceAwsIamAccountAliasRead(d *schema.ResourceData, meta interface{})
2726
conn := meta.(*AWSClient).iamconn
2827

2928
log.Printf("[DEBUG] Reading IAM Account Aliases.")
30-
d.SetId(time.Now().UTC().String())
3129

3230
req := &iam.ListAccountAliasesInput{}
3331
resp, err := conn.ListAccountAliases(req)
@@ -41,6 +39,7 @@ func dataSourceAwsIamAccountAliasRead(d *schema.ResourceData, meta interface{})
4139
}
4240

4341
alias := aws.StringValue(resp.AccountAliases[0])
42+
d.SetId(alias)
4443
log.Printf("[DEBUG] Setting AWS IAM Account Alias to %s.", alias)
4544
d.Set("account_alias", alias)
4645

aws/data_source_aws_kms_alias.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package aws
33
import (
44
"fmt"
55
"log"
6-
"time"
76

87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/service/kms"
@@ -60,7 +59,7 @@ func dataSourceAwsKmsAliasRead(d *schema.ResourceData, meta interface{}) error {
6059
return fmt.Errorf("No alias with name %q found in this region.", target)
6160
}
6261

63-
d.SetId(time.Now().UTC().String())
62+
d.SetId(aws.StringValue(alias.AliasArn))
6463
d.Set("arn", alias.AliasArn)
6564

6665
// ListAliases can return an alias for an AWS service key (e.g.

aws/data_source_aws_partition.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package aws
22

33
import (
44
"log"
5-
"time"
65

76
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
87
)
@@ -28,7 +27,7 @@ func dataSourceAwsPartitionRead(d *schema.ResourceData, meta interface{}) error
2827
client := meta.(*AWSClient)
2928

3029
log.Printf("[DEBUG] Reading Partition.")
31-
d.SetId(time.Now().UTC().String())
30+
d.SetId(meta.(*AWSClient).partition)
3231

3332
log.Printf("[DEBUG] Setting AWS Partition to %s.", client.partition)
3433
d.Set("partition", meta.(*AWSClient).partition)

aws/data_source_aws_regions.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package aws
33
import (
44
"fmt"
55
"log"
6-
"time"
76

87
"github.com/aws/aws-sdk-go/aws"
98
"github.com/aws/aws-sdk-go/service/ec2"
@@ -53,7 +52,7 @@ func dataSourceAwsRegionsRead(d *schema.ResourceData, meta interface{}) error {
5352
names = append(names, aws.StringValue(v.RegionName))
5453
}
5554

56-
d.SetId(time.Now().UTC().String())
55+
d.SetId(meta.(*AWSClient).partition)
5756
if err := d.Set("names", names); err != nil {
5857
return fmt.Errorf("error setting names: %s", err)
5958
}

aws/data_source_aws_sns.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"log"
66
"regexp"
7-
"time"
87

98
"github.com/aws/aws-sdk-go/service/sns"
109
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -65,7 +64,7 @@ func dataSourceAwsSnsTopicsRead(d *schema.ResourceData, meta interface{}) error
6564
return fmt.Errorf("Multiple topics with name %q found in this region.", target)
6665
}
6766

68-
d.SetId(time.Now().UTC().String())
67+
d.SetId(arns[0])
6968
d.Set("arn", arns[0])
7069

7170
return nil

website/docs/d/acm_certificate.html.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ data "aws_acm_certificate" "rsa_4096" {
4747

4848
## Attributes Reference
4949

50-
* `arn` - Set to the ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
50+
* `arn` - Amazon Resource Name (ARN) of the found certificate, suitable for referencing in other resources that support ACM certificates.
51+
* `id` - Amazon Resource Name (ARN) of the found certificate, suitable for referencing in other resources that support ACM certificates.
5152
* `tags` - A mapping of tags for the resource.
5253

website/docs/d/autoscaling_group.html.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ data "aws_autoscaling_group" "foo" {
2828
interpolation.
2929

3030
* `arn` - The Amazon Resource Name (ARN) of the Auto Scaling group.
31-
* `name` - The name of the Auto Scaling group.
3231
* `availability_zones` - One or more Availability Zones for the group.
3332
* `default_cool_down` - The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.
3433
* `desired_capacity` - The desired size of the group.
3534
* `health_check_grace_period` - The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service.
3635
* `health_check_type` - The service to use for the health checks. The valid values are EC2 and ELB.
36+
* `id` - Name of the Auto Scaling Group.
3737
* `launch_configuration` - The name of the associated launch configuration.
3838
* `load_balancers` - One or more load balancers associated with the group.
3939
* `max_size` - The maximum size of the group.
4040
* `min_size` - The minimum size of the group.
41+
* `name` - Name of the Auto Scaling Group.
4142
* `placement_group` - The name of the placement group into which to launch your instances, if any. For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in the Amazon Elastic Compute Cloud User Guide.
4243
* `service_linked_role_arn` - The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS services on your behalf.
4344
* `status` - The current state of the group when DeleteAutoScalingGroup is in progress.

website/docs/d/availability_zones.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ The following arguments are supported by the `filter` configuration block:
9393
In addition to all arguments above, the following attributes are exported:
9494

9595
* `group_names` A set of the Availability Zone Group names. For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example `us-west-2-lax-1`.
96+
* `id` - Region of the Availability Zones.
9697
* `names` - A list of the Availability Zone names available to the account.
9798
* `zone_ids` - A list of the Availability Zone IDs available to the account.
9899

website/docs/d/db_event_categories.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ The following arguments are supported:
4343
In addition to all arguments above, the following attributes are exported:
4444

4545
* `event_categories` - A list of the event categories.
46+
* `id` - Region of the event categories.

website/docs/d/ebs_default_kms_key.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ resource "aws_ebs_volume" "example" {
2828
The following attributes are exported:
2929

3030
* `key_arn` - Amazon Resource Name (ARN) of the default KMS key uses to encrypt an EBS volume in this region when no key is specified in an API call that creates the volume and encryption by default is enabled.
31+
* `id` - Region of the default KMS Key.

website/docs/d/ebs_encryption_by_default.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ data "aws_ebs_encryption_by_default" "current" {}
2121
The following attributes are exported:
2222

2323
* `enabled` - Whether or not default EBS encryption is enabled. Returns as `true` or `false`.
24+
* `id` - Region of default EBS encryption.

website/docs/d/ec2_instance_type_offering.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ The following arguments are supported:
4040

4141
In addition to all arguments above, the following attributes are exported:
4242

43+
* `id` - EC2 Instance Type.
4344
* `instance_type` - EC2 Instance Type.

website/docs/d/ecr_authorization_token.html.markdown

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ The following arguments are supported:
2828
In addition to the argument above, the following attributes are exported:
2929

3030
* `authorization_token` - Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of `user_name:password`.
31-
* `proxy_endpoint` - The registry URL to use in the docker login command.
3231
* `expires_at` - The time in UTC RFC3339 format when the authorization token expires.
33-
* `user_name` - User name decoded from the authorization token.
32+
* `id` - Region of the authorization token.
3433
* `password` - Password decoded from the authorization token.
34+
* `proxy_endpoint` - The registry URL to use in the docker login command.
35+
* `user_name` - User name decoded from the authorization token.

website/docs/d/ecr_image.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The following arguments are supported:
3232

3333
In addition to all arguments above, the following attributes are exported:
3434

35+
* `id` - SHA256 digest of the image manifest.
3536
* `image_pushed_at` - The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
3637
* `image_size_in_bytes` - The size, in bytes, of the image in the repository.
3738
* `image_tags` - The list of tags associated with this image.

website/docs/d/eks_cluster_auth.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ provider "kubernetes" {
4040

4141
## Attributes Reference
4242

43+
* `id` - Name of the cluster.
4344
* `token` - The token to use to authenticate with the cluster.

website/docs/d/iam_account_alias.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ There are no arguments available for this data source.
3131
In addition to all arguments above, the following attributes are exported:
3232

3333
* `account_alias` - The alias associated with the AWS account.
34+
* `id` - The alias associated with the AWS account.

website/docs/d/kms_alias.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ data "aws_kms_alias" "s3" {
2727
## Attributes Reference
2828

2929
* `arn` - The Amazon Resource Name(ARN) of the key alias.
30+
* `id` - The Amazon Resource Name(ARN) of the key alias.
3031
* `target_key_id` - Key identifier pointed to by the alias.
3132
* `target_key_arn` - ARN pointed to by the alias.

website/docs/d/partition.html.markdown

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ There are no arguments available for this data source.
3737

3838
## Attributes Reference
3939

40-
* `partition` is set to the identifier of the current partition.
41-
* `dns_suffix` is set to the base DNS domain name for the current partition (e.g. `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China).
40+
* `dns_suffix` - Base DNS domain name for the current partition (e.g. `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China).
41+
* `id` - Identifier of the current partition (e.g. `aws` in AWS Commercial, `aws-cn` in AWS China).
42+
* `partition` - Identifier of the current partition (e.g. `aws` in AWS Commercial, `aws-cn` in AWS China).

website/docs/d/regions.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ The following arguments are supported by the `filter` configuration block:
5858

5959
In addition to all arguments above, the following attributes are exported:
6060

61+
* `id` - Identifier of the current partition (e.g. `aws` in AWS Commercial, `aws-cn` in AWS China).
6162
* `names` - Names of regions that meets the criteria.
6263

6364
[1]: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-regions.html

website/docs/d/sns_topic.html.markdown

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ data "aws_sns_topic" "example" {
2626

2727
## Attributes Reference
2828

29-
* `arn` - Set to the ARN of the found topic, suitable for referencing in other resources that support SNS topics.
29+
In addition to all arguments above, the following attributes are exported:
30+
31+
* `arn` - Amazon Resource Name (ARN) of the found topic, suitable for referencing in other resources that support SNS topics.
32+
* `id` - Amazon Resource Name (ARN) of the found topic, suitable for referencing in other resources that support SNS topics.

0 commit comments

Comments
 (0)