From 12ce693c10f4bba716cfff83768db8c2fe2fea62 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 22 Mar 2017 15:45:16 -0400 Subject: [PATCH] a lil more work.. but this will never work until this issue is resolved https://github.com/hashicorp/terraform/issues/2430 --- resource_alks_session.go | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/resource_alks_session.go b/resource_alks_session.go index 9a37cae8..e823e545 100644 --- a/resource_alks_session.go +++ b/resource_alks_session.go @@ -11,19 +11,13 @@ func resourceAlksSession() *schema.Resource { return &schema.Resource{ Create: resourceAlksSessionCreate, Read: resourceAlksSessionRead, - Exists: nil, + Update: resourceAlksSessionUpdate, Delete: resourceAlksSessionDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, "use_iam": &schema.Schema{ Type: schema.TypeBool, Required: true, - ForceNew: true, }, "access_key": &schema.Schema{ Type: schema.TypeString, @@ -41,8 +35,13 @@ func resourceAlksSession() *schema.Resource { } } +// No-op: ALKS Session is currently read-only func resourceAlksSessionCreate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] ALKS Session Create") + return resourceAlksSessionRead(d, meta) +} + +func resourceAlksSessionRead(d *schema.ResourceData, meta interface{}) error { + log.Printf("[INFO] ALKS Session Read") var useIam = d.Get("use_iam").(bool) var name = d.Get("name").(string) @@ -68,14 +67,13 @@ func resourceAlksSessionCreate(d *schema.ResourceData, meta interface{}) error { return nil } -func resourceAlksSessionRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] ALKS Session Read") - - return nil +// No-op: ALKS Session is currently read-only +func resourceAlksSessionUpdate(d *schema.ResourceData, meta interface{}) error { + return resourceAlksSessionRead(d, meta) } +// No-op: ALKS Session is currently read-only func resourceAlksSessionDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] ALKS Session Delete") - + d.SetId("") return nil }