You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attributes that expect UUIDs now validate whether their values are,
in fact, valid UUIDs. This catches cases where names were passed to
attributes accidentally worked.
Closes SSE-347.
Copy file name to clipboardExpand all lines: .changelog/0.21.0.toml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,5 +3,7 @@
3
3
[[features]]
4
4
5
5
[[enhancements]]
6
+
title = "Validate UUID Attributes"
7
+
description = "Attributes that expect UUIDs now validate whether their values are, in fact, valid UUIDs. This catches cases where names passed to attributes accidentally worked. [#795](https://github.com/oxidecomputer/terraform-provider-oxide/issues/795)."
Copy file name to clipboardExpand all lines: internal/provider/instance/resource.go
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -242,6 +242,9 @@ This resource manages instances.
242
242
"project_id": schema.StringAttribute{
243
243
Required: true,
244
244
Description: "ID for the project containing this instance.",
245
+
Validators: []validator.String{
246
+
shared.UUID(),
247
+
},
245
248
PlanModifiers: []planmodifier.String{
246
249
stringplanmodifier.RequiresReplace(),
247
250
},
@@ -314,6 +317,7 @@ This resource manages instances.
314
317
Optional: true,
315
318
MarkdownDescription: "ID of the disk the instance should be booted from. Specifying a boot disk is optional but recommended to ensure predictable boot behavior. When provided, this ID must also be present in `disk_attachments`.",
316
319
Validators: []validator.String{
320
+
shared.UUID(),
317
321
stringvalidator.AlsoRequires(
318
322
path.MatchRoot("disk_attachments"),
319
323
),
@@ -379,6 +383,9 @@ This resource manages instances.
379
383
"subnet_id": schema.StringAttribute{
380
384
Required: true,
381
385
Description: "ID of the VPC subnet in which to create the instance network interface.",
0 commit comments