Skip to content

Commit d5599cc

Browse files
authored
optional enums, route.load_balancing_policy (#47)
1. add optional enums, trimming the prefix and bringing them to lowercase, so that they won't look alien in the terraform files 2. adds route `load_balancing_policy` option Ref: https://linear.app/pomerium/issue/ENG-1761/routesresource-expose-all-fields
1 parent 1db1e33 commit d5599cc

17 files changed

+419
-768
lines changed

docs/data-sources/route.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Route data source
2323

2424
- `jwt_groups_filter` (Attributes) JWT Groups Filter (see [below for nested schema](#nestedatt--jwt_groups_filter))
2525
- `jwt_issuer_format` (String) Format for JWT issuer strings. Use 'IssuerHostOnly' for hostname without scheme or trailing slash, or 'IssuerURI' for complete URI including scheme and trailing slash.
26+
- `load_balancing_policy` (String) Load balancing policy.
2627

2728
### Read-Only
2829

docs/data-sources/routes.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Optional:
3535

3636
- `jwt_groups_filter` (Attributes) JWT Groups Filter (see [below for nested schema](#nestedatt--routes--jwt_groups_filter))
3737
- `jwt_issuer_format` (String) Format for JWT issuer strings. Use 'IssuerHostOnly' for hostname without scheme or trailing slash, or 'IssuerURI' for complete URI including scheme and trailing slash.
38+
- `load_balancing_policy` (String) Load balancing policy.
3839

3940
Read-Only:
4041

docs/resources/route.md

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ Route for Pomerium.
4141
- `jwt_issuer_format` (String) Format for JWT issuer strings. Use 'IssuerHostOnly' for hostname without scheme or trailing slash, or 'IssuerURI' for complete URI including scheme and trailing slash.
4242
- `kubernetes_service_account_token` (String) Kubernetes service account token.
4343
- `kubernetes_service_account_token_file` (String) Path to the Kubernetes service account token file.
44+
- `load_balancing_policy` (String) The following values are valid for the Load Balancing Policy field:
45+
46+
- `round_robin`
47+
- `maglev`
48+
- `random`
49+
- `ring_hash`
50+
- `least_request`
4451
- `logo_url` (String) URL to the logo image.
4552
- `pass_identity_headers` (Boolean) If applied, passes X-Pomerium-Jwt-Assertion header and JWT Claims Headers to the upstream application.
4653
- `path` (String) Matches incoming requests with a path that is an exact match for the specified path.

example/main.tf

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
pomerium = {
44
source = "pomerium/pomerium"
5-
version = "0.0.8"
5+
version = "0.0.11"
66
}
77
}
88
}
@@ -51,7 +51,9 @@ resource "pomerium_settings" "settings" {
5151
log_level = "info"
5252
proxy_log_level = "info"
5353

54-
timeout_idle = "5m"
54+
timeout_idle = "10m"
55+
56+
darkmode_primary_color = "#49AAA1"
5557

5658
jwt_groups_filter = {
5759
groups = ["id1", "id2"]

go.mod

+2-26
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,41 @@ require (
1111
github.com/hashicorp/terraform-plugin-go v0.25.0
1212
github.com/hashicorp/terraform-plugin-log v0.9.0
1313
github.com/iancoleman/strcase v0.3.0
14-
github.com/pomerium/enterprise-client-go v0.28.1-0.20250218224016-12d6ab8fdeb1
14+
github.com/pomerium/enterprise-client-go v0.28.1-0.20250306195545-d8048381f24f
1515
github.com/pomerium/pomerium v0.28.1-0.20250218200206-b9fd926618e2
1616
github.com/rs/zerolog v1.33.0
1717
github.com/stretchr/testify v1.10.0
1818
google.golang.org/grpc v1.70.0
19-
google.golang.org/protobuf v1.36.3
19+
google.golang.org/protobuf v1.36.4
2020
)
2121

2222
require (
2323
github.com/OneOfOne/xxhash v1.2.8 // indirect
24-
github.com/caddyserver/certmagic v0.21.4 // indirect
25-
github.com/caddyserver/zerossl v0.1.3 // indirect
26-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
27-
github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect
2824
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
29-
github.com/envoyproxy/go-control-plane v0.13.1 // indirect
3025
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
3126
github.com/fatih/color v1.14.1 // indirect
3227
github.com/golang/protobuf v1.5.4 // indirect
33-
github.com/google/uuid v1.6.0 // indirect
34-
github.com/hashicorp/errwrap v1.1.0 // indirect
3528
github.com/hashicorp/go-hclog v1.5.0 // indirect
36-
github.com/hashicorp/go-multierror v1.1.1 // indirect
3729
github.com/hashicorp/go-plugin v1.6.2 // indirect
38-
github.com/hashicorp/go-set/v3 v3.0.0 // indirect
3930
github.com/hashicorp/go-uuid v1.0.3 // indirect
40-
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
4131
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
4232
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
4333
github.com/hashicorp/yamux v0.1.1 // indirect
44-
github.com/jxskiss/base62 v1.1.0 // indirect
45-
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
46-
github.com/libdns/libdns v0.2.2 // indirect
4734
github.com/mattn/go-colorable v0.1.13 // indirect
4835
github.com/mattn/go-isatty v0.0.20 // indirect
49-
github.com/mholt/acmez/v2 v2.0.3 // indirect
50-
github.com/miekg/dns v1.1.62 // indirect
5136
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
5237
github.com/oklog/run v1.0.0 // indirect
5338
github.com/open-policy-agent/opa v1.0.0 // indirect
54-
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
5539
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
56-
github.com/pomerium/protoutil v0.0.0-20240813175624-47b7ac43ff46 // indirect
5740
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
5841
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
5942
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
6043
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
6144
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
62-
github.com/zeebo/blake3 v0.2.4 // indirect
63-
go.uber.org/multierr v1.11.0 // indirect
64-
go.uber.org/zap v1.27.0 // indirect
6545
golang.org/x/crypto v0.32.0 // indirect
66-
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
67-
golang.org/x/mod v0.21.0 // indirect
6846
golang.org/x/net v0.34.0 // indirect
69-
golang.org/x/sync v0.10.0 // indirect
7047
golang.org/x/sys v0.29.0 // indirect
7148
golang.org/x/text v0.21.0 // indirect
72-
golang.org/x/tools v0.25.0 // indirect
7349
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
7450
gopkg.in/yaml.v3 v3.0.1 // indirect
7551
sigs.k8s.io/yaml v1.4.0 // indirect

0 commit comments

Comments
 (0)