diff --git a/cloud/resource_service_account.go b/cloud/resource_service_account.go index a933176..b23b59c 100644 --- a/cloud/resource_service_account.go +++ b/cloud/resource_service_account.go @@ -16,7 +16,6 @@ func resourceServiceAccount() *schema.Resource { return &schema.Resource{ CreateContext: resourceServiceAccountCreate, ReadContext: resourceServiceAccountRead, - UpdateContext: resourceServiceAccountUpdate, DeleteContext: resourceServiceAccountDelete, Importer: &schema.ResourceImporter{ StateContext: func(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { @@ -35,11 +34,13 @@ func resourceServiceAccount() *schema.Resource { Type: schema.TypeString, Required: true, Description: descriptions["organization"], + ForceNew: true, }, "name": { Type: schema.TypeString, Optional: true, Description: descriptions["name"], + ForceNew: true, }, "admin": { Type: schema.TypeBool, @@ -149,16 +150,3 @@ func resourceServiceAccountDelete(ctx context.Context, d *schema.ResourceData, m _ = d.Set("name", "") return nil } - -func resourceServiceAccountUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - err := resourceServiceAccountRead(ctx, d, meta) - if err.HasError() { - return diag.FromErr(fmt.Errorf("ERROR_UPDATE_SERVICE_ACCOUNT: %s", err[0].Summary)) - } - namespace := d.Get("organization").(string) - name := d.Get("name").(string) - _ = d.Set("name", name) - _ = d.Set("organization", namespace) - d.SetId(fmt.Sprintf("%s/%s", namespace, name)) - return resourceServiceAccountRead(ctx, d, meta) -} diff --git a/examples/serivceaccounts/main.tf b/examples/serivceaccounts/main.tf index cbb04ff..43fb4c2 100644 --- a/examples/serivceaccounts/main.tf +++ b/examples/serivceaccounts/main.tf @@ -33,10 +33,20 @@ provider "streamnative" { resource "streamnative_service_account" "test-admin-a" { organization = "sndev" - name = "test-admin-a" + name = "test-admin-j" + admin = false +} + +resource "streamnative_service_account" "test-admin-c" { + organization = "sndev" + name = "test-admin-n" admin = true } output "service_account_id" { value = streamnative_service_account.test-admin-a } + +output "service_account_id-2" { + value = streamnative_service_account.test-admin-c +}