Skip to content

Commit

Permalink
fix usage setTagsRedshift
Browse files Browse the repository at this point in the history
  • Loading branch information
teraken0509 committed Aug 3, 2019
1 parent 39be988 commit 9bdcec5
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions aws/resource_aws_redshift_snapshot_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func resourceAwsRedshiftSnapshotSchedule() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"identifier": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -117,21 +121,24 @@ func resourceAwsRedshiftSnapshotScheduleRead(d *schema.ResourceData, meta interf
}
d.Set("tags", tagsToMapRedshift(snapshotSchedule.Tags))

return nil
}

func resourceAwsRedshiftSnapshotScheduleUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn
d.Partial(true)

arn := arn.ARN{
Partition: meta.(*AWSClient).partition,
Service: "redshift",
Region: meta.(*AWSClient).region,
AccountID: meta.(*AWSClient).accountid,
Resource: fmt.Sprintf("snapshotschedule:%s", d.Id()),
}.String()
if tagErr := setTagsRedshift(conn, d, arn); tagErr != nil {

d.Set("arn", arn)

return nil
}

func resourceAwsRedshiftSnapshotScheduleUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).redshiftconn
d.Partial(true)

if tagErr := setTagsRedshift(conn, d); tagErr != nil {
return tagErr
} else {
d.SetPartial("tags")
Expand Down

0 comments on commit 9bdcec5

Please sign in to comment.