Skip to content

azurermSpringCloudBuildDeployment

Manages a Spring Cloud Build Deployment.

-> NOTE: This resource is applicable only for Spring Cloud Service with enterprise tier.

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",
  }
);
const azurermSpringCloudServiceExample =
  new azurerm.springCloudService.SpringCloudService(this, "example_2", {
    location: azurermResourceGroupExample.location,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "E0",
  });
/*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",
  {
    name: "example",
    resource_group_name: azurermSpringCloudServiceExample.resourceGroupName,
    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 azurermSpringCloudBuildDeploymentExample =
  new azurerm.springCloudBuildDeployment.SpringCloudBuildDeployment(
    this,
    "example_4",
    {
      build_result_id: "<default>",
      environment_variables: [
        {
          Env: "Staging",
          Foo: "Bar",
        },
      ],
      instance_count: 2,
      name: "example",
      quota: [
        {
          cpu: "2",
          memory: "4Gi",
        },
      ],
      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.*/
azurermSpringCloudBuildDeploymentExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Spring Cloud Build Deployment. Changing this forces a new Spring Cloud Build Deployment to be created.

  • springCloudAppId - (Required) The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud Build Deployment to be created.

  • buildResultId - (Required) The ID of the Spring Cloud Build Result.


  • addonJson - (Optional) A JSON object that contains the addon configurations of the Spring Cloud Build Deployment.

  • environmentVariables - (Optional) Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.

  • instanceCount - (Optional) Specifies the required instance count of the Spring Cloud Deployment. Possible Values are between 1 and 500. Defaults to 1 if not specified.

  • quota - (Optional) A quota block as defined below.


A 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.

-> Note: cpu supports 500M and 1 for Basic tier, 500M, 1, 2, 3 and 4 for Standard tier.

  • 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.

-> Note: memory supports 512Mi, 1Gi and 2Gi for Basic tier, 512Mi, 1Gi, 2Gi, 3Gi, 4Gi, 5Gi, 6Gi, 7Gi, and 8Gi for Standard tier.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

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

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Spring Cloud Build Deployment.
  • read - (Defaults to 5 minutes) Used when retrieving the Spring Cloud Build Deployment.
  • update - (Defaults to 30 minutes) Used when updating the Spring Cloud Build Deployment.
  • delete - (Defaults to 30 minutes) Used when deleting the Spring Cloud Build Deployment.

Import

Spring Cloud Build Deployments can be imported using the resourceId, e.g.

terraform import azurerm_spring_cloud_build_deployment.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.AppPlatform/spring/spring1/apps/app1/deployments/deploy1