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

Fix and enable tfproviderlint R002 check: Remove extraneous dereferences in Set() calls #9952

Closed
ryndaniels opened this issue Sep 2, 2019 · 2 comments · Fixed by #12033
Closed
Assignees
Labels
linter Pertains to changes to or issues with the various linters. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Milestone

Comments

@ryndaniels
Copy link
Contributor

ryndaniels commented Sep 2, 2019

Description

As per tfproviderlint check R002, we want to remove extraneous * dereferences to Set() calls, since Set() automatically handles pointers and the extra * without a nil check can cause a panic.

Failing example:

var stringPtr *string

d.Set("example", *stringPtr)

Should become:

var stringPtr *string

d.Set("example", stringPtr)

Definition of Done

  • In GNUmakefile, add -R002 to tfproviderlint command under lint target and have TravisCI testing pass
@ryndaniels ryndaniels added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Sep 2, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 2, 2019
@ryndaniels ryndaniels removed the needs-triage Waiting for first response or review from a maintainer. label Sep 2, 2019
@ryndaniels ryndaniels changed the title Remove extraneous dereferences in Set() calls in acceptance tests Remove extraneous dereferences in Set() calls Sep 2, 2019
@ryndaniels ryndaniels removed the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Sep 2, 2019
@bflad bflad changed the title Remove extraneous dereferences in Set() calls Fix and enable tfproviderlint R002 check: Remove extraneous dereferences in Set() calls Feb 3, 2020
bflad added a commit that referenced this issue Feb 3, 2020
Gaps in `tfproviderlint` checking are covered by the following issues:

Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #9954 (fix and enable R004)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
bflad added a commit that referenced this issue Feb 4, 2020
Gaps in `tfproviderlint` checking are covered by the following issues:

Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #9954 (fix and enable R004)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
@bflad bflad self-assigned this Feb 5, 2020
bflad added a commit that referenced this issue Feb 5, 2020
Reference: #9952

Remove extraneous pointer value dereferences, which cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/data_source_aws_iam_server_certificate.go:142:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/data_source_aws_iam_server_certificate.go:143:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/data_source_aws_iam_server_certificate.go:144:16: R002: ResourceData.Set() pointer value dereference is extraneous
```

Also removes extraneous time conversion function.

Output from acceptance testing:

```
--- PASS: TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix (4.36s)
--- PASS: TestAccAWSDataSourceIAMServerCertificate_basic (16.79s)
--- PASS: TestAccAWSDataSourceIAMServerCertificate_path (17.37s)
```
bflad added a commit that referenced this issue Feb 5, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_cloudwatch_log_destination_policy.go:77:26: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cloudwatch_log_resource_policy.go:77:27: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSCloudwatchLogDestinationPolicy_basic (86.97s)

--- PASS: TestAccAWSCloudWatchLogResourcePolicy_basic (31.10s)
```
bflad added a commit that referenced this issue Feb 6, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_cognito_user_pool.go:735:39: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:738:39: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:744:30: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:747:37: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:750:39: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool_client.go:251:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool_client.go:252:16: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSCognitoUserPool_basic (18.30s)
--- PASS: TestAccAWSCognitoUserPool_withSmsVerificationMessage (28.18s)
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (28.85s)
--- PASS: TestAccAWSCognitoUserPool_withAliasAttributes (29.04s)
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (29.21s)
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (29.96s)
--- PASS: TestAccAWSCognitoUserPool_withSchemaAttributes (31.11s)
--- PASS: TestAccAWSCognitoUserPool_withVerificationMessageTemplate (33.36s)
--- PASS: TestAccAWSCognitoUserPool_withSmsConfiguration (35.03s)
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (40.00s)
--- PASS: TestAccAWSCognitoUserPool_withAdvancedSecurityMode (40.10s)
--- PASS: TestAccAWSCognitoUserPool_withTags (40.97s)
--- PASS: TestAccAWSCognitoUserPool_withSmsConfigurationUpdated (41.73s)
--- PASS: TestAccAWSCognitoUserPool_update (59.53s)
--- PASS: TestAccAWSCognitoUserPool_withLambdaConfig (63.83s)

--- PASS: TestAccAWSCognitoUserPoolClient_allFields (18.90s)
--- PASS: TestAccAWSCognitoUserPoolClient_basic (19.22s)
--- PASS: TestAccAWSCognitoUserPoolClient_Name (31.13s)
--- PASS: TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField (31.62s)
--- PASS: TestAccAWSCognitoUserPoolClient_RefreshTokenValidity (31.99s)
```
bflad added a commit that referenced this issue Feb 6, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_elastic_transcoder_pipeline.go:427:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:430:28: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:447:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:448:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:457:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:474:26: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:352:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:491:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:504:21: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:505:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:506:23: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:515:16: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSElasticTranscoderPipeline_withPermissions (31.86s)
--- PASS: TestAccAWSElasticTranscoderPipeline_basic (34.73s)
--- PASS: TestAccAWSElasticTranscoderPipeline_withContentConfig (51.48s)
--- PASS: TestAccAWSElasticTranscoderPipeline_kmsKey (53.26s)
--- PASS: TestAccAWSElasticTranscoderPipeline_notifications (74.85s)

--- PASS: TestAccAWSElasticTranscoderPreset_basic (39.61s)
```
bflad added a commit that referenced this issue Feb 6, 2020
…R002

Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_elastic_beanstalk_environment.go:592:26: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSBeanstalkEnv_resource (374.31s)
--- PASS: TestAccAWSBeanstalkEnv_cname_prefix (396.88s)
--- PASS: TestAccAWSBeanstalkEnv_platformArn (407.51s)
--- PASS: TestAccAWSBeanstalkEnv_basic (470.63s)
--- PASS: TestAccAWSBeanstalkEnv_settingWithJsonValue (510.72s)
--- PASS: TestAccAWSBeanstalkEnv_tier (539.81s)
--- PASS: TestAccAWSBeanstalkEnv_config (573.89s)
--- PASS: TestAccAWSBeanstalkEnv_template_change (637.28s)
--- PASS: TestAccAWSBeanstalkEnv_version_label (640.37s)
--- PASS: TestAccAWSBeanstalkEnv_tags (711.19s)
--- PASS: TestAccAWSBeanstalkEnv_settings_update (890.65s)
```
bflad added a commit that referenced this issue Feb 6, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_glacier_vault.go:105:20: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSGlacierVault_basic (22.38s)
--- PASS: TestAccAWSGlacierVault_full (26.27s)
--- PASS: TestAccAWSGlacierVault_RemoveNotifications (38.22s)
```
bflad added a commit that referenced this issue Feb 6, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_route_table_association.go:118:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_route_table_association.go:121:25: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_security_group_rule.go:762:38: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_security_group_rule.go:764:38: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_spot_instance_request.go:267:27: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_spot_instance_request.go:270:29: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_vpn_gateway.go:111:19: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_vpn_gateway_attachment.go:109:18: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSRouteTableAssociation_disappears (45.48s)
--- PASS: TestAccAWSRouteTableAssociation_Gateway_basic (49.52s)
--- PASS: TestAccAWSRouteTableAssociation_Subnet_basic (50.05s)
--- PASS: TestAccAWSRouteTableAssociation_Subnet_ChangeSubnet (66.29s)
--- PASS: TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable (68.18s)
--- PASS: TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable (72.08s)
--- PASS: TestAccAWSRouteTableAssociation_Gateway_ChangeGateway (84.97s)

