Skip to content

Commit

Permalink
fix: mutating extant resources not forcing new
Browse files Browse the repository at this point in the history
  • Loading branch information
OJFord authored and floydspace committed Apr 8, 2023
1 parent 5b5133a commit 93a6b7f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/resources/machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ resource "fly_machine" "exampleMachine" {
Required:

- `path` (String) Path for volume to be mounted on vm
- `volume` (String) Name or ID of volume
- `volume` (String) ID of volume

Optional:

Expand Down
6 changes: 6 additions & 0 deletions internal/provider/app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ func (ar flyAppResourceType) GetSchema(context.Context) (tfsdk.Schema, diag.Diag
MarkdownDescription: "Name of application",
Required: true,
Type: types.StringType,
PlanModifiers: tfsdk.AttributePlanModifiers{
resource.RequiresReplace(),
},
},
"org": {
Computed: true,
Optional: true,
MarkdownDescription: "Optional org slug to operate upon",
Type: types.StringType,
PlanModifiers: tfsdk.AttributePlanModifiers{
resource.RequiresReplace(),
},
},
"orgid": {
Computed: true,
Expand Down
5 changes: 4 additions & 1 deletion internal/provider/machine_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ func (mr flyMachineResourceType) GetSchema(context.Context) (tfsdk.Schema, diag.
},
"volume": {
Required: true,
MarkdownDescription: "Name or ID of volume",
MarkdownDescription: "ID of volume",
Type: types.StringType,
PlanModifiers: tfsdk.AttributePlanModifiers{
resource.RequiresReplace(),
},
},
}),
},
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/volume_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (t flyVolumeResourceType) GetSchema(context.Context) (tfsdk.Schema, diag.Di
MarkdownDescription: "Size of volume in gb",
Required: true,
Type: types.Int64Type,
PlanModifiers: tfsdk.AttributePlanModifiers{
resource.RequiresReplace(),
},
},
"name": {
MarkdownDescription: "name",
Expand Down

0 comments on commit 93a6b7f

Please sign in to comment.