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

tests/data-source/aws_acm_certificate: Update tests to be self-contained #17404

Closed
bflad opened this issue Feb 2, 2021 · 3 comments
Closed
Labels
service/acm Issues and PRs that pertain to the acm service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@bflad
Copy link
Contributor

bflad commented Feb 2, 2021

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

Description

Currently these two acceptance tests require manually created ACM certificates to exist based on environment variable:

=== CONT  TestAccAWSAcmCertificateDataSource_singleIssued
data_source_aws_acm_certificate_test.go:38: Step 1/6 error: Error running pre-apply refresh:
Error: No certificate for domain "tf-acc-single-issued.--OMITTED--" found in this region
--- FAIL: TestAccAWSAcmCertificateDataSource_singleIssued (11.71s)

=== CONT  TestAccAWSAcmCertificateDataSource_multipleIssued
data_source_aws_acm_certificate_test.go:110: Step 1/6, expected an error with pattern, no match on: Error running pre-apply refresh:
Error: No certificate for domain "tf-acc-multiple-issued.--OMITTED--" found in this region
--- FAIL: TestAccAWSAcmCertificateDataSource_multipleIssued (10.56s)

The test configurations should be updated to be self-contained, which means each of these should be using the aws_acm_certificate resource as well.

Affected Resource(s)

  • aws_acm_certificate
@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/acm Issues and PRs that pertain to the acm service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Feb 2, 2021
@bflad bflad added this to the Roadmap milestone Feb 2, 2021
@yuonoda
Copy link
Contributor

yuonoda commented Feb 15, 2021

Hi @bflad ,

I am thinking to work on this issue and have one question. Even if you use "aws_acm_certificate" for this test, a publically accessible domain should be specified in the environment variable, right? Is it ok or is there any solution that doesn't need a registered domain?

bflad added a commit that referenced this issue Feb 19, 2021
… conversion functions during conditionals

Reference: #12992

This work is being done in chunks to reduce review burden. Avoiding `aws_route` and `aws_route_table` data sources due to large pull requests pending review.

Previously:

```
aws/data_source_aws_acm_certificate.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
86:			if *cert.DomainName == target {
--------------------------------------------------------------------------------
128:				if *certificate.Type == *certType {
--------------------------------------------------------------------------------
188:	if *i.Status != *j.Status {
--------------------------------------------------------------------------------
192:	if *i.Status == acm.CertificateStatusIssued {

aws/data_source_aws_ami_ids.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
85:			if image.Name == nil || *image.Name == "" {

aws/data_source_aws_api_gateway_rest_api.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
151:			if *item.Path == "/" {

aws/data_source_aws_cloudfront_cache_policy.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
176:		if *policySummary.CachePolicy.CachePolicyConfig.Name == d.Get("name").(string) {

aws/data_source_aws_cloudfront_origin_request_policy.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
151:		if *policySummary.OriginRequestPolicy.OriginRequestPolicyConfig.Name == d.Get("name").(string) {

aws/data_source_aws_ebs_default_kms_key_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
47:		if attr != *actual.KmsKeyId {

aws/data_source_aws_ebs_encryption_by_default_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
48:		if attr != *actual.EbsEncryptionByDefault {

aws/data_source_aws_elasticache_cluster.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
190:		if *cluster.NotificationConfiguration.TopicStatus == "active" {

aws/data_source_aws_iam_server_certificate_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
32:	if *certs[0].ServerCertificateName != "latest" {

aws/data_source_aws_instance.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
391:			if instance.State != nil && *instance.State.Name != "terminated" {
--------------------------------------------------------------------------------
478:			if *ni.Attachment.DeviceIndex == 0 {
--------------------------------------------------------------------------------
500:	if instance.SubnetId != nil && *instance.SubnetId != "" {

aws/data_source_aws_kms_alias.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
46:			if *entity.AliasName == target {

aws/data_source_aws_lb_listener.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
286:		if *listener.Port == int64(port.(int)) {

aws/data_source_aws_nat_gateway.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
133:		if *address.AllocationId != "" {

aws/data_source_aws_sfn_state_machine.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
55:			if *sm.Name == target {

aws/data_source_aws_ssm_patch_baseline.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
85:			if v.(string) == *baseline.OperatingSystem {

aws/data_source_aws_subnet.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
178:		if *a.Ipv6CidrBlockState.State == "associated" { //we can only ever have 1 IPv6 block associated at once

aws/data_source_aws_workspaces_image_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
70:		if *resp.Images[0].ImageId != rs.Primary.ID {
```

