Skip to content

Commit

Permalink
Fix created import ID on association resources
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed May 9, 2023
1 parent 1697650 commit fbf1265
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions internal/auth0/connection/resource_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/auth0/go-auth0/management"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/auth0/terraform-provider-auth0/internal/mutex"
Expand Down Expand Up @@ -79,7 +78,7 @@ func createConnectionClient(ctx context.Context, data *schema.ResourceData, meta
return diag.FromErr(err)
}

data.SetId(id.UniqueId())
data.SetId(connectionID + ":" + clientID)

return readConnectionClient(ctx, data, meta)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/auth0/organization/resource_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/auth0/go-auth0/management"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/auth0/terraform-provider-auth0/internal/mutex"
Expand Down Expand Up @@ -83,7 +82,7 @@ func createOrganizationConnection(ctx context.Context, data *schema.ResourceData
return diag.FromErr(err)
}

data.SetId(id.UniqueId())
data.SetId(organizationID + ":" + connectionID)

return readOrganizationConnection(ctx, data, meta)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/auth0/organization/resource_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/auth0/go-auth0/management"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/auth0/terraform-provider-auth0/internal/mutex"
Expand Down Expand Up @@ -64,7 +63,7 @@ func createOrganizationMember(ctx context.Context, d *schema.ResourceData, m int
return diag.FromErr(err)
}

d.SetId(id.UniqueId())
d.SetId(orgID + ":" + userID)

if err := assignRoles(d, api); err != nil {
return diag.FromErr(fmt.Errorf("failed to assign roles to organization member: %w", err))
Expand Down

0 comments on commit fbf1265

Please sign in to comment.