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

add mutex for apigee_instance #5701

Merged
merged 25 commits into from
Feb 16, 2022
Merged

Conversation

xuchenma
Copy link
Contributor

This PR adds a mutex for apigee_instance, so that multiple instances for the same org will be created in sequence.
Closing hashicorp/terraform-provider-google#10525

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

apigee: fixed a bug where multiple `google_apigee_instance` could not be used on the same `google_apigee_organization`

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@slevenick, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 14 insertions(+))
Terraform Beta: Diff ( 1 file changed, 14 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

I think we want to scope the lock to only Apigee Instances rather than the org in general. How about a mutex like "organizations/{{org_id}}/apigeeInstances"?

@xuchenma
Copy link
Contributor Author

Yes we want to lock only Apigee instances. I tried to change it to "{{org_id}}/instances", but strangely, in my local testing, although it was able to create 2 instances in sequence, it failed to delete them, complaining the resource is locked by another operation.
Could you explain more about what the syntax means? Or should I change it to exactly organizations/{{org_id}}/apigeeInstances?

@slevenick
Copy link
Contributor

Yes we want to lock only Apigee instances. I tried to change it to "{{org_id}}/instances", but strangely, in my local testing, although it was able to create 2 instances in sequence, it failed to delete them, complaining the resource is locked by another operation. Could you explain more about what the syntax means? Or should I change it to exactly organizations/{{org_id}}/apigeeInstances?

I think that organizations/{{org_id}}/apigeeInstances should work, but I haven't tested it. That error message you saw, is that coming from the API or the Terraform provider? I haven't found anywhere in the provider that would produce that message, so maybe it's an API-side error about deletion?

@xuchenma
Copy link
Contributor Author

Thanks, I've changed it to {{org_id}}/apigeeInstances because {{org_id}} is in the form organizations/xxx(it contains the organizations/ already). Local testing has also worked for me.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 14 insertions(+))
Terraform Beta: Diff ( 1 file changed, 14 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@slevenick slevenick merged commit b2606ab into GoogleCloudPlatform:master Feb 16, 2022
@xuchenma xuchenma deleted the new_branch branch February 17, 2022 19:16
lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 16, 2022
* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Revert all changes to test files.

* Revert all changes to test files.

* Revert all changes to test files.

* Add primary_resource_name to fix tests.

* Update iam_attributes.tf.erb to honor skip_test.

* Don't reject skip_tests when example is nil.

* Update mmv1/products/apigee/api.yaml

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Fix primary_resource_name for apigee organization name.

* add mutex for apigee_instance

* Add mutex for apigee_instance

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
lcaggio pushed a commit to lcaggio/magic-modules that referenced this pull request Mar 17, 2022
* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Revert all changes to test files.

* Revert all changes to test files.

* Revert all changes to test files.

* Add primary_resource_name to fix tests.

* Update iam_attributes.tf.erb to honor skip_test.

* Don't reject skip_tests when example is nil.

* Update mmv1/products/apigee/api.yaml

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Fix primary_resource_name for apigee organization name.

* add mutex for apigee_instance

* Add mutex for apigee_instance

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Add support IAM policy for the Environment of Apigee X

* Revert all changes to test files.

* Revert all changes to test files.

* Revert all changes to test files.

* Add primary_resource_name to fix tests.

* Update iam_attributes.tf.erb to honor skip_test.

* Don't reject skip_tests when example is nil.

* Update mmv1/products/apigee/api.yaml

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>

* Fix primary_resource_name for apigee organization name.

* add mutex for apigee_instance

* Add mutex for apigee_instance

Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
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.

3 participants