Skip to content

azurermTrafficManagerNestedEndpoint

Manages a Nested 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 azurermTrafficManagerProfileNested =
  new azurerm.trafficManagerProfile.TrafficManagerProfile(this, "nested", {
    dns_config: [
      {
        relative_name: "nested-profile",
        ttl: 30,
      },
    ],
    monitor_config: [
      {
        path: "/",
        port: 443,
        protocol: "HTTP",
      },
    ],
    name: "nested-profile",
    resource_group_name: azurermResourceGroupExample.name,
    traffic_routing_method: "Priority",
  });
const azurermTrafficManagerProfileParent =
  new azurerm.trafficManagerProfile.TrafficManagerProfile(this, "parent", {
    dns_config: [
      {
        relative_name: "parent-profile",
        ttl: 100,
      },
    ],
    monitor_config: [
      {
        interval_in_seconds: 30,
        path: "/",
        port: 80,
        protocol: "HTTP",
        timeout_in_seconds: 9,
        tolerated_number_of_failures: 3,
      },
    ],
    name: "parent-profile",
    resource_group_name: azurermResourceGroupExample.name,
    tags: {
      environment: "Production",
    },
    traffic_routing_method: "Weighted",
  });
const azurermPublicIpExample = new azurerm.publicIp.PublicIp(
  this,
  "example_3",
  {
    allocation_method: "Static",
    domain_name_label: "example-pip",
    location: azurermResourceGroupExample.location,
    name: "example-publicip",
    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.*/
azurermPublicIpExample.overrideLogicalId("example");
const azurermTrafficManagerNestedEndpointExample =
  new azurerm.trafficManagerNestedEndpoint.TrafficManagerNestedEndpoint(
    this,
    "example_4",
    {
      minimum_child_endpoints: 9,
      name: "example-endpoint",
      priority: 1,
      profile_id: azurermTrafficManagerProfileParent.id,
      target_resource_id: azurermTrafficManagerProfileNested.id,
      weight: 5,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermTrafficManagerNestedEndpointExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • minimumChildEndpoints - (Required) This argument specifies the minimum number of endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This value must be larger than 0.

\~>NOTE: If minChildEndpoints is less than either minimumRequiredChildEndpointsIpv4 or minimumRequiredChildEndpointsIpv6, then it won't have any effect.

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

  • targetResourceId - (Required) The resource id of an Azure resource to 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 between 1 and 1000.


  • customHeader - (Optional) One or more customHeader blocks as defined below.

  • enabled - (Optional) Is the endpoint enabled? Defaults to true.

  • endpointLocation - (Optional) Specifies the Azure location of the Endpoint, this must be specified for Profiles using the performance routing method.

  • minimumRequiredChildEndpointsIpv4 - (Optional) This argument specifies the minimum number of IPv4 (DNS record type A) endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This argument only applies to Endpoints of type nestedEndpoints and

  • minimumRequiredChildEndpointsIpv6 - (Optional) This argument specifies the minimum number of IPv6 (DNS record type AAAA) endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This argument only applies to Endpoints of type nestedEndpoints and

  • priority - (Optional) Specifies the priority of this Endpoint, this must be specified for Profiles using the priority 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.

  • geoMappings - (Optional) A list of Geographic Regions used to distribute traffic, such as world, uk or de. The same location can't be specified in two endpoints. See the Geographic Hierarchies documentation for more information.

  • subnet - (Optional) One or more subnet 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 Nested Endpoint.

Timeouts

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

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

Import

Nested Endpoints can be imported using the resourceId, e.g.

terraform import azurerm_traffic_manager_nested_endpoint.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Network/trafficManagerProfiles/example-profile/NestedEndpoints/example-endpoint