|
8 | 8 | "github.com/hashicorp/terraform-plugin-framework/diag"
|
9 | 9 | "github.com/hashicorp/terraform-plugin-framework/path"
|
10 | 10 | "github.com/hashicorp/terraform-plugin-framework/resource"
|
| 11 | + "github.com/hashicorp/terraform-plugin-framework/resource/schema" |
| 12 | + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" |
| 13 | + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" |
11 | 14 | "github.com/hashicorp/terraform-plugin-framework/types"
|
12 | 15 | "github.com/hashicorp/terraform-plugin-log/tflog"
|
13 | 16 | client "github.com/pomerium/enterprise-client-go"
|
@@ -37,7 +40,40 @@ func (r *RouteResource) Metadata(_ context.Context, req resource.MetadataRequest
|
37 | 40 | }
|
38 | 41 |
|
39 | 42 | func (r *RouteResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
|
40 |
| - resp.Schema = RouteSchema(false) |
| 43 | + resp.Schema = schema.Schema{ |
| 44 | + MarkdownDescription: "Route for Pomerium.", |
| 45 | + Attributes: map[string]schema.Attribute{ |
| 46 | + "id": schema.StringAttribute{ |
| 47 | + Computed: true, |
| 48 | + Description: "Unique identifier for the route.", |
| 49 | + PlanModifiers: []planmodifier.String{ |
| 50 | + stringplanmodifier.UseStateForUnknown(), |
| 51 | + }, |
| 52 | + }, |
| 53 | + "name": schema.StringAttribute{ |
| 54 | + Description: "Name of the route.", |
| 55 | + Required: true, |
| 56 | + }, |
| 57 | + "from": schema.StringAttribute{ |
| 58 | + Description: "From URL.", |
| 59 | + Required: true, |
| 60 | + }, |
| 61 | + "to": schema.ListAttribute{ |
| 62 | + ElementType: types.StringType, |
| 63 | + Description: "To URLs.", |
| 64 | + Required: true, |
| 65 | + }, |
| 66 | + "namespace_id": schema.StringAttribute{ |
| 67 | + Description: "ID of the namespace the route belongs to.", |
| 68 | + Required: true, |
| 69 | + }, |
| 70 | + "policies": schema.ListAttribute{ |
| 71 | + ElementType: types.StringType, |
| 72 | + Description: "List of policy IDs associated with the route.", |
| 73 | + Optional: true, |
| 74 | + }, |
| 75 | + }, |
| 76 | + } |
41 | 77 | }
|
42 | 78 |
|
43 | 79 | func (r *RouteResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
|
|
0 commit comments