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

Error creating SBX and Prod environments: azure_region: was cty.StringVal("eastus"), but now cty.StringVal("westus"). #548

Open
eduardodfmex opened this issue Jan 7, 2025 · 1 comment · May be fixed by #550
Assignees
Labels
bug Something isn't working
Milestone

Comments

@eduardodfmex
Copy link
Contributor

Error creating SBX and Prod environments: azure_region: was cty.StringVal("eastus"), but now cty.StringVal("westus").

I want to create Power plartform environments configuring the azure_region to be "eastus" but Im having this error:

##[debug]│ Error: Provider produced inconsistent result after apply ##[debug]│ ##[debug]│ When applying changes to ##[debug]│ module.dealer4.module.power_platform_sandbox.powerplatform_environment.powerplatform_environment, ##[debug]│ provider "provider[\"registry.terraform.io/microsoft/power-platform\"]" ##[debug]│ produced an unexpected new value: .azure_region: was ##[debug]│ cty.StringVal("eastus"), but now cty.StringVal("westus"). ##[debug]│ ##[debug]│ This is a bug in the provider, which should be reported in the provider's ##[debug]│ own issue tracker. ##[debug]╵

Sample Terraform Code

resource "powerplatform_environment" "powerplatform_environment" {
  display_name     = var.pp_environment_name
  location         = var.pp_environment_location
  environment_type = var.pp_environment_type
  azure_region     = var.pp_environment_region
  dataverse = {
    language_code     = var.pp_environment_language_code
    currency_code     = var.pp_environment_currency_code
    domain            = var.pp_environment_domain
    security_group_id = var.pp_environment_security_group.id
    templates         = var.pp_environment_template_apps
  }
  lifecycle {
    prevent_destroy = false
  }
}
 
  pp_environment_location           = "unitedstates"
  pp_environment_region             = "eastus"

Expected behavior

The environments should be created on the azure_region that I specify and don't ask me or warn me to change the region to "westus"

System Information

  • Provider Version: 3.3.0
  • OS & Version: Linux, GitHub Workflow with ubuntu-latest

Additional context

If I chose the azure_region to be "westus" I can create the environments.

Contribution

Do you plan to raise a PR to address this issue? YES / NO?

@eduardodfmex eduardodfmex added the bug Something isn't working label Jan 7, 2025
@eduardodfmex eduardodfmex added this to the Backlog milestone Jan 7, 2025
@mawasile
Copy link
Contributor

mawasile commented Jan 8, 2025

This had happened because the backend for some reason did not create the environment is the desired region and did that in a fallback one. I will check if we can workaround that during the creation as terraform expects exactly those values that user specified, and if something else is returned that will fail the whole creation process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants