Manages an Azure Spring Cloud Deployment with a Java runtime.
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"
quota {
cpu = "2"
memory = "4Gi"
}
runtime_version = "Java_11"
environment_variables = {
"Foo" : "Bar"
"Env" : "Staging"
}
}
The following arguments are supported:
name
- (Required) Specifies the name of the Spring Cloud Deployment. Changing this forces a new resource to be created.
spring_cloud_app_id
- (Required) Specifies the id of the Spring Cloud Application in which to create the Deployment. Changing this forces a new resource to be created.
environment_variables
- (Optional) Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
instance_count
- (Optional) Specifies the required instance count of the Spring Cloud Deployment. Possible Values are between 1
and 500
. Defaults to 1
if not specified.
jvm_options
- (Optional) Specifies the jvm option of the Spring Cloud Deployment.
quota
- (Optional) A quota
block as defined below.
runtime_version
- (Optional) Specifies the runtime version of the Spring Cloud Deployment. Possible Values are Java_8
, Java_11
and Java_17
. Defaults to Java_8
.
The quota
block supports the following:
cpu
- (Optional) Specifies the required cpu of the Spring Cloud Deployment. Possible Values are 500m
, 1
, 2
, 3
and 4
. Defaults to 1
if not specified.memory
- (Optional) Specifies the required memory size of the Spring Cloud Deployment. Possible Values are 512Mi
, 1Gi
, 2Gi
, 3Gi
, 4Gi
, 5Gi
, 6Gi
, 7Gi
, and 8Gi
. Defaults to 1Gi
if not specified.In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Spring Cloud Deployment.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Spring Cloud Deployment.read
- (Defaults to 5 minutes) Used when retrieving the Spring Cloud Deployment.update
- (Defaults to 30 minutes) Used when updating the Spring Cloud Deployment.delete
- (Defaults to 30 minutes) Used when deleting the Spring Cloud Deployment.Spring Cloud Deployment can be imported using the resource id
, e.g.
terraform import azurerm_spring_cloud_java_deployment.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourcegroup1/providers/Microsoft.AppPlatform/spring/service1/apps/app1/deployments/deploy1