Azure / terraform-azure-modules

Azure verified modules for Terraform
MIT License
76 stars 28 forks source link

[Module]: Container Apps #15

Open lonegunmanb opened 1 year ago

lonegunmanb commented 1 year ago

Module Scenario

Pulumi wrote an interesting blog about Azure Container Apps, in this blog, they

  1. Created a container apps environment
  2. Created an Azure Container Registry
  3. Package a nodejs app into a docker container and push to the acr just created
  4. Created a container app by using the docker image just created

I'm thinking of a new Azure Verified Terraform module to support such scenarios, which also support configurable Dapr components. This module should be able to provision a modern microservice system with capability of scale down to zero.

Proposed module name

terraform-azure-container-apps

Link to existing example module

No response

Expected resources

- azurerm_container_app
- azurerm_container_app_environment
- azurerm_container_app_environment_dapr_component

Module inputs

yet to decide

Module outputs

No response

Other information

No response

zioproto commented 1 year ago

Please look also at this example from @paolosalvatori

paolosalvatori commented 1 year ago

Thanks @zioproto. @lonegunmanb, my article + sample:

use the brand new native resources in the Azure Terraform module:

- azurerm_container_app
- azurerm_container_app_environment
- azurerm_container_app_environment_dapr_component

I also submitted a couple of PRs, currently under review, to solve a couple of issues of the azurerm provider with Azure Container Apps.

• PR: Made the app_port property in the dapr block of the azurerm_container_app resource optional • PR: Made the traffic_weight block in the ingress block of the azurerm_container_app resource optional

lonegunmanb commented 1 year ago

Thanks @paolosalvatori, your tutorial helps me a lot!

I'd like to add more resource like azurerm_container_registry, docker_image into this new module, so the user can just give a folder path that contains Dockerfile, the module would build the image, upload it to ACR or the registry they'd like to use, then create or update the container app, WDYT? I'd like to try a serverless style module which can simplify the deployment of a serverless app.

paolosalvatori commented 1 year ago

Thanks @paolosalvatori, your tutorial helps me a lot!

I'd like to add more resource like azurerm_container_registry, docker_image into this new module, so the user can just give a folder path that contains Dockerfile, the module would build the image, upload it to ACR or the registry they'd like to use, then create or update the container app, WDYT? I'd like to try a serverless style module which can simplify the deployment of a serverless app.

I like the scenario you described. Feel free to fork my solution and eventually submit a PR 😸