Skip to content

Commit

Permalink
[1/2] DXCDT-445: Fix created import ID on association resources (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored May 9, 2023
1 parent 7567777 commit eff561d
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 eff561d

Please sign in to comment.