Skip to content

Commit

Permalink
Destroy and Create new instance upon change in region or networkID
Browse files Browse the repository at this point in the history
  • Loading branch information
uzaxirr committed Jun 19, 2024
1 parent 76c9a41 commit 177d941
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions civo/instances/resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func ResourceInstance() *schema.Resource {
"region": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "The region for the instance, if not declare we use the region in declared in the provider",
},
"hostname": {
Expand Down Expand Up @@ -55,6 +56,7 @@ func ResourceInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "This must be the ID of the network from the network listing (optional; default network used when not specified)",
},
"template": {
Expand Down Expand Up @@ -459,6 +461,10 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, m inter
}
}

if d.HasChange("initial_user") {
return diag.Errorf("[ERR] updating initial_user is not supported")
}

// if tags is declare we update the instance with the tags
if d.HasChange("tags") {
tfTags := d.Get("tags").(*schema.Set).List()
Expand Down

0 comments on commit 177d941

Please sign in to comment.