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

New Resource: azurerm_nginx_deployment #18510

Merged
merged 9 commits into from
Oct 12, 2022
Merged

Conversation

wuxu92
Copy link
Contributor

@wuxu92 wuxu92 commented Sep 23, 2022

Support New service RP Nginx/Nginx and new resource of azurerm_nginx_deployment.

Attention:

the subscription id used to create Nginx deployment need to be configured with a valid Payment. Or create API will response error like SaaS Purchase Payment Check Failed as validationResponse was {\"isEligible\":false,\"errorMessage\":\"Purchase has failed because we couldn't find a valid credit card nor a payment method associated with your Azure subscription. Please use a different Azure subscription or add....... If this happens in TeamCity please contact me and I'll feedback to the service team to add this subscription id to their whitelist to skip this check.

--- PASS: TestAccNginxDeployment_basic (582.99s)
--- PASS: TestAccNginxDeployment_update (672.30s)
--- PASS: TestAccNginxDeployment_identity (676.70s)
PASS

@wuxu92 wuxu92 marked this pull request as ready for review September 26, 2022 07:34
@dkuzmenok
Copy link
Contributor

@wuxu92
Is there an API document? Can't find any somehow.

@dkuzmenok
Copy link
Contributor

@wuxu92 Thanks. I see Identity is supported. Would be great to include it in the resource.

@wuxu92
Copy link
Contributor Author

wuxu92 commented Sep 28, 2022

@dkuzmenok thanks for your reminder. identity added( but only UserIdentity supported )

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

tests are failing:

Test Failed

------- Stdout: -------
=== RUN   TestAccNginxDeployment_basic
=== PAUSE TestAccNginxDeployment_basic
=== CONT  TestAccNginxDeployment_basic
=== CONT  TestAccNginxDeployment_basic
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: waiting delete Nginx Deployment (Subscription: "*******"
        Resource Group Name: "acctestRG-auto-220928061149196089"
        Deployment Name: "acctest-220928061149196089"): Code="Failed" Message="The async operation failed." AdditionalInfo=[{"id":"/providers/Nginx.NginxPlus/locations/WESTEUROPE/operationStatuses/373df08e-e8e5-43cd-8db3-f8e22bbf27b0*9CFF51192EFD92717BAA147C73E0CF9FCA635DDC343DE76BC3962DB5C95A1AF1","name":"373df08e-e8e5-43cd-8db3-f8e22bbf27b0*9CFF51192EFD92717BAA147C73E0CF9FCA635DDC343DE76BC3962DB5C95A1AF1","resourceId":"/subscriptions/*******/resourceGroups/acctestRG-auto-220928061149196089/providers/Nginx.NginxPlus/nginxDeployments/acctest-220928061149196089","startTime":"2022-09-28T06:19:47.8571124Z","status":"Failed"}]
        
        waiting delete Nginx Deployment (Subscription:
        "*******"
        Resource Group Name: "acctestRG-auto-220928061149196089"
        Deployment Name: "acctest-220928061149196089"): Code="Failed" Message="The
        async operation failed."
        AdditionalInfo=[{"id":"/providers/Nginx.NginxPlus/locations/WESTEUROPE/operationStatuses/373df08e-e8e5-43cd-8db3-f8e22bbf27b0*9CFF51192EFD92717BAA147C73E0CF9FCA635DDC343DE76BC3962DB5C95A1AF1","name":"373df08e-e8e5-43cd-8db3-f8e22bbf27b0*9CFF51192EFD92717BAA147C73E0CF9FCA635DDC343DE76BC3962DB5C95A1AF1","resourceId":"/subscriptions/*******/resourceGroups/acctestRG-auto-220928061149196089/providers/Nginx.NginxPlus/nginxDeployments/acctest-220928061149196089","startTime":"2022-09-28T06:19:47.8571124Z","status":"Failed"}]
--- FAIL: TestAccNginxDeployment_basic (724.12s)

@katbyte
Copy link
Collaborator

katbyte commented Sep 29, 2022

@wuxu92 - i think you'll need to add a TeamCity config to ensure this runs in the right regions:

Test Failed

------- Stdout: -------
=== RUN   TestAccNginxDeployment_basic
=== PAUSE TestAccNginxDeployment_basic
=== CONT  TestAccNginxDeployment_basic
=== CONT  TestAccNginxDeployment_basic
    testcase.go:110: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating Nginx Deployment (Subscription: "*******"
        Resource Group Name: "acctestRG-auto-220929161345049532"
        Deployment Name: "acctest-220929161345049532"): nginxdeployment.NginxDeploymentClient#DeploymentsCreate: Failure sending request: StatusCode=0 -- Original Error: Code="LocationNotAvailableForResourceType" Message="The provided location 'westus2' is not available for resource type 'NGINX.NGINXPLUS/nginxDeployments'. List of available regions for the resource type is 'westcentralus,australiaeast,westeurope,westus,eastus2'."
        
          with azurerm_nginx_deployment.test,
          on terraform_plugin_test.tf line 52, in resource "azurerm_nginx_deployment" "test":
          52: resource "azurerm_nginx_deployment" "test" {
        
        creating Nginx Deployment (Subscription:
        "*******"
        Resource Group Name: "acctestRG-auto-220929161345049532"
        Deployment Name: "acctest-220929161345049532"):
        nginxdeployment.NginxDeploymentClient#DeploymentsCreate: Failure sending
        request: StatusCode=0 -- Original Error:
        Code="LocationNotAvailableForResourceType" Message="The provided location
        'westus2' is not available for resource type
        'NGINX.NGINXPLUS/nginxDeployments'. List of available regions for the
        resource type is 'westcentralus,australiaeast,westeurope,westus,eastus2'."
--- FAIL: TestAccNginxDeployment_basic (84.46s)

@wuxu92
Copy link
Contributor Author

wuxu92 commented Sep 29, 2022

@katbyte yes, it's related to the region. I'm reaching out to the service team to confirm this. I test successfully with eastus2euap region but this region not available to TC subscription. I have tried withwesteurope region, and it goes to failure in destroy step in both TC and local machine. so it's a little confusing about the region config. I will update this PR once service team response.

@wuxu92
Copy link
Contributor Author

wuxu92 commented Oct 12, 2022

@katbyte Nginx deployment not supported in westus2 for now, I changed the location to eastus2 in the environment it is success now

image

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @wuxu92 ! LGTM 🤖

@katbyte katbyte merged commit 45dbcbf into hashicorp:main Oct 12, 2022
@github-actions github-actions bot added this to the v3.27.0 milestone Oct 12, 2022
katbyte added a commit that referenced this pull request Oct 12, 2022
@github-actions
Copy link

This functionality has been released in v3.27.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants