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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ rules:
- internal/service/elasticache
- internal/service/elasticbeanstalk
- internal/service/elb
- internal/service/rds
patterns:
- pattern-either:
- pattern: '$LHS == *$RHS'
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ func resourceClusterStateRefreshFunc(conn *rds.RDS, dbClusterIdentifier string)
var dbc *rds.DBCluster

for _, c := range resp.DBClusters {
if *c.DBClusterIdentifier == dbClusterIdentifier {
if aws.StringValue(c.DBClusterIdentifier) == dbClusterIdentifier {
dbc = c
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ func resourceInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
req.StorageType = aws.String(d.Get("storage_type").(string))
requestUpdate = true

if *req.StorageType == "io1" {
if aws.StringValue(req.StorageType) == StorageTypeIo1 {
req.Iops = aws.Int64(int64(d.Get("iops").(int)))
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/service/rds/option_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func resourceOptionGroupRead(d *schema.ResourceData, meta interface{}) error {

var option *rds.OptionGroup
for _, ogl := range options.OptionGroupsList {
if *ogl.OptionGroupName == d.Id() {
if aws.StringValue(ogl.OptionGroupName) == d.Id() {
option = ogl
break
}
Expand Down Expand Up @@ -235,7 +235,7 @@ func resourceOptionGroupRead(d *schema.ResourceData, meta interface{}) error {

func optionInList(optionName string, list []*string) bool {
for _, opt := range list {
if *opt == optionName {
if aws.StringValue(opt) == optionName {
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func resourceSecurityGroupRetrieve(d *schema.ResourceData, meta interface{}) (*r
}

if len(resp.DBSecurityGroups) != 1 ||
*resp.DBSecurityGroups[0].DBSecurityGroupName != d.Id() {
aws.StringValue(resp.DBSecurityGroups[0].DBSecurityGroupName) != d.Id() {
return nil, fmt.Errorf("Unable to find DB Security Group: %#v", resp.DBSecurityGroups)
}

Expand Down