Skip to content

azurermSpringCloudApp

Manage an Azure Spring Cloud Application.

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");

Argument Reference

The following arguments are supported:

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

  • resourceGroupName - (Required) Specifies the name of the resource group in which to create the Spring Cloud Application. Changing this forces a new resource to be created.

  • serviceName - (Required) Specifies the name of the Spring Cloud Service resource. Changing this forces a new resource to be created.

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

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

  • identity - (Optional) An identity block as defined below.

  • isPublic - (Optional) Does the Spring Cloud Application have public endpoint? Defaults to false.

  • httpsOnly - (Optional) Is only HTTPS allowed? Defaults to false.

  • ingressSettings - (Optional) An ingressSettings block as defined below.

  • persistentDisk - (Optional) An persistentDisk block as defined below.

  • publicEndpointEnabled - (Optional) Should the App in vnet injection instance exposes endpoint which could be accessed from Internet?

  • tlsEnabled - (Optional) Is End to End TLS Enabled? Defaults to false.


An customPersistentDisk block exports the following:

  • storageName - (Required) The name of the Spring Cloud Storage.

  • mountPath - (Required) The mount path of the persistent disk.

  • shareName - (Required) The share name of the Azure File share.

  • mountOptions - (Optional) These are the mount options for a persistent disk.

  • readOnlyEnabled - (Optional) Indicates whether the persistent disk is a readOnly one.


An identity block supports the following:

  • type - (Required) Specifies the type of Managed Service Identity that should be configured on this Spring Cloud Application. Possible values are systemAssigned, userAssigned, systemAssigned,UserAssigned (to enable both).

  • identityIds - (Optional) A list of User Assigned Managed Identity IDs to be assigned to this Spring Cloud Application.

\~> NOTE: This is required when type is set to userAssigned or systemAssigned,UserAssigned.


An ingressSettings block supports the following:

  • backendProtocol - (Optional) Specifies how ingress should communicate with this app backend service. Allowed values are grpc and default. Defaults to default.

  • readTimeoutInSeconds - (Optional) Specifies the ingress read time out in seconds. Defaults to 300.

  • sendTimeoutInSeconds - (Optional) Specifies the ingress send time out in seconds. Defaults to 60.

  • sessionAffinity - (Optional) Specifies the type of the affinity, set this to cookie to enable session affinity. Allowed values are cookie and none. Defaults to none.

  • sessionCookieMaxAge - (Optional) Specifies the time in seconds until the cookie expires.


An persistentDisk block supports the following:

  • sizeInGb - (Required) Specifies the size of the persistent disk in GB. Possible values are between 0 and 50.

  • mountPath - (Optional) Specifies the mount path of the persistent disk. Defaults to /persistent.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Spring Cloud Application.

  • fqdn - The Fully Qualified DNS Name of the Spring Application in the service.

  • url - The public endpoint of the Spring Cloud Application.


An identity block exports the following:

  • principalId - The Principal ID for the Service Principal associated with the Managed Service Identity of this Spring Cloud Application.

  • tenantId - The Tenant ID for the Service Principal associated with the Managed Service Identity of this Spring Cloud Application.

Timeouts

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

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

Import

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

terraform import azurerm_spring_cloud_app.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.AppPlatform/spring/myservice/apps/myapp