Output from acceptance testing:

```
--- FAIL: TestAccAWSAcmCertificateDataSource_multipleIssued (2.76s) # #17404
--- FAIL: TestAccAWSAcmCertificateDataSource_singleIssued (9.02s) # #17404
--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (22.58s)
--- PASS: TestAccAWSAcmCertificateDataSource_noMatchReturnsError (14.61s)

--- PASS: TestAccAWSCloudFrontDataSourceCachePolicy_basic (20.71s)

--- PASS: TestAccAWSCloudFrontDataSourceOriginRequestPolicy_basic (18.62s)

--- PASS: TestAccAWSDataElasticacheCluster_basic (690.01s)

--- PASS: TestAccAWSInstanceDataSource_AzUserData (89.39s)
--- PASS: TestAccAWSInstanceDataSource_basic (105.68s)
--- PASS: TestAccAWSInstanceDataSource_blockDevices (109.08s)
--- PASS: TestAccAWSInstanceDataSource_blockDeviceTags (111.04s)
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (92.40s)
--- PASS: TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId (111.12s)
--- PASS: TestAccAWSInstanceDataSource_enclaveOptions (119.23s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (169.44s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (200.88s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData (178.11s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData_NoUserData (174.80s)
--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (100.39s)
--- PASS: TestAccAWSInstanceDataSource_gp3ThroughputDevice (87.80s)
--- PASS: TestAccAWSInstanceDataSource_keyPair (89.11s)
--- PASS: TestAccAWSInstanceDataSource_metadataOptions (130.64s)
--- PASS: TestAccAWSInstanceDataSource_PlacementGroup (82.19s)
--- PASS: TestAccAWSInstanceDataSource_privateIP (92.96s)
--- PASS: TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId (135.66s)
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (90.25s)
--- PASS: TestAccAWSInstanceDataSource_secondaryPrivateIPs (93.10s)
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (103.29s)
--- PASS: TestAccAWSInstanceDataSource_tags (98.98s)
--- PASS: TestAccAWSInstanceDataSource_VPC (109.26s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (105.95s)

--- PASS: TestAccAWSSsmPatchBaselineDataSource_existingBaseline (19.45s)
--- PASS: TestAccAWSSsmPatchBaselineDataSource_newBaseline (22.38s)

--- PASS: TestAccDataSourceAwsAmiIds_basic (16.91s)
--- PASS: TestAccDataSourceAwsAmiIds_sorted (37.67s)

--- PASS: TestAccDataSourceAwsApiGatewayRestApi_basic (16.62s)
--- PASS: TestAccDataSourceAwsApiGatewayRestApi_EndpointConfiguration_VpcEndpointIds (200.16s)

--- PASS: TestAccDataSourceAwsEBSDefaultKmsKey_basic (19.55s)

--- PASS: TestAccDataSourceAwsEBSEncryptionByDefault_basic (10.56s)

--- PASS: TestAccDataSourceAwsKmsAlias_AwsService (12.84s)
--- PASS: TestAccDataSourceAwsKmsAlias_CMK (19.43s)

--- PASS: TestAccDataSourceAWSLBListener_BackwardsCompatibility (196.24s)
--- PASS: TestAccDataSourceAWSLBListener_basic (186.19s)
--- PASS: TestAccDataSourceAWSLBListener_DefaultAction_Forward (183.04s)
--- PASS: TestAccDataSourceAWSLBListener_https (187.24s)

--- PASS: TestAccDataSourceAwsNatGateway_basic (208.03s)

--- PASS: TestAccDataSourceAwsSfnStateMachine_basic (49.83s)

--- PASS: TestAccDataSourceAwsSubnet_basic (34.58s)
--- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6CidrBlock (58.30s)
--- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter (85.44s)

--- SKIP: TestAccDataSourceAwsWorkspacesImage_basic (0.76s)
```
bflad added a commit that referenced this issue Feb 25, 2021
… conversion functions during conditionals

Reference: #12992

This work is being done in chunks to reduce review burden. Avoiding `aws_route` and `aws_route_table` data sources due to large pull requests pending review.

Previously:

```
aws/data_source_aws_acm_certificate.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
86:			if *cert.DomainName == target {
--------------------------------------------------------------------------------
128:				if *certificate.Type == *certType {
--------------------------------------------------------------------------------
188:	if *i.Status != *j.Status {
--------------------------------------------------------------------------------
192:	if *i.Status == acm.CertificateStatusIssued {

aws/data_source_aws_ami_ids.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
85:			if image.Name == nil || *image.Name == "" {

aws/data_source_aws_api_gateway_rest_api.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
151:			if *item.Path == "/" {

aws/data_source_aws_cloudfront_cache_policy.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
176:		if *policySummary.CachePolicy.CachePolicyConfig.Name == d.Get("name").(string) {

aws/data_source_aws_cloudfront_origin_request_policy.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
151:		if *policySummary.OriginRequestPolicy.OriginRequestPolicyConfig.Name == d.Get("name").(string) {

aws/data_source_aws_ebs_default_kms_key_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
47:		if attr != *actual.KmsKeyId {

aws/data_source_aws_ebs_encryption_by_default_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
48:		if attr != *actual.EbsEncryptionByDefault {

aws/data_source_aws_elasticache_cluster.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
190:		if *cluster.NotificationConfiguration.TopicStatus == "active" {

aws/data_source_aws_iam_server_certificate_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
32:	if *certs[0].ServerCertificateName != "latest" {

aws/data_source_aws_instance.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
391:			if instance.State != nil && *instance.State.Name != "terminated" {
--------------------------------------------------------------------------------
478:			if *ni.Attachment.DeviceIndex == 0 {
--------------------------------------------------------------------------------
500:	if instance.SubnetId != nil && *instance.SubnetId != "" {

aws/data_source_aws_kms_alias.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
46:			if *entity.AliasName == target {

aws/data_source_aws_lb_listener.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
286:		if *listener.Port == int64(port.(int)) {

aws/data_source_aws_nat_gateway.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
133:		if *address.AllocationId != "" {

aws/data_source_aws_sfn_state_machine.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
55:			if *sm.Name == target {

aws/data_source_aws_ssm_patch_baseline.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
85:			if v.(string) == *baseline.OperatingSystem {

aws/data_source_aws_subnet.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
178:		if *a.Ipv6CidrBlockState.State == "associated" { //we can only ever have 1 IPv6 block associated at once

aws/data_source_aws_workspaces_image_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
70:		if *resp.Images[0].ImageId != rs.Primary.ID {
```

Output from acceptance testing:

