Skip to content

Commit

Permalink
Merge pull request #27 from pluralsh/templated
Browse files Browse the repository at this point in the history
extend service with templated flag
  • Loading branch information
zreigz authored Feb 20, 2024
2 parents 6d69739 + 0d3707c commit 866c593
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 68 deletions.
29 changes: 29 additions & 0 deletions docs/resources/service_context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "plural_service_context Resource - terraform-provider-plural"
subcategory: ""
description: |-
A representation of a service context that can be reused during service deployment templating.
---

# plural_service_context (Resource)

A representation of a service context that can be reused during service deployment templating.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Human-readable name of this service context. Globally unique.

### Optional

- `configuration` (Map of String)
- `secrets` (Map of String, Sensitive)

### Read-Only

- `id` (String) Internal identifier of this provider.
1 change: 1 addition & 0 deletions docs/resources/service_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ description: |-
- `protect` (Boolean) If true, deletion of this service is not allowed.
- `repository` (Attributes) Repository information used to pull ServiceDeployment. (see [below for nested schema](#nestedatt--repository))
- `sync_config` (Attributes) Settings for advanced tuning of the sync process. (see [below for nested schema](#nestedatt--sync_config))
- `templated` (Boolean) If true, apply Liquid templating to raw YAML files.
- `version` (String) Semver version of this service ServiceDeployment.

### Read-Only
Expand Down
27 changes: 16 additions & 11 deletions example/service/git/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
terraform {
required_providers {
plural = {
source = "pluralsh/plural"
version = "0.0.1"
}
}
}


provider "plural" {
use_cli = true
}

data "plural_cluster" "byok_workload_cluster" {
handle = "gcp-workload-cluster"
handle = "cd-demo"
}

data "plural_git_repository" "cd-test" {
Expand All @@ -29,17 +39,12 @@ resource "plural_service_deployment" "cd-test" {
version = "0.0.2"
docs_path = "doc"
protect = false
templated = true

configuration = [
{
name : "host"
value : "tf-cd-test.gcp.plural.sh"
},
{
name : "tag"
value : "sha-4d01e86"
}
]
configuration = {
"host" = "tf-cd-test.gcp.plural.sh"
"tag" = "sha-4d01e86"
}

sync_config = {
namespace_metadata = {
Expand Down
32 changes: 18 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
module terraform-provider-plural

go 1.21
go 1.22

toolchain go1.22.0

require (
github.com/Yamashou/gqlgenc v0.14.0
github.com/Yamashou/gqlgenc v0.18.1
github.com/golangci/golangci-lint v1.55.1
github.com/hashicorp/terraform-plugin-docs v0.16.0
github.com/hashicorp/terraform-plugin-framework v1.4.2
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/mitchellh/go-homedir v1.1.0
github.com/pluralsh/console-client-go v0.0.88
github.com/pluralsh/plural-cli v0.8.3-0.20240103194947-ad93fa94908a
github.com/pluralsh/console-client-go v0.0.96
github.com/pluralsh/plural-cli v0.8.5-0.20240216094552-efc34ee6de37
github.com/pluralsh/polly v0.1.4
github.com/samber/lo v1.38.1
github.com/sirupsen/logrus v1.9.3
Expand All @@ -25,6 +27,7 @@ require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
4d63.com/gochecknoglobals v0.2.1 // indirect
github.com/4meepo/tagalign v1.3.3 // indirect
github.com/99designs/gqlgen v0.17.43 // indirect
github.com/Abirdcfly/dupword v0.0.13 // indirect
github.com/AlecAivazis/survey/v2 v2.3.5 // indirect
github.com/Antonboom/errname v0.1.12 // indirect
Expand Down Expand Up @@ -137,7 +140,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230508170847-c6d6667b8fd4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
Expand Down Expand Up @@ -198,7 +201,7 @@ require (
github.com/maratori/testpackage v1.1.1 // indirect
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
Expand Down Expand Up @@ -246,7 +249,7 @@ require (
github.com/quasilyte/gogrep v0.5.0 // indirect
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rubenv/sql-migrate v1.3.1 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand All @@ -255,7 +258,7 @@ require (
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect
github.com/schollz/progressbar/v3 v3.8.6 // indirect
github.com/schollz/progressbar/v3 v3.14.1 // indirect
github.com/securego/gosec/v2 v2.18.2 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
Expand All @@ -265,6 +268,7 @@ require (
github.com/sivchari/tenv v1.7.1 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/sonatard/noctx v0.0.2 // indirect
github.com/sosodev/duration v1.2.0 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.0 // indirect
Expand All @@ -287,7 +291,7 @@ require (
github.com/ultraware/funlen v0.1.0 // indirect
github.com/ultraware/whitespace v0.0.5 // indirect
github.com/uudashr/gocognit v1.1.2 // indirect
github.com/vektah/gqlparser/v2 v2.5.1 // indirect
github.com/vektah/gqlparser/v2 v2.5.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
Expand All @@ -309,16 +313,16 @@ require (
go.uber.org/goleak v1.2.1 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
Loading

0 comments on commit 866c593

Please sign in to comment.