azurermSpringCloudService
Manages an Azure Spring Cloud Service.
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 azurermApplicationInsightsExample =
new azurerm.applicationInsights.ApplicationInsights(this, "example_2", {
application_type: "web",
location: azurermResourceGroupExample.location,
name: "tf-test-appinsights",
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.*/
azurermApplicationInsightsExample.overrideLogicalId("example");
const azurermSpringCloudServiceExample =
new azurerm.springCloudService.SpringCloudService(this, "example_3", {
config_server_git_setting: [
{
label: "config",
search_paths: ["dir1", "dir2"],
uri: "https://github.com/Azure-Samples/piggymetrics",
},
],
location: azurermResourceGroupExample.location,
name: "example-springcloud",
resource_group_name: azurermResourceGroupExample.name,
sku_name: "S0",
tags: {
Env: "staging",
},
trace: [
{
connection_string: azurermApplicationInsightsExample.connectionString,
sample_rate: 10,
},
],
});
/*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");
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the Spring Cloud Service resource. 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 Service. Changing this forces a new resource to be created. -
location
- (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -
logStreamPublicEndpointEnabled
- (Optional) Should the log stream in vnet injection instance could be accessed from Internet? -
buildAgentPoolSize
- (Optional) Specifies the size for this Spring Cloud Service's default build agent pool. Possible values ares1
,s2
,s3
,s4
ands5
. This field is applicable only for Spring Cloud Service with enterprise tier. -
skuName
- (Optional) Specifies the SKU Name for this Spring Cloud Service. Possible values areb0
,s0
ande0
. Defaults tos0
. Changing this forces a new resource to be created. -
network
- (Optional) Anetwork
block as defined below. Changing this forces a new resource to be created. -
configServerGitSetting
- (Optional) AconfigServerGitSetting
block as defined below. This field is applicable only for Spring Cloud Service with basic and standard tier. -
serviceRegistryEnabled
- (Optional) Whether enable the default Service Registry. This field is applicable only for Spring Cloud Service with enterprise tier. -
trace
- (Optional) Atrace
block as defined below. -
tags
- (Optional) A mapping of tags to assign to the resource. -
zoneRedundant
- (Optional) Whether zone redundancy is enabled for this Spring Cloud Service. Defaults tofalse
.
The network
block supports the following:
-
appSubnetId
- (Required) Specifies the ID of the Subnet which should host the Spring Boot Applications deployed in this Spring Cloud Service. Changing this forces a new resource to be created. -
serviceRuntimeSubnetId
- (Required) Specifies the ID of the Subnet where the Service Runtime components of the Spring Cloud Service will exist. Changing this forces a new resource to be created. -
cidrRanges
- (Required) A list of (at least 3) CIDR ranges (at least /16) which are used to host the Spring Cloud infrastructure, which must not overlap with any existing CIDR ranges in the Subnet. Changing this forces a new resource to be created. -
appNetworkResourceGroup
- (Optional) Specifies the Name of the resource group containing network resources of Azure Spring Cloud Apps. Changing this forces a new resource to be created. -
readTimeoutSeconds
- (Optional) Ingress read time out in seconds. -
serviceRuntimeNetworkResourceGroup
- (Optional) Specifies the Name of the resource group containing network resources of Azure Spring Cloud Service Runtime. Changing this forces a new resource to be created.
The configServerGitSetting
block supports the following:
-
uri
- (Required) The URI of the default Git repository used as the Config Server back end, should be started withhttp://
,https://
,git@
, orssh://
. -
label
- (Optional) The default label of the Git repository, should be the branch name, tag name, or commit-id of the repository. -
searchPaths
- (Optional) An array of strings used to search subdirectories of the Git repository. -
httpBasicAuth
- (Optional) AhttpBasicAuth
block as defined below. -
sshAuth
- (Optional) AsshAuth
block as defined below. -
repository
- (Optional) One or morerepository
blocks as defined below.
The repository
block supports the following:
-
name
- (Required) A name to identify on the Git repository, required only if repos exists. -
uri
- (Required) The URI of the Git repository that's used as the Config Server back end should be started withhttp://
,https://
,git@
, orssh://
. -
pattern
- (Optional) An array of strings used to match an application name. For each pattern, use the{application}/{profile}
format with wildcards. -
label
- (Optional) The default label of the Git repository, should be the branch name, tag name, or commit-id of the repository. -
searchPaths
- (Optional) An array of strings used to search subdirectories of the Git repository. -
httpBasicAuth
- (Optional) AhttpBasicAuth
block as defined below. -
sshAuth
- (Optional) AsshAuth
block as defined below.
The httpBasicAuth
block supports the following:
-
username
- (Required) The username that's used to access the Git repository server, required when the Git repository server supports HTTP Basic Authentication. -
password
- (Required) The password used to access the Git repository server, required when the Git repository server supports HTTP Basic Authentication.
The sshAuth
block supports the following:
-
privateKey
- (Required) The SSH private key to access the Git repository, required when the URI starts withgit@
orssh://
. -
hostKey
- (Optional) The host key of the Git repository server, should not include the algorithm prefix as covered byhostKeyAlgorithm
. -
hostKeyAlgorithm
- (Optional) The host key algorithm, should besshDss
,sshRsa
,ecdsaSha2Nistp256
,ecdsaSha2Nistp384
, orecdsaSha2Nistp521
. Required only ifhostKey
exists. -
strictHostKeyCheckingEnabled
- (Optional) Indicates whether the Config Server instance will fail to start if the host_key does not match. Defaults totrue
.
The trace
block supports the following:
-
connectionString
- (Optional) The connection string used for Application Insights. -
sampleRate
- (Optional) The sampling rate of Application Insights Agent. Must be between00
and1000
. Defaults to100
.
Attributes Reference
The following attributes are exported:
-
id
- The ID of the Spring Cloud Service. -
serviceRegistryId
- The ID of the Spring Cloud Service Registry. -
outboundPublicIpAddresses
- A list of the outbound Public IP Addresses used by this Spring Cloud Service. -
requiredNetworkTrafficRules
- A list ofrequiredNetworkTrafficRules
blocks as defined below.
The requiredNetworkTrafficRules
block supports the following:
-
direction
- The direction of required traffic. Possible values areinbound
,outbound
. -
fqdns
- The FQDN list of required traffic. -
ipAddresses
- The IP list of required traffic. -
port
- The port of required traffic. -
protocol
- The protocol of required traffic.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 60 minutes) Used when creating the Spring Cloud Service.update
- (Defaults to 30 minutes) Used when updating the Spring Cloud Service.read
- (Defaults to 5 minutes) Used when retrieving the Spring Cloud Service.delete
- (Defaults to 30 minutes) Used when deleting the Spring Cloud Service.
Import
Spring Cloud services can be imported using the resourceId
, e.g.