```
--- FAIL: TestAccAWSAcmCertificateDataSource_multipleIssued (2.76s) # #17404
--- FAIL: TestAccAWSAcmCertificateDataSource_singleIssued (9.02s) # #17404
--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (22.58s)
--- PASS: TestAccAWSAcmCertificateDataSource_noMatchReturnsError (14.61s)

--- PASS: TestAccAWSCloudFrontDataSourceCachePolicy_basic (20.71s)

--- PASS: TestAccAWSCloudFrontDataSourceOriginRequestPolicy_basic (18.62s)

--- PASS: TestAccAWSDataElasticacheCluster_basic (690.01s)

--- PASS: TestAccAWSInstanceDataSource_AzUserData (89.39s)
--- PASS: TestAccAWSInstanceDataSource_basic (105.68s)
--- PASS: TestAccAWSInstanceDataSource_blockDevices (109.08s)
--- PASS: TestAccAWSInstanceDataSource_blockDeviceTags (111.04s)
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (92.40s)
--- PASS: TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId (111.12s)
--- PASS: TestAccAWSInstanceDataSource_enclaveOptions (119.23s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (169.44s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (200.88s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData (178.11s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData_NoUserData (174.80s)
--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (100.39s)
--- PASS: TestAccAWSInstanceDataSource_gp3ThroughputDevice (87.80s)
--- PASS: TestAccAWSInstanceDataSource_keyPair (89.11s)
--- PASS: TestAccAWSInstanceDataSource_metadataOptions (130.64s)
--- PASS: TestAccAWSInstanceDataSource_PlacementGroup (82.19s)
--- PASS: TestAccAWSInstanceDataSource_privateIP (92.96s)
--- PASS: TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId (135.66s)
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (90.25s)
--- PASS: TestAccAWSInstanceDataSource_secondaryPrivateIPs (93.10s)
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (103.29s)
--- PASS: TestAccAWSInstanceDataSource_tags (98.98s)
--- PASS: TestAccAWSInstanceDataSource_VPC (109.26s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (105.95s)

--- PASS: TestAccAWSSsmPatchBaselineDataSource_existingBaseline (19.45s)
--- PASS: TestAccAWSSsmPatchBaselineDataSource_newBaseline (22.38s)

--- PASS: TestAccDataSourceAwsAmiIds_basic (16.91s)
--- PASS: TestAccDataSourceAwsAmiIds_sorted (37.67s)

--- PASS: TestAccDataSourceAwsApiGatewayRestApi_basic (16.62s)
--- PASS: TestAccDataSourceAwsApiGatewayRestApi_EndpointConfiguration_VpcEndpointIds (200.16s)

--- PASS: TestAccDataSourceAwsEBSDefaultKmsKey_basic (19.55s)

--- PASS: TestAccDataSourceAwsEBSEncryptionByDefault_basic (10.56s)

--- PASS: TestAccDataSourceAwsKmsAlias_AwsService (12.84s)
--- PASS: TestAccDataSourceAwsKmsAlias_CMK (19.43s)

--- PASS: TestAccDataSourceAWSLBListener_BackwardsCompatibility (196.24s)
--- PASS: TestAccDataSourceAWSLBListener_basic (186.19s)
--- PASS: TestAccDataSourceAWSLBListener_DefaultAction_Forward (183.04s)
--- PASS: TestAccDataSourceAWSLBListener_https (187.24s)

--- PASS: TestAccDataSourceAwsNatGateway_basic (208.03s)

--- PASS: TestAccDataSourceAwsSfnStateMachine_basic (49.83s)

--- PASS: TestAccDataSourceAwsSubnet_basic (34.58s)
--- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6CidrBlock (58.30s)
--- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter (85.44s)

--- SKIP: TestAccDataSourceAwsWorkspacesImage_basic (0.76s)
```
bflad added a commit that referenced this issue Mar 5, 2021
… conversion functions during conditionals (#17718)

Reference: #12992

This work is being done in chunks to reduce review burden. Avoiding `aws_route` and `aws_route_table` data sources due to large pull requests pending review.

Previously:

```
aws/data_source_aws_acm_certificate.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
86:			if *cert.DomainName == target {
--------------------------------------------------------------------------------
128:				if *certificate.Type == *certType {
--------------------------------------------------------------------------------
188:	if *i.Status != *j.Status {
--------------------------------------------------------------------------------
192:	if *i.Status == acm.CertificateStatusIssued {

aws/data_source_aws_ami_ids.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
85:			if image.Name == nil || *image.Name == "" {

aws/data_source_aws_api_gateway_rest_api.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
151:			if *item.Path == "/" {

aws/data_source_aws_cloudfront_cache_policy.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
176:		if *policySummary.CachePolicy.CachePolicyConfig.Name == d.Get("name").(string) {

aws/data_source_aws_cloudfront_origin_request_policy.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
151:		if *policySummary.OriginRequestPolicy.OriginRequestPolicyConfig.Name == d.Get("name").(string) {

aws/data_source_aws_ebs_default_kms_key_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
47:		if attr != *actual.KmsKeyId {

aws/data_source_aws_ebs_encryption_by_default_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
48:		if attr != *actual.EbsEncryptionByDefault {

aws/data_source_aws_elasticache_cluster.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
190:		if *cluster.NotificationConfiguration.TopicStatus == "active" {

aws/data_source_aws_iam_server_certificate_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
32:	if *certs[0].ServerCertificateName != "latest" {

aws/data_source_aws_instance.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
391:			if instance.State != nil && *instance.State.Name != "terminated" {
--------------------------------------------------------------------------------
478:			if *ni.Attachment.DeviceIndex == 0 {
--------------------------------------------------------------------------------
500:	if instance.SubnetId != nil && *instance.SubnetId != "" {

aws/data_source_aws_kms_alias.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
46:			if *entity.AliasName == target {

aws/data_source_aws_lb_listener.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
286:		if *listener.Port == int64(port.(int)) {

aws/data_source_aws_nat_gateway.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
133:		if *address.AllocationId != "" {

aws/data_source_aws_sfn_state_machine.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
55:			if *sm.Name == target {

aws/data_source_aws_ssm_patch_baseline.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
85:			if v.(string) == *baseline.OperatingSystem {

aws/data_source_aws_subnet.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
178:		if *a.Ipv6CidrBlockState.State == "associated" { //we can only ever have 1 IPv6 block associated at once

aws/data_source_aws_workspaces_image_test.go
severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue()
70:		if *resp.Images[0].ImageId != rs.Primary.ID {
```

Output from acceptance testing:

```
--- FAIL: TestAccAWSAcmCertificateDataSource_multipleIssued (2.76s) # #17404
--- FAIL: TestAccAWSAcmCertificateDataSource_singleIssued (9.02s) # #17404
--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (22.58s)
--- PASS: TestAccAWSAcmCertificateDataSource_noMatchReturnsError (14.61s)

--- PASS: TestAccAWSCloudFrontDataSourceCachePolicy_basic (20.71s)

--- PASS: TestAccAWSCloudFrontDataSourceOriginRequestPolicy_basic (18.62s)

--- PASS: TestAccAWSDataElasticacheCluster_basic (690.01s)

--- PASS: TestAccAWSInstanceDataSource_AzUserData (89.39s)
--- PASS: TestAccAWSInstanceDataSource_basic (105.68s)
--- PASS: TestAccAWSInstanceDataSource_blockDevices (109.08s)
--- PASS: TestAccAWSInstanceDataSource_blockDeviceTags (111.04s)
--- PASS: TestAccAWSInstanceDataSource_creditSpecification (92.40s)
--- PASS: TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId (111.12s)
--- PASS: TestAccAWSInstanceDataSource_enclaveOptions (119.23s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_falseToTrue (169.44s)
--- PASS: TestAccAWSInstanceDataSource_getPasswordData_trueToFalse (200.88s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData (178.11s)
--- PASS: TestAccAWSInstanceDataSource_GetUserData_NoUserData (174.80s)
--- PASS: TestAccAWSInstanceDataSource_gp2IopsDevice (100.39s)
--- PASS: TestAccAWSInstanceDataSource_gp3ThroughputDevice (87.80s)
--- PASS: TestAccAWSInstanceDataSource_keyPair (89.11s)
--- PASS: TestAccAWSInstanceDataSource_metadataOptions (130.64s)
--- PASS: TestAccAWSInstanceDataSource_PlacementGroup (82.19s)
--- PASS: TestAccAWSInstanceDataSource_privateIP (92.96s)
--- PASS: TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId (135.66s)
--- PASS: TestAccAWSInstanceDataSource_rootInstanceStore (90.25s)
--- PASS: TestAccAWSInstanceDataSource_secondaryPrivateIPs (93.10s)
--- PASS: TestAccAWSInstanceDataSource_SecurityGroups (103.29s)
--- PASS: TestAccAWSInstanceDataSource_tags (98.98s)
--- PASS: TestAccAWSInstanceDataSource_VPC (109.26s)
--- PASS: TestAccAWSInstanceDataSource_VPCSecurityGroups (105.95s)

--- PASS: TestAccAWSSsmPatchBaselineDataSource_existingBaseline (19.45s)
--- PASS: TestAccAWSSsmPatchBaselineDataSource_newBaseline (22.38s)

--- PASS: TestAccDataSourceAwsAmiIds_basic (16.91s)
--- PASS: TestAccDataSourceAwsAmiIds_sorted (37.67s)

--- PASS: TestAccDataSourceAwsApiGatewayRestApi_basic (16.62s)
--- PASS: TestAccDataSourceAwsApiGatewayRestApi_EndpointConfiguration_VpcEndpointIds (200.16s)

--- PASS: TestAccDataSourceAwsEBSDefaultKmsKey_basic (19.55s)

--- PASS: TestAccDataSourceAwsEBSEncryptionByDefault_basic (10.56s)

--- PASS: TestAccDataSourceAwsKmsAlias_AwsService (12.84s)
--- PASS: TestAccDataSourceAwsKmsAlias_CMK (19.43s)

--- PASS: TestAccDataSourceAWSLBListener_BackwardsCompatibility (196.24s)
--- PASS: TestAccDataSourceAWSLBListener_basic (186.19s)
--- PASS: TestAccDataSourceAWSLBListener_DefaultAction_Forward (183.04s)
--- PASS: TestAccDataSourceAWSLBListener_https (187.24s)

--- PASS: TestAccDataSourceAwsNatGateway_basic (208.03s)

--- PASS: TestAccDataSourceAwsSfnStateMachine_basic (49.83s)

--- PASS: TestAccDataSourceAwsSubnet_basic (34.58s)
--- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6CidrBlock (58.30s)
--- PASS: TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter (85.44s)

--- SKIP: TestAccDataSourceAwsWorkspacesImage_basic (0.76s)
```
@breathingdust breathingdust removed this from the Roadmap milestone Nov 10, 2021
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Dec 26, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2024
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/acm Issues and PRs that pertain to the acm service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

No branches or pull requests

3 participants