Skip to content

Commit 8bc06db

Browse files
authored
Release provider-defined functions (#10288) (#7153)
[upstream:c9cf14ddb3cabaec42953e86bdf2be122addb51e]
1 parent cd2e16c commit 8bc06db

30 files changed

+2241
-80
lines changed

.changelog/10288.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```release-note:note
2+
provider: introduced support for provider-defined functions. This feature is in Terraform v1.8.0+.
3+
```
4+
```release-note:enhancement
5+
provider: added provider-defined function `project_from_id` for retrieving the project id from a resource's self link or id
6+
```
7+
```release-note:enhancement
8+
provider: added provider-defined functions `location_from_id`, `region_from_id`, and `zone_from_id` for retrieving the location/region/zone names from a resource's self link or id
9+
```
10+
```release-note:enhancement
11+
provider: added provider-defined function `name_from_id` for retrieving the short-form name of a resource from its self link or id
12+
```
13+
```release-note:enhancement
14+
provider: added provider-defined function `region_from_zone` for deriving a region from a zone's name
15+
```

go.mod

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,28 @@ require (
99
github.com/davecgh/go-spew v1.1.1
1010
github.com/dnaeon/go-vcr v1.0.1
1111
github.com/gammazero/workerpool v0.0.0-20181230203049-86a96b5d5d92
12+
github.com/google/go-cmp v0.6.0
1213
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
1314
github.com/hashicorp/errwrap v1.0.0
1415
github.com/hashicorp/go-cleanhttp v0.5.2
1516
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
1617
github.com/hashicorp/go-multierror v1.1.1
1718
github.com/hashicorp/go-version v1.6.0
18-
github.com/hashicorp/terraform-plugin-framework v1.5.0
19+
github.com/hashicorp/terraform-plugin-framework v1.7.0
1920
github.com/hashicorp/terraform-plugin-framework-validators v0.9.0
20-
github.com/hashicorp/terraform-plugin-go v0.20.0
21+
github.com/hashicorp/terraform-plugin-go v0.22.1
2122
github.com/hashicorp/terraform-plugin-log v0.9.0
22-
github.com/hashicorp/terraform-plugin-mux v0.13.0
23-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0
23+
github.com/hashicorp/terraform-plugin-mux v0.15.0
24+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
2425
github.com/mitchellh/go-homedir v1.1.0
2526
github.com/mitchellh/hashstructure v1.1.0
2627
github.com/sirupsen/logrus v1.8.1
2728
golang.org/x/net v0.21.0
2829
golang.org/x/oauth2 v0.17.0
2930
google.golang.org/api v0.167.0
3031
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9
31-
google.golang.org/grpc v1.61.1
32-
google.golang.org/protobuf v1.32.0
32+
google.golang.org/grpc v1.62.1
33+
google.golang.org/protobuf v1.33.0
3334
)
3435

3536
require (
@@ -39,26 +40,25 @@ require (
3940
cloud.google.com/go/compute/metadata v0.2.3 // indirect
4041
cloud.google.com/go/iam v1.1.6 // indirect
4142
cloud.google.com/go/longrunning v0.5.5 // indirect
42-
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
43+
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect
4344
github.com/agext/levenshtein v1.2.2 // indirect
4445
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
4546
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
4647
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
4748
github.com/cespare/xxhash/v2 v2.2.0 // indirect
48-
github.com/cloudflare/circl v1.3.3 // indirect
49+
github.com/cloudflare/circl v1.3.7 // indirect
4950
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
50-
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 // indirect
51-
github.com/envoyproxy/go-control-plane v0.11.1 // indirect
52-
github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect
53-
github.com/fatih/color v1.13.0 // indirect
51+
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa // indirect
52+
github.com/envoyproxy/go-control-plane v0.12.0 // indirect
53+
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
54+
github.com/fatih/color v1.16.0 // indirect
5455
github.com/felixge/httpsnoop v1.0.4 // indirect
5556
github.com/gammazero/deque v0.0.0-20180920172122-f6adf94963e4 // indirect
5657
github.com/go-logr/logr v1.4.1 // indirect
5758
github.com/go-logr/stdr v1.2.2 // indirect
58-
github.com/golang/glog v1.1.2 // indirect
59+
github.com/golang/glog v1.2.0 // indirect
5960
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
6061
github.com/golang/protobuf v1.5.3 // indirect
61-
github.com/google/go-cmp v0.6.0 // indirect
6262
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect
6363
github.com/google/s2a-go v0.1.7 // indirect
6464
github.com/google/uuid v1.6.0 // indirect
@@ -68,35 +68,36 @@ require (
6868
github.com/hashicorp/go-hclog v1.5.0 // indirect
6969
github.com/hashicorp/go-plugin v1.6.0 // indirect
7070
github.com/hashicorp/go-uuid v1.0.3 // indirect
71-
github.com/hashicorp/hc-install v0.6.2 // indirect
71+
github.com/hashicorp/hc-install v0.6.3 // indirect
7272
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
7373
github.com/hashicorp/logutils v1.0.0 // indirect
74-
github.com/hashicorp/terraform-exec v0.19.0 // indirect
75-
github.com/hashicorp/terraform-json v0.18.0 // indirect
74+
github.com/hashicorp/terraform-exec v0.20.0 // indirect
75+
github.com/hashicorp/terraform-json v0.21.0 // indirect
7676
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
7777
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
7878
github.com/hashicorp/yamux v0.1.1 // indirect
7979
github.com/kylelemons/godebug v1.1.0 // indirect
80-
github.com/mattn/go-colorable v0.1.12 // indirect
81-
github.com/mattn/go-isatty v0.0.14 // indirect
80+
github.com/mattn/go-colorable v0.1.13 // indirect
81+
github.com/mattn/go-isatty v0.0.20 // indirect
8282
github.com/mitchellh/copystructure v1.2.0 // indirect
8383
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
8484
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
8585
github.com/mitchellh/mapstructure v1.5.0 // indirect
8686
github.com/mitchellh/reflectwalk v1.0.2 // indirect
8787
github.com/oklog/run v1.0.0 // indirect
88+
github.com/rogpeppe/go-internal v1.12.0 // indirect
8889
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
8990
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
9091
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
91-
github.com/zclconf/go-cty v1.14.1 // indirect
92+
github.com/zclconf/go-cty v1.14.2 // indirect
9293
go.opencensus.io v0.24.0 // indirect
9394
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 // indirect
9495
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
9596
go.opentelemetry.io/otel v1.23.0 // indirect
9697
go.opentelemetry.io/otel/metric v1.23.0 // indirect
9798
go.opentelemetry.io/otel/trace v1.23.0 // indirect
9899
golang.org/x/crypto v0.19.0 // indirect
99-
golang.org/x/mod v0.14.0 // indirect
100+
golang.org/x/mod v0.15.0 // indirect
100101
golang.org/x/sync v0.6.0 // indirect
101102
golang.org/x/sys v0.17.0 // indirect
102103
golang.org/x/text v0.14.0 // indirect

0 commit comments

Comments
 (0)