Manages an Active Azure Spring Cloud Deployment.
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_spring_cloud_service" "example" {
name = "example-springcloud"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
}
resource "azurerm_spring_cloud_app" "example" {
name = "example-springcloudapp"
resource_group_name = azurerm_resource_group.example.name
service_name = azurerm_spring_cloud_service.example.name
identity {
type = "SystemAssigned"
}
}
resource "azurerm_spring_cloud_java_deployment" "example" {
name = "deploy1"
spring_cloud_app_id = azurerm_spring_cloud_app.example.id
instance_count = 2
jvm_options = "-XX:+PrintGC"
runtime_version = "Java_11"
quota {
cpu = "2"
memory = "4Gi"
}
environment_variables = {
"Env" : "Staging"
}
}
resource "azurerm_spring_cloud_active_deployment" "example" {
spring_cloud_app_id = azurerm_spring_cloud_app.example.id
deployment_name = azurerm_spring_cloud_java_deployment.example.name
}
The following arguments are supported:
spring_cloud_app_id
- (Required) Specifies the id of the Spring Cloud Application. Changing this forces a new resource to be created.
deployment_name
- (Required) Specifies the name of Spring Cloud Deployment which is going to be active.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Spring Cloud Active Deployment.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Spring Cloud Active Deployment.read
- (Defaults to 5 minutes) Used when retrieving the Spring Cloud Active Deployment.update
- (Defaults to 30 minutes) Used when updating the Spring Cloud Active Deployment.delete
- (Defaults to 30 minutes) Used when deleting the Spring Cloud Active Deployment.Spring Cloud Active Deployment can be imported using the resource id
, e.g.
terraform import azurerm_spring_cloud_active_deployment.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourcegroup1/providers/Microsoft.AppPlatform/spring/service1/apps/app1