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

fixed app_group_assignments import #630

Merged
merged 2 commits into from
Sep 9, 2021
Merged

fixed app_group_assignments import #630

merged 2 commits into from
Sep 9, 2021

Conversation

phi1ipp
Copy link
Contributor

@phi1ipp phi1ipp commented Sep 3, 2021

Added missing importer for resourceAppGroupAssignments

@@ -17,7 +17,38 @@ func resourceAppGroupAssignments() *schema.Resource {
ReadContext: resourceAppGroupAssignmentsRead,
DeleteContext: resourceAppGroupAssignmentsDelete,
UpdateContext: resourceAppGroupAssignmentsUpdate,
Importer: &schema.ResourceImporter{},
Importer: &schema.ResourceImporter{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be implemented even simpler:

Importer: &schema.ResourceImporter{
	StateContext: func(ctx context.Context, d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
		_ = d.Set("app_id", d.Id())
		return []*schema.ResourceData{d}, nil
	},
},

The rest of the job will be done by resourceAppGroupAssignmentsRead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bogdanprodan-okta ,
I'm not a pro in Go or Terraform, so I'll take whatever you say :) So do you want me to resubmit the PR? Or will you do it yourself?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, go ahead and change it. I'll approve and merge it asap.

@phi1ipp
Copy link
Contributor Author

phi1ipp commented Sep 8, 2021

@bogdanprodan-okta , updated PR with the latest change based on your suggestion

@bogdanprodan-okta bogdanprodan-okta merged commit fcc2bca into okta:master Sep 9, 2021
@bogdanprodan-okta bogdanprodan-okta linked an issue Sep 9, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

okta_app_group_assignments import fails
2 participants