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: 'Blueprint parameter 'Allowed locations for resourcegroups' does not exist in blueprint #18087

Open
1 task done
gouthamkamre68 opened this issue Aug 23, 2022 · 1 comment

Comments

@gouthamkamre68
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

I'm trying to assign a published blueprint but have an issue with my code.

Please help me to fix this issue.

Terraform Version

v1.1.5

AzureRM Provider Version

v3.19.1

Affected Resource(s)/Data Source(s)

azurerm_blueprint_assignment

Terraform Configuration Files

data "azurerm_client_config" "current" {}

data "azurerm_subscription" "example" {}

data "azurerm_blueprint_definition" "example" {
  name     = "exampleBlueprint"
  scope_id = data.azurerm_subscription.example.id
}

data "azurerm_blueprint_published_version" "example" {
  scope_id       = data.azurerm_blueprint_definition.example.scope_id
  blueprint_name = data.azurerm_blueprint_definition.example.name
  version        = "1.0.1"
}

resource "azurerm_resource_group" "example" {
  name     = "exampleRG-bp"
  location = "West Europe"

  tags = {
    Environment = "example"
  }
}

resource "azurerm_user_assigned_identity" "example" {
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  name                = "bp-user-example"
}

resource "azurerm_role_assignment" "operator" {
  scope                = data.azurerm_subscription.example.id
  role_definition_name = "Blueprint Operator"
  principal_id         = azurerm_user_assigned_identity.example.principal_id
}

resource "azurerm_role_assignment" "owner" {
  scope                = data.azurerm_subscription.example.id
  role_definition_name = "Owner"
  principal_id         = azurerm_user_assigned_identity.example.principal_id
}

resource "azurerm_blueprint_assignment" "example" {
  name                   = "testAccBPAssignment"
  target_subscription_id = data.azurerm_subscription.example.id
  version_id             = data.azurerm_blueprint_published_version.example.id
  location               = azurerm_resource_group.example.location

  lock_mode = "AllResourcesDoNotDelete"

  lock_exclude_principals = [
    data.azurerm_client_config.current.object_id,
  ]

  identity {
    type         = "UserAssigned"
    identity_ids = [azurerm_user_assigned_identity.example.id]
  }

  resource_groups = <<GROUPS
    {
      "ResourceGroup": {
        "name": "exampleRG-bp"
      }
    }
  GROUPS
  
  parameter_values = <<VALUES
    {
      "Allowed locations for resourcegroups": {
        "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"]
      }
    }
  VALUES

  depends_on = [
    azurerm_role_assignment.operator,
    azurerm_role_assignment.owner
  ]
}

Debug Output/Panic Output

Error: blueprint.AssignmentsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidAssignment" Message="This assignment is invalid. Error: 'Blueprint parameter 'Allowed locations for resourcegroups' does not exist in blueprint '/subscriptions/f1easafgdcf-7af4-42fd-b925-044575d23ac8/providers/Microsoft.Blueprint/blueprints/exampleBlueprint/versions/1.0.1'.'"

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@gouthamkamre68
Copy link
Author

any help on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants