All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.network.TrafficManagerProfile Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.network;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.network.TrafficManagerProfileArgs;
import com.pulumi.azure.network.inputs.TrafficManagerProfileState;
import com.pulumi.azure.network.outputs.TrafficManagerProfileDnsConfig;
import com.pulumi.azure.network.outputs.TrafficManagerProfileMonitorConfig;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Traffic Manager Profile to which multiple endpoints can be attached.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Traffic Manager Profiles can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:network/trafficManagerProfile:TrafficManagerProfile exampleProfile /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/trafficManagerProfiles/mytrafficmanagerprofile1 * ``` * */ @ResourceType(type="azure:network/trafficManagerProfile:TrafficManagerProfile") public class TrafficManagerProfile extends com.pulumi.resources.CustomResource { /** * This block specifies the DNS configuration of the Profile. One `dns_config` block as defined below. * */ @Export(name="dnsConfig", refs={TrafficManagerProfileDnsConfig.class}, tree="[0]") private Output dnsConfig; /** * @return This block specifies the DNS configuration of the Profile. One `dns_config` block as defined below. * */ public Output dnsConfig() { return this.dnsConfig; } /** * The FQDN of the created Profile. * */ @Export(name="fqdn", refs={String.class}, tree="[0]") private Output fqdn; /** * @return The FQDN of the created Profile. * */ public Output fqdn() { return this.fqdn; } /** * The amount of endpoints to return for DNS queries to this Profile. Possible values range from `1` to `8`. * * > **NOTE:** `max_return` must be set when the `traffic_routing_method` is `MultiValue`. * */ @Export(name="maxReturn", refs={Integer.class}, tree="[0]") private Output maxReturn; /** * @return The amount of endpoints to return for DNS queries to this Profile. Possible values range from `1` to `8`. * * > **NOTE:** `max_return` must be set when the `traffic_routing_method` is `MultiValue`. * */ public Output> maxReturn() { return Codegen.optional(this.maxReturn); } /** * This block specifies the Endpoint monitoring configuration for the Profile. One `monitor_config` block as defined below. * */ @Export(name="monitorConfig", refs={TrafficManagerProfileMonitorConfig.class}, tree="[0]") private Output monitorConfig; /** * @return This block specifies the Endpoint monitoring configuration for the Profile. One `monitor_config` block as defined below. * */ public Output monitorConfig() { return this.monitorConfig; } /** * The name of the Traffic Manager profile. Changing this forces a new resource to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the Traffic Manager profile. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * The status of the profile, can be set to either `Enabled` or `Disabled`. Defaults to `Enabled`. * */ @Export(name="profileStatus", refs={String.class}, tree="[0]") private Output profileStatus; /** * @return The status of the profile, can be set to either `Enabled` or `Disabled`. Defaults to `Enabled`. * */ public Output> profileStatus() { return Codegen.optional(this.profileStatus); } /** * The name of the resource group in which to create the Traffic Manager profile. Changing this forces a new resource to be created. * */ @Export(name="resourceGroupName", refs={String.class}, tree="[0]") private Output resourceGroupName; /** * @return The name of the resource group in which to create the Traffic Manager profile. Changing this forces a new resource to be created. * */ public Output resourceGroupName() { return this.resourceGroupName; } /** * A mapping of tags to assign to the resource. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags to assign to the resource. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Specifies the algorithm used to route traffic. Possible values are `Geographic`, `Weighted`, `Performance`, `Priority`, `Subnet` and `MultiValue`. * * `Geographic` - Traffic is routed based on Geographic regions specified in the Endpoint. * * `MultiValue` - All healthy Endpoints are returned. MultiValue routing method works only if all the endpoints of type `External` and are specified as IPv4 or IPv6 addresses. * * `Performance` - Traffic is routed via the User's closest Endpoint * * `Priority` - Traffic is routed to the Endpoint with the lowest `priority` value. * * `Subnet` - Traffic is routed based on a mapping of sets of end-user IP address ranges to a specific Endpoint within a Traffic Manager profile. * * `Weighted` - Traffic is spread across Endpoints proportional to their `weight` value. * */ @Export(name="trafficRoutingMethod", refs={String.class}, tree="[0]") private Output trafficRoutingMethod; /** * @return Specifies the algorithm used to route traffic. Possible values are `Geographic`, `Weighted`, `Performance`, `Priority`, `Subnet` and `MultiValue`. * * `Geographic` - Traffic is routed based on Geographic regions specified in the Endpoint. * * `MultiValue` - All healthy Endpoints are returned. MultiValue routing method works only if all the endpoints of type `External` and are specified as IPv4 or IPv6 addresses. * * `Performance` - Traffic is routed via the User's closest Endpoint * * `Priority` - Traffic is routed to the Endpoint with the lowest `priority` value. * * `Subnet` - Traffic is routed based on a mapping of sets of end-user IP address ranges to a specific Endpoint within a Traffic Manager profile. * * `Weighted` - Traffic is spread across Endpoints proportional to their `weight` value. * */ public Output trafficRoutingMethod() { return this.trafficRoutingMethod; } /** * Indicates whether Traffic View is enabled for the Traffic Manager profile. * */ @Export(name="trafficViewEnabled", refs={Boolean.class}, tree="[0]") private Output trafficViewEnabled; /** * @return Indicates whether Traffic View is enabled for the Traffic Manager profile. * */ public Output> trafficViewEnabled() { return Codegen.optional(this.trafficViewEnabled); } /** * * @param name The _unique_ name of the resulting resource. */ public TrafficManagerProfile(java.lang.String name) { this(name, TrafficManagerProfileArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public TrafficManagerProfile(java.lang.String name, TrafficManagerProfileArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public TrafficManagerProfile(java.lang.String name, TrafficManagerProfileArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:network/trafficManagerProfile:TrafficManagerProfile", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private TrafficManagerProfile(java.lang.String name, Output id, @Nullable TrafficManagerProfileState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:network/trafficManagerProfile:TrafficManagerProfile", name, state, makeResourceOptions(options, id), false); } private static TrafficManagerProfileArgs makeArgs(TrafficManagerProfileArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? TrafficManagerProfileArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure:trafficmanager/profile:Profile").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static TrafficManagerProfile get(java.lang.String name, Output id, @Nullable TrafficManagerProfileState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new TrafficManagerProfile(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy