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(cloudProject): creation and import for cloudProject in the US #455

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

Stoakes
Copy link
Member

@Stoakes Stoakes commented Aug 24, 2023

Description

This PR fixes public cloud project creation for OVH US. It also improves cloud project documentation so that creation in the US is easier for end user.

Because of some differences in Agora, the result is different between OVH EU/CA on one side & OVH US on the other. There's been some internal discussions about changing that (I can provide more details in PM) and they haven't landed on a result and are not expected to in any near future.

This PR works around the issue by making extra call to find out serviceName if the initial serviceName determination attempt failed.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (improve existing resource(s) or datasource(s))
  • Documentation update

How Has This Been Tested?

I manually tested it by successfully creating & importing a cloud project on OVH-US.

Test Configuration:

  • Terraform version: terraform version: Terraform v1.4.2
  • Existing HCL configuration you used:
export OVH_ENDPOINT=ovh-us
data "ovh_order_cart" "aaa_cart" {
  ovh_subsidiary = "us"
  description    = "us public cloud project cart"
}

data "ovh_order_cart_product_plan" "cloud" {
  cart_id        = data.ovh_order_cart.aaa_cart.id
  price_capacity = "renew"
  product        = "cloud"
  plan_code      = "project" # naming is different in the us.
}

resource "ovh_cloud_project" "cloud_project" {
  ovh_subsidiary = data.ovh_order_cart.aaa_cart.ovh_subsidiary
  description    = "us cloud project"
  payment_mean   = "ovh-account"

  plan {
    duration     = data.ovh_order_cart_product_plan.cloud.selected_price.0.duration
    plan_code    = data.ovh_order_cart_product_plan.cloud.plan_code
    pricing_mode = data.ovh_order_cart_product_plan.cloud.selected_price.0.pricing_mode
  }
}

And also `terraform import ovh_cloud_project.cloud_project <project_id>

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran successfully go mod vendor if I added or modify go.mod file

@Stoakes Stoakes force-pushed the fix-cloudproject-creation-in-the-us branch from 2907590 to a0176cd Compare August 25, 2023 09:54
@Stoakes Stoakes changed the title WIP : fix(cloudProject): creation and import for cloudProject in the US fix(cloudProject): creation and import for cloudProject in the US Aug 25, 2023
@Stoakes Stoakes force-pushed the fix-cloudproject-creation-in-the-us branch from a0176cd to 979064b Compare August 28, 2023 14:14
@Stoakes
Copy link
Member Author

Stoakes commented Aug 31, 2023

Hello,

Is there anything missing on this PR ? Or can we merge it ?

@scraly
Copy link
Collaborator

scraly commented Aug 31, 2023

We are waiting for an US account in order to test everything as the user will do.

@scraly scraly requested a review from yomovh September 1, 2023 11:55
@Stoakes Stoakes force-pushed the fix-cloudproject-creation-in-the-us branch from 979064b to d6d2b9b Compare September 6, 2023 16:36
@Stoakes
Copy link
Member Author

Stoakes commented Sep 6, 2023

Creation of public cloud project patched.

The deletion (and update) of a public cloud project in the US is not working yet because /me/notification/email/history (used for project confirmation deletion) is not available in the US.

@yomovh & myself will see how we deal with it.

@Stoakes Stoakes force-pushed the fix-cloudproject-creation-in-the-us branch from d6d2b9b to 9d9f25e Compare September 7, 2023 11:45
@Stoakes
Copy link
Member Author

Stoakes commented Sep 7, 2023

We don't want to put too much US specific logic in the provider and will work into getting resources ordered through /order deletable in the US.

So for now, as agreed with @yomovh, I added a notice about the known issue that a public cloud project cannot be deleted in the US through Terraform.

Copy link
Member

@yomovh yomovh left a comment

Choose a reason for hiding this comment

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

Thanks for your PR

@scraly
Copy link
Collaborator

scraly commented Sep 11, 2023

After all the things we saw, edited and fixed, now, the PR is good for me 💪

@scraly scraly merged commit f9cf081 into ovh:master Sep 11, 2023
@scraly scraly added the 0.34.0 label Sep 11, 2023
@Stoakes Stoakes deleted the fix-cloudproject-creation-in-the-us branch September 11, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants