Skip to content

Commit 866c593

Browse files
authored
Merge pull request #27 from pluralsh/templated
extend service with templated flag
2 parents 6d69739 + 0d3707c commit 866c593

File tree

10 files changed

+134
-68
lines changed

10 files changed

+134
-68
lines changed

docs/resources/service_context.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "plural_service_context Resource - terraform-provider-plural"
4+
subcategory: ""
5+
description: |-
6+
A representation of a service context that can be reused during service deployment templating.
7+
---
8+
9+
# plural_service_context (Resource)
10+
11+
A representation of a service context that can be reused during service deployment templating.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String) Human-readable name of this service context. Globally unique.
21+
22+
### Optional
23+
24+
- `configuration` (Map of String)
25+
- `secrets` (Map of String, Sensitive)
26+
27+
### Read-Only
28+
29+
- `id` (String) Internal identifier of this provider.

docs/resources/service_deployment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ description: |-
3131
- `protect` (Boolean) If true, deletion of this service is not allowed.
3232
- `repository` (Attributes) Repository information used to pull ServiceDeployment. (see [below for nested schema](#nestedatt--repository))
3333
- `sync_config` (Attributes) Settings for advanced tuning of the sync process. (see [below for nested schema](#nestedatt--sync_config))
34+
- `templated` (Boolean) If true, apply Liquid templating to raw YAML files.
3435
- `version` (String) Semver version of this service ServiceDeployment.
3536

3637
### Read-Only

example/service/git/main.tf

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
terraform {
2+
required_providers {
3+
plural = {
4+
source = "pluralsh/plural"
5+
version = "0.0.1"
6+
}
7+
}
8+
}
9+
10+
111
provider "plural" {
212
use_cli = true
313
}
414

515
data "plural_cluster" "byok_workload_cluster" {
6-
handle = "gcp-workload-cluster"
16+
handle = "cd-demo"
717
}
818

919
data "plural_git_repository" "cd-test" {
@@ -29,17 +39,12 @@ resource "plural_service_deployment" "cd-test" {
2939
version = "0.0.2"
3040
docs_path = "doc"
3141
protect = false
42+
templated = true
3243

33-
configuration = [
34-
{
35-
name : "host"
36-
value : "tf-cd-test.gcp.plural.sh"
37-
},
38-
{
39-
name : "tag"
40-
value : "sha-4d01e86"
41-
}
42-
]
44+
configuration = {
45+
"host" = "tf-cd-test.gcp.plural.sh"
46+
"tag" = "sha-4d01e86"
47+
}
4348

4449
sync_config = {
4550
namespace_metadata = {

go.mod

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
module terraform-provider-plural
22

3-
go 1.21
3+
go 1.22
4+
5+
toolchain go1.22.0
46

57
require (
6-
github.com/Yamashou/gqlgenc v0.14.0
8+
github.com/Yamashou/gqlgenc v0.18.1
79
github.com/golangci/golangci-lint v1.55.1
810
github.com/hashicorp/terraform-plugin-docs v0.16.0
911
github.com/hashicorp/terraform-plugin-framework v1.4.2
1012
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
1113
github.com/hashicorp/terraform-plugin-log v0.9.0
1214
github.com/mitchellh/go-homedir v1.1.0
13-
github.com/pluralsh/console-client-go v0.0.88
14-
github.com/pluralsh/plural-cli v0.8.3-0.20240103194947-ad93fa94908a
15+
github.com/pluralsh/console-client-go v0.0.96
16+
github.com/pluralsh/plural-cli v0.8.5-0.20240216094552-efc34ee6de37
1517
github.com/pluralsh/polly v0.1.4
1618
github.com/samber/lo v1.38.1
1719
github.com/sirupsen/logrus v1.9.3
@@ -25,6 +27,7 @@ require (
2527
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
2628
4d63.com/gochecknoglobals v0.2.1 // indirect
2729
github.com/4meepo/tagalign v1.3.3 // indirect
30+
github.com/99designs/gqlgen v0.17.43 // indirect
2831
github.com/Abirdcfly/dupword v0.0.13 // indirect
2932
github.com/AlecAivazis/survey/v2 v2.3.5 // indirect
3033
github.com/Antonboom/errname v0.1.12 // indirect
@@ -137,7 +140,7 @@ require (
137140
github.com/google/gofuzz v1.2.0 // indirect
138141
github.com/google/pprof v0.0.0-20230508170847-c6d6667b8fd4 // indirect
139142
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
140-
github.com/google/uuid v1.3.1 // indirect
143+
github.com/google/uuid v1.6.0 // indirect
141144
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
142145
github.com/gorilla/mux v1.8.0 // indirect
143146
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
@@ -198,7 +201,7 @@ require (
198201
github.com/maratori/testpackage v1.1.1 // indirect
199202
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
200203
github.com/mattn/go-colorable v0.1.13 // indirect
201-
github.com/mattn/go-isatty v0.0.19 // indirect
204+
github.com/mattn/go-isatty v0.0.20 // indirect
202205
github.com/mattn/go-runewidth v0.0.14 // indirect
203206
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
204207
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
@@ -246,7 +249,7 @@ require (
246249
github.com/quasilyte/gogrep v0.5.0 // indirect
247250
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
248251
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
249-
github.com/rivo/uniseg v0.4.3 // indirect
252+
github.com/rivo/uniseg v0.4.7 // indirect
250253
github.com/rubenv/sql-migrate v1.3.1 // indirect
251254
github.com/russross/blackfriday v1.6.0 // indirect
252255
github.com/russross/blackfriday/v2 v2.1.0 // indirect
@@ -255,7 +258,7 @@ require (
255258
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
256259
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
257260
github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect
258-
github.com/schollz/progressbar/v3 v3.8.6 // indirect
261+
github.com/schollz/progressbar/v3 v3.14.1 // indirect
259262
github.com/securego/gosec/v2 v2.18.2 // indirect
260263
github.com/sergi/go-diff v1.3.1 // indirect
261264
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
@@ -265,6 +268,7 @@ require (
265268
github.com/sivchari/tenv v1.7.1 // indirect
266269
github.com/skeema/knownhosts v1.1.0 // indirect
267270
github.com/sonatard/noctx v0.0.2 // indirect
271+
github.com/sosodev/duration v1.2.0 // indirect
268272
github.com/sourcegraph/go-diff v0.7.0 // indirect
269273
github.com/spf13/afero v1.9.5 // indirect
270274
github.com/spf13/cast v1.5.0 // indirect
@@ -287,7 +291,7 @@ require (
287291
github.com/ultraware/funlen v0.1.0 // indirect
288292
github.com/ultraware/whitespace v0.0.5 // indirect
289293
github.com/uudashr/gocognit v1.1.2 // indirect
290-
github.com/vektah/gqlparser/v2 v2.5.1 // indirect
294+
github.com/vektah/gqlparser/v2 v2.5.11 // indirect
291295
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
292296
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
293297
github.com/xanzy/ssh-agent v0.3.3 // indirect
@@ -309,16 +313,16 @@ require (
309313
go.uber.org/goleak v1.2.1 // indirect
310314
go.uber.org/multierr v1.8.0 // indirect
311315
go.uber.org/zap v1.24.0 // indirect
312-
golang.org/x/crypto v0.14.0 // indirect
316+
golang.org/x/crypto v0.16.0 // indirect
313317
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
314318
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
315319
golang.org/x/mod v0.13.0 // indirect
316-
golang.org/x/net v0.17.0 // indirect
320+
golang.org/x/net v0.19.0 // indirect
317321
golang.org/x/oauth2 v0.8.0 // indirect
318322
golang.org/x/sync v0.4.0 // indirect
319-
golang.org/x/sys v0.13.0 // indirect
320-
golang.org/x/term v0.13.0 // indirect
321-
golang.org/x/text v0.13.0 // indirect
323+
golang.org/x/sys v0.17.0 // indirect
324+
golang.org/x/term v0.17.0 // indirect
325+
golang.org/x/text v0.14.0 // indirect
322326
golang.org/x/time v0.3.0 // indirect
323327
golang.org/x/tools v0.14.0 // indirect
324328
google.golang.org/appengine v1.6.7 // indirect

0 commit comments

Comments
 (0)