Profile

class Profile : KotlinCustomResource

Deprecated

azure.trafficmanager.Profile has been deprecated in favor of azure.network.TrafficManagerProfile

Manages a Traffic Manager Profile to which multiple endpoints can be attached.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as random from "@pulumi/random";
const server = new random.RandomId("server", {
keepers: {
azi_id: "1",
},
byteLength: 8,
});
const example = new azure.core.ResourceGroup("example", {
name: "trafficmanagerProfile",
location: "West Europe",
});
const exampleTrafficManagerProfile = new azure.network.TrafficManagerProfile("example", {
name: server.hex,
resourceGroupName: example.name,
trafficRoutingMethod: "Weighted",
dnsConfig: {
relativeName: server.hex,
ttl: 100,
},
monitorConfig: {
protocol: "HTTP",
port: 80,
path: "/",
intervalInSeconds: 30,
timeoutInSeconds: 9,
toleratedNumberOfFailures: 3,
},
tags: {
environment: "Production",
},
});
import pulumi
import pulumi_azure as azure
import pulumi_random as random
server = random.RandomId("server",
keepers={
"azi_id": "1",
},
byte_length=8)
example = azure.core.ResourceGroup("example",
name="trafficmanagerProfile",
location="West Europe")
example_traffic_manager_profile = azure.network.TrafficManagerProfile("example",
name=server.hex,
resource_group_name=example.name,
traffic_routing_method="Weighted",
dns_config={
"relative_name": server.hex,
"ttl": 100,
},
monitor_config={
"protocol": "HTTP",
"port": 80,
"path": "/",
"interval_in_seconds": 30,
"timeout_in_seconds": 9,
"tolerated_number_of_failures": 3,
},
tags={
"environment": "Production",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var server = new Random.RandomId("server", new()
{
Keepers =
{
{ "azi_id", "1" },
},
ByteLength = 8,
});
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "trafficmanagerProfile",
Location = "West Europe",
});
var exampleTrafficManagerProfile = new Azure.Network.TrafficManagerProfile("example", new()
{
Name = server.Hex,
ResourceGroupName = example.Name,
TrafficRoutingMethod = "Weighted",
DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs
{
RelativeName = server.Hex,
Ttl = 100,
},
MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs
{
Protocol = "HTTP",
Port = 80,
Path = "/",
IntervalInSeconds = 30,
TimeoutInSeconds = 9,
ToleratedNumberOfFailures = 3,
},
Tags =
{
{ "environment", "Production" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{
Keepers: pulumi.StringMap{
"azi_id": pulumi.String("1"),
},
ByteLength: pulumi.Int(8),
})
if err != nil {
return err
}
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("trafficmanagerProfile"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = network.NewTrafficManagerProfile(ctx, "example", &network.TrafficManagerProfileArgs{
Name: server.Hex,
ResourceGroupName: example.Name,
TrafficRoutingMethod: pulumi.String("Weighted"),
DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{
RelativeName: server.Hex,
Ttl: pulumi.Int(100),
},
MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{
Protocol: pulumi.String("HTTP"),
Port: pulumi.Int(80),
Path: pulumi.String("/"),
IntervalInSeconds: pulumi.Int(30),
TimeoutInSeconds: pulumi.Int(9),
ToleratedNumberOfFailures: pulumi.Int(3),
},
Tags: pulumi.StringMap{
"environment": pulumi.String("Production"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.TrafficManagerProfile;
import com.pulumi.azure.network.TrafficManagerProfileArgs;
import com.pulumi.azure.network.inputs.TrafficManagerProfileDnsConfigArgs;
import com.pulumi.azure.network.inputs.TrafficManagerProfileMonitorConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var server = new RandomId("server", RandomIdArgs.builder()
.keepers(Map.of("azi_id", 1))
.byteLength(8)
.build());
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("trafficmanagerProfile")
.location("West Europe")
.build());
var exampleTrafficManagerProfile = new TrafficManagerProfile("exampleTrafficManagerProfile", TrafficManagerProfileArgs.builder()
.name(server.hex())
.resourceGroupName(example.name())
.trafficRoutingMethod("Weighted")
.dnsConfig(TrafficManagerProfileDnsConfigArgs.builder()
.relativeName(server.hex())
.ttl(100)
.build())
.monitorConfig(TrafficManagerProfileMonitorConfigArgs.builder()
.protocol("HTTP")
.port(80)
.path("/")
.intervalInSeconds(30)
.timeoutInSeconds(9)
.toleratedNumberOfFailures(3)
.build())
.tags(Map.of("environment", "Production"))
.build());
}
}
resources:
server:
type: random:RandomId
properties:
keepers:
azi_id: 1
byteLength: 8
example:
type: azure:core:ResourceGroup
properties:
name: trafficmanagerProfile
location: West Europe
exampleTrafficManagerProfile:
type: azure:network:TrafficManagerProfile
name: example
properties:
name: ${server.hex}
resourceGroupName: ${example.name}
trafficRoutingMethod: Weighted
dnsConfig:
relativeName: ${server.hex}
ttl: 100
monitorConfig:
protocol: HTTP
port: 80
path: /
intervalInSeconds: 30
timeoutInSeconds: 9
toleratedNumberOfFailures: 3
tags:
environment: Production

Import

Traffic Manager Profiles can be imported using the resource id, e.g.

$ pulumi import azure:trafficmanager/profile:Profile exampleProfile /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/trafficManagerProfiles/mytrafficmanagerprofile1

Properties

Link copied to clipboard

This block specifies the DNS configuration of the Profile. One dns_config block as defined below.

Link copied to clipboard
val fqdn: Output<String>

The FQDN of the created Profile.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val maxReturn: Output<Int>?

The amount of endpoints to return for DNS queries to this Profile. Possible values range from 1 to 8.

Link copied to clipboard

This block specifies the Endpoint monitoring configuration for the Profile. One monitor_config block as defined below.

Link copied to clipboard
val name: Output<String>

The name of the Traffic Manager profile. Changing this forces a new resource to be created.

Link copied to clipboard
val profileStatus: Output<String>?

The status of the profile, can be set to either Enabled or Disabled. Defaults to Enabled.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which to create the Traffic Manager profile. Changing this forces a new resource to be created.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard

Specifies the algorithm used to route traffic. Possible values are Geographic, Weighted, Performance, Priority, Subnet and MultiValue.

Link copied to clipboard

Indicates whether Traffic View is enabled for the Traffic Manager profile.

Link copied to clipboard
val urn: Output<String>