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 RDS semgrep prefer-aws-go-sdk-pointer-conversion-conditional errors #24533

Merged
merged 3 commits into from
May 5, 2022

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented May 4, 2022

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Relates: #12992.

Fixes:

Findings:

  internal/service/rds/cluster.go 
     prefer-aws-go-sdk-pointer-conversion-conditional
        Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g.
        aws.StringValue()

       1463┆ if *c.DBClusterIdentifier == dbClusterIdentifier {


  internal/service/rds/instance.go 
     prefer-aws-go-sdk-pointer-conversion-conditional
        Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g.
        aws.StringValue()

       1715┆ if *req.StorageType == "io1" {


  internal/service/rds/option_group.go 
     prefer-aws-go-sdk-pointer-conversion-conditional
        Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g.
        aws.StringValue()

        194┆ if *ogl.OptionGroupName == d.Id() {
          ⋮┆----------------------------------------
        238┆ if *opt == optionName {


  internal/service/rds/security_group.go 
     prefer-aws-go-sdk-pointer-conversion-conditional
        Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g.
        aws.StringValue()

        299┆ *resp.DBSecurityGroups[0].DBSecurityGroupName != d.Id() {
% make testacc TESTARGS='-run=TestAccRDSCluster_basic\|TestAccRDSInstance_basic\|TestAccRDSOptionGroup_Option_optionSettings\|TestAccRDSSecurityGroup_basic' PKG=rds ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 2  -run=TestAccRDSCluster_basic\|TestAccRDSInstance_basic\|TestAccRDSOptionGroup_Option_optionSettings\|TestAccRDSSecurityGroup_basic -timeout 180m
=== RUN   TestAccRDSCluster_basic
=== PAUSE TestAccRDSCluster_basic
=== RUN   TestAccRDSInstance_basic
=== PAUSE TestAccRDSInstance_basic
=== RUN   TestAccRDSOptionGroup_Option_optionSettings
=== PAUSE TestAccRDSOptionGroup_Option_optionSettings
=== RUN   TestAccRDSSecurityGroup_basic
=== PAUSE TestAccRDSSecurityGroup_basic
=== CONT  TestAccRDSCluster_basic
=== CONT  TestAccRDSOptionGroup_Option_optionSettings
--- PASS: TestAccRDSOptionGroup_Option_optionSettings (33.75s)
=== CONT  TestAccRDSInstance_basic
--- PASS: TestAccRDSCluster_basic (172.16s)
=== CONT  TestAccRDSSecurityGroup_basic
--- PASS: TestAccRDSSecurityGroup_basic (17.75s)
--- PASS: TestAccRDSInstance_basic (530.96s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	568.846s

@github-actions github-actions bot added linter Pertains to changes to or issues with the various linters. service/rds Issues and PRs that pertain to the rds service. size/XS Managed by automation to categorize the size of a PR. labels May 4, 2022
@ewbankkit ewbankkit added technical-debt Addresses areas of the codebase that need refactoring or redesign. size/XS Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels May 4, 2022
@ewbankkit ewbankkit merged commit 9cfaf1d into main May 5, 2022
@ewbankkit ewbankkit deleted the td-semgrep-prefer-aws-go-sdk-pointer-conversion-rds branch May 5, 2022 16:03
@github-actions github-actions bot added this to the v4.13.0 milestone May 5, 2022
@github-actions
Copy link

github-actions bot commented May 5, 2022

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

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

@github-actions
Copy link

github-actions bot commented Jun 5, 2022

I'm going to lock this pull request 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 related to this change, 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 Jun 5, 2022
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. service/rds Issues and PRs that pertain to the rds service. size/XS Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant