From 9e9dff1b35a96e21be9973006ef5357cee3cf9e9 Mon Sep 17 00:00:00 2001 From: SpencerBrown <spencer@spencerbrown.org> Date: Sun, 1 Apr 2018 14:43:40 -0500 Subject: [PATCH] Fix #14: make changing elements in the subject force a new resource rather than failing with "doesn't support update" message --- README.md | 2 +- tls/provider.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index de597d23..2005a0cf 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ If you wish to work on the provider, you'll first need [Go](http://www.golang.or To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. ```sh -$ make bin +$ make build ... $ $GOPATH/bin/terraform-provider-$PROVIDER_NAME ... diff --git a/tls/provider.go b/tls/provider.go index b145c341..ce4111a0 100644 --- a/tls/provider.go +++ b/tls/provider.go @@ -74,14 +74,17 @@ var nameSchema *schema.Resource = &schema.Resource{ "organization": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "common_name": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "organizational_unit": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "street_address": &schema.Schema{ Type: schema.TypeList, @@ -89,26 +92,32 @@ var nameSchema *schema.Resource = &schema.Resource{ Elem: &schema.Schema{ Type: schema.TypeString, }, + ForceNew: true, }, "locality": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "province": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "country": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "postal_code": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, "serial_number": &schema.Schema{ Type: schema.TypeString, Optional: true, + ForceNew: true, }, }, }