Skip to content

Commit

Permalink
Merge pull request #37996 from nikhil-goenka/f/aws_redshift_cluster_s…
Browse files Browse the repository at this point in the history
…napshot

F/aws redshift cluster snapshot
  • Loading branch information
ewbankkit authored Jul 17, 2024
2 parents e66214e + dc3cdaa commit a8c5397
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .changelog/37996.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_redshift_cluster_snapshot: Set `arn` from `DescribeClusterSnapshots` API response
```
11 changes: 1 addition & 10 deletions internal/service/redshift/cluster_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ package redshift

import (
"context"
"fmt"
"log"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/service/redshift"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand Down Expand Up @@ -115,14 +113,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me
return sdkdiag.AppendErrorf(diags, "reading Redshift Cluster Snapshot (%s): %s", d.Id(), err)
}

arn := arn.ARN{
Partition: meta.(*conns.AWSClient).Partition,
Service: "redshift",
Region: meta.(*conns.AWSClient).Region,
AccountID: meta.(*conns.AWSClient).AccountID,
Resource: fmt.Sprintf("snapshot:%s/%s", aws.StringValue(snapshot.ClusterIdentifier), d.Id()),
}.String()
d.Set(names.AttrARN, arn)
d.Set(names.AttrARN, snapshot.SnapshotArn)
d.Set(names.AttrClusterIdentifier, snapshot.ClusterIdentifier)
d.Set(names.AttrKMSKeyID, snapshot.KmsKeyId)
d.Set("manual_snapshot_retention_period", snapshot.ManualSnapshotRetentionPeriod)
Expand Down

0 comments on commit a8c5397

Please sign in to comment.