Skip to content

Commit 82e00ef

Browse files
committed
update route data source
1 parent 66f7119 commit 82e00ef

File tree

2 files changed

+59
-6
lines changed

2 files changed

+59
-6
lines changed

example/main.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ data "pomerium_namespace" "existing_namespace" {
245245
id = pomerium_namespace.test_namespace.id
246246
}
247247

248-
# data "pomerium_route" "existing_route" {
249-
# id = pomerium_route.test_route.id
250-
# }
248+
data "pomerium_route" "existing_route" {
249+
id = pomerium_route.test_route.id
250+
}
251251

252252
# Output examples
253253
output "namespace_name" {

internal/provider/route_data_source.go

+56-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66

77
"github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes"
8+
"github.com/hashicorp/terraform-plugin-framework/attr"
89
"github.com/hashicorp/terraform-plugin-framework/datasource"
910
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -30,7 +31,7 @@ func getRouteDataSourceAttributes(idRequired bool) map[string]schema.Attribute {
3031
Computed: true,
3132
Description: "From URL.",
3233
},
33-
"to": schema.ListAttribute{
34+
"to": schema.SetAttribute{
3435
Computed: true,
3536
ElementType: types.StringType,
3637
Description: "To URLs.",
@@ -39,7 +40,7 @@ func getRouteDataSourceAttributes(idRequired bool) map[string]schema.Attribute {
3940
Computed: true,
4041
Description: "ID of the namespace the route belongs to.",
4142
},
42-
"policies": schema.ListAttribute{
43+
"policies": schema.SetAttribute{
4344
Computed: true,
4445
ElementType: types.StringType,
4546
Description: "List of policy IDs associated with the route.",
@@ -131,7 +132,7 @@ func getRouteDataSourceAttributes(idRequired bool) map[string]schema.Attribute {
131132
ElementType: types.StringType,
132133
Description: "Set request headers.",
133134
},
134-
"remove_request_headers": schema.ListAttribute{
135+
"remove_request_headers": schema.SetAttribute{
135136
Computed: true,
136137
ElementType: types.StringType,
137138
Description: "Remove request headers.",
@@ -165,6 +166,58 @@ func getRouteDataSourceAttributes(idRequired bool) map[string]schema.Attribute {
165166
Computed: true,
166167
Description: "Show error details.",
167168
},
169+
"jwt_groups_filter": JWTGroupsFilterSchema,
170+
"jwt_issuer_format": schema.ObjectAttribute{
171+
Description: "JWT issuer format configuration.",
172+
Computed: true,
173+
AttributeTypes: map[string]attr.Type{
174+
"format": types.StringType,
175+
},
176+
},
177+
"rewrite_response_headers": schema.SetNestedAttribute{
178+
Description: "Response header rewrite rules.",
179+
Computed: true,
180+
NestedObject: schema.NestedAttributeObject{
181+
Attributes: map[string]schema.Attribute{
182+
"header": schema.StringAttribute{
183+
Required: true,
184+
Description: "Header name to rewrite",
185+
},
186+
"prefix": schema.StringAttribute{
187+
Optional: true,
188+
Description: "Prefix matcher for the header",
189+
},
190+
"value": schema.StringAttribute{
191+
Required: true,
192+
Description: "New value for the header",
193+
},
194+
},
195+
},
196+
},
197+
"tls_custom_ca_key_pair_id": schema.StringAttribute{
198+
Description: "Custom CA key pair ID for TLS verification.",
199+
Computed: true,
200+
},
201+
"tls_client_key_pair_id": schema.StringAttribute{
202+
Description: "Client key pair ID for TLS client authentication.",
203+
Computed: true,
204+
},
205+
"description": schema.StringAttribute{
206+
Description: "Description of the route.",
207+
Computed: true,
208+
},
209+
"kubernetes_service_account_token_file": schema.StringAttribute{
210+
Description: "Path to the Kubernetes service account token file.",
211+
Computed: true,
212+
},
213+
"logo_url": schema.StringAttribute{
214+
Description: "URL to the logo image.",
215+
Computed: true,
216+
},
217+
"enable_google_cloud_serverless_authentication": schema.BoolAttribute{
218+
Description: "Enable Google Cloud serverless authentication.",
219+
Computed: true,
220+
},
168221
}
169222
}
170223

0 commit comments

Comments
 (0)