--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidTypeError (2.06s)
--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidCIDR (2.32s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_VPC (24.60s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription (25.25s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Classic (25.41s)
--- PASS: TestAccAWSSecurityGroupRule_Issue5310 (26.12s)
--- PASS: TestAccAWSSecurityGroupRule_MultiIngress (26.15s)
--- PASS: TestAccAWSSecurityGroupRule_MultipleRuleSearching_AllProtocolCrash (26.33s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription (24.08s)
--- PASS: TestAccAWSSecurityGroupRule_Egress (27.56s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription_updates (34.23s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts (36.67s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts (37.03s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription_updates (34.98s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Ipv6 (37.73s)
--- PASS: TestAccAWSSecurityGroupRule_SelfSource (38.09s)
--- PASS: TestAccAWSSecurityGroupRule_SelfReference (38.82s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Protocol (39.77s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_Source (41.93s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_basic (46.51s)
--- PASS: TestAccAWSSecurityGroupRule_PrefixListEgress (46.06s)
--- PASS: TestAccAWSSecurityGroupRule_MultiDescription (90.18s)
--- PASS: TestAccAWSSecurityGroupRule_Race (258.80s)

--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (83.19s)
--- PASS: TestAccAWSSpotInstanceRequest_basic (83.78s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (102.73s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (104.39s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (104.43s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (115.07s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (125.03s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (136.48s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (266.98s)

--- PASS: TestAccAWSVpnGateway_disappears (45.89s)
--- PASS: TestAccAWSVpnGateway_withAmazonSideAsnSetToState (48.07s)
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (57.53s)
--- PASS: TestAccAWSVpnGateway_tags (66.51s)
--- PASS: TestAccAWSVpnGateway_delete (73.68s)
--- PASS: TestAccAWSVpnGateway_basic (97.77s)
--- PASS: TestAccAWSVpnGateway_reattach (137.08s)

--- PASS: TestAccAWSVpnGatewayAttachment_basic (51.22s)
--- PASS: TestAccAWSVpnGatewayAttachment_deleted (67.20s)
```
bflad added a commit that referenced this issue Feb 13, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_iot_certificate.go:77:23: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_iot_certificate.go:78:24: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSIoTCertificate_keys_certificate (14.29s)
--- PASS: TestAccAWSIoTCertificate_csr (14.85s)
```
bflad added a commit that referenced this issue Feb 13, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_iam_saml_provider.go:91:34: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSIAMSamlProvider_basic (22.26s)
```
bflad added a commit that referenced this issue Feb 13, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_opsworks_stack.go:328:38: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSOpsworksStack_noVpcBasic (36.09s)
--- PASS: TestAccAWSOpsworksStack_noVpcCreateTags (46.83s)
--- PASS: TestAccAWSOpsworksStack_CustomCookbooks_SetPrivateProperties (40.27s)
--- PASS: TestAccAWSOpsworksStack_vpc (64.43s)
--- PASS: TestAccAWSOpsworksStack_noVpcChangeServiceRoleForceNew (43.03s)
```
bflad added a commit that referenced this issue Feb 13, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_ses_receipt_rule.go:450:19: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_ses_receipt_rule.go:452:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_ses_receipt_rule.go:453:22: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSSESReceiptRule_actions (18.64s)
--- PASS: TestAccAWSSESReceiptRule_basic (19.07s)
--- PASS: TestAccAWSSESReceiptRule_order (22.13s)
--- PASS: TestAccAWSSESReceiptRule_s3Action (36.32s)
```
bflad added a commit that referenced this issue Feb 13, 2020
Reference: #9952

Previously:

```
aws/resource_aws_sns_platform_application.go:230:18: R002: ResourceData.Set() pointer value dereference is extraneous
```

We are unable to acceptance test the `aws_sns_platform_application` resource as it requires an active Apple Developer subscription and application, however this final refactor is trivial.
bflad added a commit that referenced this issue Feb 19, 2020
Reference: #12074

Gaps in `tfproviderlint`/`awsproviderlint` checking are covered by the following issues:

Reference: #11888 (fix and enable AWSAT001)
Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #12083 (fix and enable R007, R008)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
bflad added a commit that referenced this issue Feb 21, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_ses_receipt_rule.go:450:19: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_ses_receipt_rule.go:452:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_ses_receipt_rule.go:453:22: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSSESReceiptRule_actions (18.64s)
--- PASS: TestAccAWSSESReceiptRule_basic (19.07s)
--- PASS: TestAccAWSSESReceiptRule_order (22.13s)
--- PASS: TestAccAWSSESReceiptRule_s3Action (36.32s)
```
bflad added a commit that referenced this issue Feb 21, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_route53_record.go:587:55: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSRoute53Record_Alias_Elb (211.82s)
--- PASS: TestAccAWSRoute53Record_Alias_S3 (160.72s)
--- PASS: TestAccAWSRoute53Record_Alias_Uppercase (123.68s)
--- PASS: TestAccAWSRoute53Record_Alias_VpcEndpoint (487.77s)
--- PASS: TestAccAWSRoute53Record_AliasChange (248.01s)
--- PASS: TestAccAWSRoute53Record_allowOverwrite (182.93s)
--- PASS: TestAccAWSRoute53Record_basic (207.48s)
--- PASS: TestAccAWSRoute53Record_basic_fqdn (226.89s)
--- PASS: TestAccAWSRoute53Record_caaSupport (147.38s)
--- PASS: TestAccAWSRoute53Record_disappears (131.77s)
--- PASS: TestAccAWSRoute53Record_disappears_MultipleRecords (224.92s)
--- PASS: TestAccAWSRoute53Record_empty (190.97s)
--- PASS: TestAccAWSRoute53Record_failover (212.86s)
--- PASS: TestAccAWSRoute53Record_generatesSuffix (147.38s)
--- PASS: TestAccAWSRoute53Record_geolocation_basic (227.35s)
--- PASS: TestAccAWSRoute53Record_latency_basic (148.07s)
--- PASS: TestAccAWSRoute53Record_longTXTrecord (206.77s)
--- PASS: TestAccAWSRoute53Record_multivalue_answer_basic (230.61s)
--- PASS: TestAccAWSRoute53Record_SetIdentifierChange (257.14s)
--- PASS: TestAccAWSRoute53Record_spfSupport (134.89s)
--- PASS: TestAccAWSRoute53Record_txtSupport (153.41s)
--- PASS: TestAccAWSRoute53Record_TypeChange (174.50s)
--- PASS: TestAccAWSRoute53Record_underscored (126.59s)
--- PASS: TestAccAWSRoute53Record_weighted_alias (258.50s)
--- PASS: TestAccAWSRoute53Record_weighted_basic (253.20s)
--- PASS: TestAccAWSRoute53Record_weighted_to_simple_basic (227.46s)
--- PASS: TestAccAWSRoute53Record_wildcard (283.88s)
```
bflad added a commit that referenced this issue Feb 21, 2020
…2030)

Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_proxy_protocol_policy.go:97:25: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSProxyProtocolPolicy_basic (40.77s)
```
bflad added a commit that referenced this issue Feb 21, 2020
…12029)

Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`. Also adds missing EC2-Classic PreCheck to acceptance testing.

Previously:

```
aws/resource_aws_redshift_security_group.go:151:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_redshift_security_group.go:152:23: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSRedshiftSecurityGroup_basic (11.89s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressCidr (12.79s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup (13.09s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressCidr (25.35s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup (28.94s)
```
bflad added a commit that referenced this issue Feb 21, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_iam_saml_provider.go:91:34: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSIAMSamlProvider_basic (22.26s)
```
bflad added a commit that referenced this issue Feb 21, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_iot_certificate.go:77:23: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_iot_certificate.go:78:24: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSIoTCertificate_keys_certificate (14.29s)
--- PASS: TestAccAWSIoTCertificate_csr (14.85s)
```
bflad added a commit that referenced this issue Feb 21, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_glacier_vault.go:105:20: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSGlacierVault_basic (22.38s)
--- PASS: TestAccAWSGlacierVault_full (26.27s)
--- PASS: TestAccAWSGlacierVault_RemoveNotifications (38.22s)
```
bflad added a commit that referenced this issue Feb 26, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_route_table_association.go:118:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_route_table_association.go:121:25: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_security_group_rule.go:762:38: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_security_group_rule.go:764:38: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_spot_instance_request.go:267:27: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_spot_instance_request.go:270:29: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_vpn_gateway.go:111:19: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_vpn_gateway_attachment.go:109:18: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSRouteTableAssociation_disappears (45.48s)
--- PASS: TestAccAWSRouteTableAssociation_Gateway_basic (49.52s)
--- PASS: TestAccAWSRouteTableAssociation_Subnet_basic (50.05s)
--- PASS: TestAccAWSRouteTableAssociation_Subnet_ChangeSubnet (66.29s)
--- PASS: TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable (68.18s)
--- PASS: TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable (72.08s)
--- PASS: TestAccAWSRouteTableAssociation_Gateway_ChangeGateway (84.97s)

--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidTypeError (2.06s)
--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidCIDR (2.32s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_VPC (24.60s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription (25.25s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Classic (25.41s)
--- PASS: TestAccAWSSecurityGroupRule_Issue5310 (26.12s)
--- PASS: TestAccAWSSecurityGroupRule_MultiIngress (26.15s)
--- PASS: TestAccAWSSecurityGroupRule_MultipleRuleSearching_AllProtocolCrash (26.33s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription (24.08s)
--- PASS: TestAccAWSSecurityGroupRule_Egress (27.56s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription_updates (34.23s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts (36.67s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts (37.03s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription_updates (34.98s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Ipv6 (37.73s)
--- PASS: TestAccAWSSecurityGroupRule_SelfSource (38.09s)
--- PASS: TestAccAWSSecurityGroupRule_SelfReference (38.82s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Protocol (39.77s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_Source (41.93s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_basic (46.51s)
--- PASS: TestAccAWSSecurityGroupRule_PrefixListEgress (46.06s)
--- PASS: TestAccAWSSecurityGroupRule_MultiDescription (90.18s)
--- PASS: TestAccAWSSecurityGroupRule_Race (258.80s)

--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (83.19s)
--- PASS: TestAccAWSSpotInstanceRequest_basic (83.78s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (102.73s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (104.39s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (104.43s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (115.07s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (125.03s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (136.48s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (266.98s)

--- PASS: TestAccAWSVpnGateway_disappears (45.89s)
--- PASS: TestAccAWSVpnGateway_withAmazonSideAsnSetToState (48.07s)
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (57.53s)
--- PASS: TestAccAWSVpnGateway_tags (66.51s)
--- PASS: TestAccAWSVpnGateway_delete (73.68s)
--- PASS: TestAccAWSVpnGateway_basic (97.77s)
--- PASS: TestAccAWSVpnGateway_reattach (137.08s)

--- PASS: TestAccAWSVpnGatewayAttachment_basic (51.22s)
--- PASS: TestAccAWSVpnGatewayAttachment_deleted (67.20s)
```
bflad added a commit that referenced this issue Feb 26, 2020
…R002 (#11945)

Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_elastic_beanstalk_environment.go:592:26: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSBeanstalkEnv_resource (374.31s)
--- PASS: TestAccAWSBeanstalkEnv_cname_prefix (396.88s)
--- PASS: TestAccAWSBeanstalkEnv_platformArn (407.51s)
--- PASS: TestAccAWSBeanstalkEnv_basic (470.63s)
--- PASS: TestAccAWSBeanstalkEnv_settingWithJsonValue (510.72s)
--- PASS: TestAccAWSBeanstalkEnv_tier (539.81s)
--- PASS: TestAccAWSBeanstalkEnv_config (573.89s)
--- PASS: TestAccAWSBeanstalkEnv_template_change (637.28s)
--- PASS: TestAccAWSBeanstalkEnv_version_label (640.37s)
--- PASS: TestAccAWSBeanstalkEnv_tags (711.19s)
--- PASS: TestAccAWSBeanstalkEnv_settings_update (890.65s)
```
bflad added a commit that referenced this issue Feb 26, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_elastic_transcoder_pipeline.go:427:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:430:28: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:447:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:448:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:457:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_pipeline.go:474:26: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:352:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:491:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:504:21: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:505:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:506:23: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_elastic_transcoder_preset.go:515:16: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSElasticTranscoderPipeline_withPermissions (31.86s)
--- PASS: TestAccAWSElasticTranscoderPipeline_basic (34.73s)
--- PASS: TestAccAWSElasticTranscoderPipeline_withContentConfig (51.48s)
--- PASS: TestAccAWSElasticTranscoderPipeline_kmsKey (53.26s)
--- PASS: TestAccAWSElasticTranscoderPipeline_notifications (74.85s)

--- PASS: TestAccAWSElasticTranscoderPreset_basic (39.61s)
```
bflad added a commit that referenced this issue Feb 26, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_cognito_user_pool.go:735:39: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:738:39: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:744:30: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:747:37: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool.go:750:39: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool_client.go:251:24: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cognito_user_pool_client.go:252:16: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSCognitoUserPool_basic (18.30s)
--- PASS: TestAccAWSCognitoUserPool_withSmsVerificationMessage (28.18s)
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (28.85s)
--- PASS: TestAccAWSCognitoUserPool_withAliasAttributes (29.04s)
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (29.21s)
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (29.96s)
--- PASS: TestAccAWSCognitoUserPool_withSchemaAttributes (31.11s)
--- PASS: TestAccAWSCognitoUserPool_withVerificationMessageTemplate (33.36s)
--- PASS: TestAccAWSCognitoUserPool_withSmsConfiguration (35.03s)
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (40.00s)
--- PASS: TestAccAWSCognitoUserPool_withAdvancedSecurityMode (40.10s)
--- PASS: TestAccAWSCognitoUserPool_withTags (40.97s)
--- PASS: TestAccAWSCognitoUserPool_withSmsConfigurationUpdated (41.73s)
--- PASS: TestAccAWSCognitoUserPool_update (59.53s)
--- PASS: TestAccAWSCognitoUserPool_withLambdaConfig (63.83s)

--- PASS: TestAccAWSCognitoUserPoolClient_allFields (18.90s)
--- PASS: TestAccAWSCognitoUserPoolClient_basic (19.22s)
--- PASS: TestAccAWSCognitoUserPoolClient_Name (31.13s)
--- PASS: TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField (31.62s)
--- PASS: TestAccAWSCognitoUserPoolClient_RefreshTokenValidity (31.99s)
```
bflad added a commit that referenced this issue Feb 26, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_cloudwatch_log_destination_policy.go:77:26: R002: ResourceData.Set() pointer value dereference is extraneous
aws/resource_aws_cloudwatch_log_resource_policy.go:77:27: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSCloudwatchLogDestinationPolicy_basic (86.97s)

--- PASS: TestAccAWSCloudWatchLogResourcePolicy_basic (31.10s)
```
bflad added a commit that referenced this issue Feb 26, 2020
…#11920)

Reference: #9952

Remove extraneous pointer value dereferences, which cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/data_source_aws_iam_server_certificate.go:142:15: R002: ResourceData.Set() pointer value dereference is extraneous
aws/data_source_aws_iam_server_certificate.go:143:16: R002: ResourceData.Set() pointer value dereference is extraneous
aws/data_source_aws_iam_server_certificate.go:144:16: R002: ResourceData.Set() pointer value dereference is extraneous
```

Also removes extraneous time conversion function.

Output from acceptance testing:

```
--- PASS: TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix (4.36s)
--- PASS: TestAccAWSDataSourceIAMServerCertificate_basic (16.79s)
--- PASS: TestAccAWSDataSourceIAMServerCertificate_path (17.37s)
```
bflad added a commit that referenced this issue Mar 10, 2020
Reference: #12074

Gaps in `tfproviderlint`/`awsproviderlint` checking are covered by the following issues:

Reference: #11888 (fix and enable AWSAT001)
Reference: #9950 (fix and enable AT003)
Reference: #11862 (fix and enable AT005)
Reference: #9951 (fix and enable R001)
Reference: #9952 (fix and enable R002)
Reference: #9953 (fix and enable R003)
Reference: #11863 (fix and enable R005)
Reference: #11864 (fix and enable R006)
Reference: #12083 (fix and enable R007, R008)
Reference: #9955 (fix and enable S006)
Reference: #9956 (fix and enable S018)
Reference: #11865 (fix and enable S020)
Reference: #11866 (fix and enable S022)
Reference: #11867 (fix and enable S023)
Reference: #11868 (fix and enable S024)
Reference: #11869 (fix and enable S031)
Reference: #11870 (fix and enable S032)
Reference: #11871 (fix and enable S033)
Reference: #11872 (fix and enable V001)
Reference: #11844 (fix and enable V002, V004, V005, V007, V008)
bflad added a commit that referenced this issue Mar 10, 2020
Reference: #9952

Remove pointer value dereferences, which can cause potential panics and are extraneous as `Set()` automatically handles pointer types including when `nil`.

Previously:

```
aws/resource_aws_opsworks_stack.go:328:38: R002: ResourceData.Set() pointer value dereference is extraneous
```

Output from acceptance testing:

```
--- PASS: TestAccAWSOpsworksStack_noVpcBasic (36.09s)
--- PASS: TestAccAWSOpsworksStack_noVpcCreateTags (46.83s)
--- PASS: TestAccAWSOpsworksStack_CustomCookbooks_SetPrivateProperties (40.27s)
--- PASS: TestAccAWSOpsworksStack_vpc (64.43s)
--- PASS: TestAccAWSOpsworksStack_noVpcChangeServiceRoleForceNew (43.03s)
```
@bflad bflad added this to the v2.53.0 milestone Mar 10, 2020
bflad added a commit that referenced this issue Mar 10, 2020
Reference: #9952

Previously:

```
aws/resource_aws_sns_platform_application.go:230:18: R002: ResourceData.Set() pointer value dereference is extraneous
```

We are unable to acceptance test the `aws_sns_platform_application` resource as it requires an active Apple Developer subscription and application, however this final refactor is trivial.
@ghost
Copy link

ghost commented Mar 12, 2020

This has been released in version 2.53.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!

@ghost
Copy link

ghost commented Apr 10, 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 and limited conversation to collaborators Apr 10, 2020
@breathingdust breathingdust added the linter Pertains to changes to or issues with the various linters. label Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants