Skip to content

Commit

Permalink
set computed values when input values change
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonaj committed Feb 8, 2023
1 parent 99aafe4 commit 09d119a
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 121 deletions.
30 changes: 0 additions & 30 deletions internal/service/rds/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1416,36 +1416,6 @@ func resourceClusterImport(_ context.Context, d *schema.ResourceData, meta inter
return []*schema.ResourceData{d}, nil
}

func addIAMRoleToCluster(ctx context.Context, conn *rds.RDS, clusterID, roleARN string) error {
input := &rds.AddRoleToDBClusterInput{
DBClusterIdentifier: aws.String(clusterID),
RoleArn: aws.String(roleARN),
}

_, err := conn.AddRoleToDBClusterWithContext(ctx, input)

if err != nil {
return fmt.Errorf("adding IAM Role (%s) to RDS Cluster (%s): %s", roleARN, clusterID, err)
}

return nil
}

func removeIAMRoleFromCluster(ctx context.Context, conn *rds.RDS, clusterID, roleARN string) error {
input := &rds.RemoveRoleFromDBClusterInput{
DBClusterIdentifier: aws.String(clusterID),
RoleArn: aws.String(roleARN),
}

_, err := conn.RemoveRoleFromDBClusterWithContext(ctx, input)

if err != nil {
return fmt.Errorf("removing IAM Role (%s) from RDS Cluster (%s): %s", roleARN, clusterID, err)
}

return err
}

func clusterSetResourceDataEngineVersionFromCluster(d *schema.ResourceData, c *rds.DBCluster) {
oldVersion := d.Get("engine_version").(string)
newVersion := aws.StringValue(c.EngineVersion)
Expand Down
Loading

0 comments on commit 09d119a

Please sign in to comment.