azurermTrafficManagerExternalEndpoint
Manages an External Endpoint within a Traffic Manager Profile.
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.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermTrafficManagerProfileExample =
new azurerm.trafficManagerProfile.TrafficManagerProfile(this, "example_1", {
dns_config: [
{
relative_name: "example-profile",
ttl: 100,
},
],
monitor_config: [
{
interval_in_seconds: 30,
path: "/",
port: 80,
protocol: "HTTP",
timeout_in_seconds: 9,
tolerated_number_of_failures: 3,
},
],
name: "example-profile",
resource_group_name: azurermResourceGroupExample.name,
tags: {
environment: "Production",
},
traffic_routing_method: "Weighted",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermTrafficManagerProfileExample.overrideLogicalId("example");
const azurermTrafficManagerExternalEndpointExample =
new azurerm.trafficManagerExternalEndpoint.TrafficManagerExternalEndpoint(
this,
"example_2",
{
name: "example-endpoint",
profile_id: azurermTrafficManagerProfileExample.id,
target: "www.example.com",
weight: 100,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermTrafficManagerExternalEndpointExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the External Endpoint. Changing this forces a new resource to be created. -
profileId
- (Required) The ID of the Traffic Manager Profile that this External Endpoint should be created within. Changing this forces a new resource to be created. -
target
- (Required) The FQDN DNS name of the target. -
weight
- (Optional) Specifies how much traffic should be distributed to this endpoint, this must be specified for Profiles using the Weighted traffic routing method. Valid values are between1
and1000
. -
endpointLocation
- (Optional) Specifies the Azure location of the Endpoint, this must be specified for Profiles using theperformance
routing method.
-
customHeader
- (Optional) One or morecustomHeader
blocks as defined below. -
enabled
- (Optional) Is the endpoint enabled? Defaults totrue
. -
geoMappings
- (Optional) A list of Geographic Regions used to distribute traffic, such asworld
,uk
orde
. The same location can't be specified in two endpoints. See the Geographic Hierarchies documentation for more information. -
priority
- (Optional) Specifies the priority of this Endpoint, this must be specified for Profiles using thepriority
traffic routing method. Supports values between 1 and 1000, with no Endpoints sharing the same value. If omitted the value will be computed in order of creation. -
subnet
- (Optional) One or moresubnet
blocks as defined below. Changing this forces a new resource to be created.
A customHeader
block supports the following:
-
name
- (Required) The name of the custom header. -
value
- (Required) The value of custom header. Applicable for HTTP and HTTPS protocol.
A subnet
block supports the following:
-
first
- (Required) The first IP Address in this subnet. -
last
- (Optional) The last IP Address in this subnet. -
scope
- (Optional) The block size (number of leading bits in the subnet mask).
Attributes Reference
The following attributes are exported:
id
- The ID of the External Endpoint.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the External Endpoint.update
- (Defaults to 30 minutes) Used when updating the External Endpoint.read
- (Defaults to 5 minutes) Used when retrieving the External Endpoint.delete
- (Defaults to 30 minutes) Used when deleting the External Endpoint.
Import
External Endpoints can be imported using the resourceId
, e.g.