Skip to content

azurermSpringCloudContainerDeployment

Manages a Spring Cloud Container 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",
  }
);
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 azurermSpringCloudContainerDeploymentExample =
  new azurerm.springCloudContainerDeployment.SpringCloudContainerDeployment(
    this,
    "example_4",
    {
      arguments: [
        "-cp",
        "/app/resources:/app/classes:/app/libs/*",
        "hello.Application",
      ],
      commands: ["java"],
      environment_variables: [
        {
          Env: "Staging",
          Foo: "Bar",
        },
      ],
      image: "springio/gs-spring-boot-docker",
      instance_count: 2,
      language_framework: "springboot",
      name: "example",
      server: "docker.io",
      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.*/
azurermSpringCloudContainerDeploymentExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

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

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

  • image - (Required) Container image of the custom container. This should be in the form of <repository>:<tag> without the server name of the registry.

  • server - (Required) The name of the registry that contains the container image.


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

  • arguments - (Optional) Specifies the arguments to the entrypoint. The docker image's cmd is used if not specified.

  • commands - (Optional) Specifies the entrypoint array. It will not be executed within a shell. The docker image's entrypoint is used if not specified.

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

  • languageFramework - (Optional) Specifies the language framework of the container image. The only possible value is springboot.

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

Timeouts

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

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

Import

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

terraform import azurerm_spring_cloud_container_deployment.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.AppPlatform/spring/spring1/apps/app1/deployments/deploy1