Skip to content

Commit

Permalink
Merge pull request #39602 from hashicorp/b-overwrite-shared-schema
Browse files Browse the repository at this point in the history
resource/aws_spot_instance_request : Fix issue with overwriting shared schema elements
  • Loading branch information
gdavison authored Oct 4, 2024
2 parents e795bef + a19eba1 commit 994ccfb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions internal/service/ec2/ec2_spot_instance_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ func resourceSpotInstanceRequest() *schema.Resource {
continue
}
// tags_all is Optional+Computed.
if k == names.AttrTags || k == names.AttrTagsAll {
if k == names.AttrTags || k == names.AttrTagsAll || k == "volume_tags" {
continue
}
v.ForceNew = true
// Copy-on-write
x := *v // nosemgrep:ci.semgrep.aws.prefer-pointer-conversion-assignment
x.ForceNew = true
s[k] = &x
}

// Remove attributes added for spot instances.
Expand Down Expand Up @@ -130,11 +133,6 @@ func resourceSpotInstanceRequest() *schema.Resource {
ValidateFunc: validation.IsRFC3339Time,
Computed: true,
}
s["volume_tags"] = &schema.Schema{
Type: schema.TypeMap,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
}
s["wait_for_fulfillment"] = &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Expand Down

0 comments on commit 994ccfb

Please sign in to comment.