-
Notifications
You must be signed in to change notification settings - Fork 61
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] Failed to recreate APigee organisation in the same Project #156
base: main
Are you sure you want to change the base?
Conversation
[Fix] Failed to recreate APigee organisation in the same Project apigee#155
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Many thanks @mhdjomaa3450 for this great PR and the detailed description. @g-greatdevaks and/or I will take a look. If we commit on the approach the following actions would have to be taken before merging:
The Conventional Commits Lint Check can be ignored. We use Conventional commits to generate release notes but we can do this manually. |
Fix tests & Update Docs
@danistrebel @g-greatdevaks , Hi can you please review it. |
Let me review and do the needful, shortly. |
Hey @mhdjomaa3450, thanks for the great PR and for explaining the issue in an elaborate manner. As far as recreation of the Apigee Organization in the same GCP Project is concerned, there are two provisions which are already present as part of the existing apigee-x-core Terraform Module, as stated below:
We can still go ahead and abstract this dependency of the user needing to update the said names. @mhdjomaa3450 Kindly let me know your thoughts. cc: @danistrebel |
@g-greatdevaks Hi, thanks for your reply! I completely agree with you. However, in my case, I aimed to make the process more automated for myself, so I thought it would be helpful to contribute it to the community. As you mentioned, if we proceed with this, we would still need to utilize Terraform Data Sources or expose the KMS Key Ring names in the Terraform output. |
Thanks @g-greatdevaks great points! I'd tend to lean towards keeping the current state and mentioning the fact that upon re-creation the key ring names would have to be overridden in the module docs / variable description. If we decide to go ahead i'd like to keep the ability to control the org keyname (i.e. via org_kms_keyring_name) without randomness such that users can use imports to migrate existing manual setups to TF. |
Once an Apigee organization is created in a specific project, two resources (Key Rings) are also created within that project. These resources are managed by the apigee-x-core module, specifically the kms-org-db and kms-inst-disk . However, when you destroy the environment using the
terraform destroy
command, these two resources are not deleted permanentlyDelete an Apigee organization.
When running
terraform apply
again to recreate the apigee in the same project , you might encounter the following error:The solution to remove the project and create the Apigee in a new project is not considered best practice. To address this issue, We can add a
random_string
resource and use it as a postfix in the names of these two resources as shown below.