Skip to content

azurermSpringCloudActiveDeployment

Manages an Active Azure Spring Cloud Deployment.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermSpringCloudServiceExample =
  new azurerm.springCloudService.SpringCloudService(this, "example_2", {
    location: azurermResourceGroupExample.location,
    name: "example-springcloud",
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudServiceExample.overrideLogicalId("example");
const azurermSpringCloudAppExample = new azurerm.springCloudApp.SpringCloudApp(
  this,
  "example_3",
  {
    identity: [
      {
        type: "SystemAssigned",
      },
    ],
    name: "example-springcloudapp",
    resource_group_name: azurermResourceGroupExample.name,
    service_name: azurermSpringCloudServiceExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudAppExample.overrideLogicalId("example");
const azurermSpringCloudJavaDeploymentExample =
  new azurerm.springCloudJavaDeployment.SpringCloudJavaDeployment(
    this,
    "example_4",
    {
      environment_variables: [
        {
          Env: "Staging",
        },
      ],
      instance_count: 2,
      jvm_options: "-XX:+PrintGC",
      name: "deploy1",
      quota: [
        {
          cpu: "2",
          memory: "4Gi",
        },
      ],
      runtime_version: "Java_11",
      spring_cloud_app_id: azurermSpringCloudAppExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudJavaDeploymentExample.overrideLogicalId("example");
const azurermSpringCloudActiveDeploymentExample =
  new azurerm.springCloudActiveDeployment.SpringCloudActiveDeployment(
    this,
    "example_5",
    {
      deployment_name: azurermSpringCloudJavaDeploymentExample.name,
      spring_cloud_app_id: azurermSpringCloudAppExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSpringCloudActiveDeploymentExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • springCloudAppId - (Required) Specifies the id of the Spring Cloud Application. Changing this forces a new resource to be created.

  • deploymentName - (Required) Specifies the name of Spring Cloud Deployment which is going to be active.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Spring Cloud Active Deployment.

Timeouts

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.

Import

Spring Cloud Active Deployment can be imported using the resourceId, 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