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

Support for infrastructure_resource_group_name on azurerm_container_app_environment without workload_profile #24934

Closed
1 task done
mschwrdtnr opened this issue Feb 19, 2024 · 7 comments

Comments

@mschwrdtnr
Copy link

mschwrdtnr commented Feb 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Description

Hi together!
I am happy, that since some weeks it's possible to use infrastructure_resource_group_name on azurerm_container_app_environment. Implemented in #24361.

The problem is that it's necessary to set workload_profile {} and workload profiles only allows values of "["D4" "D8" "D16" "D32" "E4" "E8" "E16" "E32"]".

I want to use the consumption workload_profile and also set the change the value for infrastructure_resource_group_name. It should not be necessary to specify workload_profile to set the resource group name of the infrastructure, in my opinion.

If I want to deploy without workload_profiles {} I get the following error: │ "infrastructure_resource_group_name": all of `infrastructure_resource_group_name,workload_profile` must be specified.

New or Affected Resource(s)/Data Source(s)

azurerm_container_app_environment

Potential Terraform Configuration

resource "azurerm_container_app_environment" "cae_test" {
  name                           = "cae-name"
  location                       = var.location
  resource_group_name            = "rg-cae-test"
  log_analytics_workspace_id     = <log_analytics-id>
  infrastructure_subnet_id       = <subnet-id>
  internal_load_balancer_enabled = true
  infrastructure_resource_group_name = "rg-cae-test-aks"
}

References

#24361

@mschwrdtnr mschwrdtnr changed the title Support for infrastructure_resource_group_name on azurerm_container_app_environment without workload_profiles Support for infrastructure_resource_group_name on azurerm_container_app_environment without workload_profile Feb 19, 2024
@aristosvo
Copy link
Collaborator

Hi @mschwrdtnr 👋!

I've implemented it, and during my testing I noticed that it was only picked up in combination with a workload_profile.

If you have an example of it working with a consumption workload profile using az cli or portal, please let me know.

@mschwrdtnr
Copy link
Author

Hi @aristosvo ! Thanks for your reply.

Sorry, I don't understand what example you want me to provide with az. I want to use the following terraform code to rename the infrastructure resource group. It should not be necessary to set workload_profile to use infrastructure_resource_group_name. Like I wrote: I am getting an error if I not specify workload_profile but I dont want to because I use consumption only.

resource "azurerm_container_app_environment" "cae_test" {
  name                           = "cae-name"
  location                       = var.location
  resource_group_name            = "rg-cae-test"
  infrastructure_subnet_id       = <subnet-id>
  internal_load_balancer_enabled = true
  infrastructure_resource_group_name = "rg-cae-test-aks"
}

@aristosvo
Copy link
Collaborator

Hi @mschwrdtnr !

I think this is simply not possible and available as functionality in the Azure REST APIs.

The easiest to invalidate that is that you have proof that it is possible via other (azapi or non-terraform) ways to do the things you want. In that case I'll simply backtrack their interaction with the Azure REST APIs and implement it in azurerm.

@mschwrdtnr
Copy link
Author

mschwrdtnr commented Feb 21, 2024

@aristosvo Ahh got it! Thanks for the clarification. I'll try to test it.

@AurimasNav
Copy link

AurimasNav commented Feb 28, 2024

I was able to provision container apps environment specifying infrastructure resource group name and without workload profile via az cli:

az extension add --name containerapp
az containerapp env create -n web-platform -g web-platform --location northeurope --infrastructure-resource-group managed-container-app --infrastructure-subnet-resource-id "/subscriptions/<edited>/resourceGroups/infrastructure/providers/Microsoft.Network/virtualNetworks/dev/subnets/container_app_env"

terraform code:

resource "azurerm_container_app_environment" "web_platform" {
  name                               = "web-platform"
  location                           = azurerm_resource_group.web_platform.location
  resource_group_name                = azurerm_resource_group.web_platform.name
  infrastructure_subnet_id           = azurerm_subnet.subnets["container_app_env"].id
  infrastructure_resource_group_name = "managed-container-app"
  tags                               = local.tags
}

result:

│ Error: Unsupported argument
│ 
│   on container_app.tf line 46, in resource "azurerm_container_app_environment" "web_platform":
│   46:   infrastructure_resource_group_name = "managed-container-app"
│ 
│ An argument named "infrastructure_resource_group_name" is not expected here.
╵

@mschwrdtnr
Copy link
Author

This issue was fixed by #25285

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants