Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix perma diff problem during TF import #7348

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mmv1/products/cloudidentity/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
cust_id: :CUST_ID
custom_code: !ruby/object:Provider::Terraform::CustomCode
post_create: templates/terraform/post_create/set_computed_name.erb
custom_import: templates/terraform/custom_import/set_id_name_with_slashes.go.erb
custom_import: templates/terraform/custom_import/cloud_identity_group_import.go.erb
GroupMembership: !ruby/object:Overrides::Terraform::ResourceOverride
read_error_transform: "transformCloudIdentityGroupMembershipReadError"
docs: !ruby/object:Provider::Terraform::Docs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
config := meta.(*Config)

// current import_formats can't import fields with forward slashes in their value
if err := parseImportId([]string{"(?P<name>.+)"}, d, config); err != nil {
return nil, err
}

name := d.Get("name").(string)

if d.Get("initial_group_config") == nil {
d.Set("initial_group_config", "EMPTY")
}

if err := d.Set("name", name); err != nil {
return nil, fmt.Errorf("Error setting name: %s", err)
}
d.SetId(name)
return []*schema.ResourceData{d}, nil