com.pulumi.azure.network.TrafficManagerAzureEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.TrafficManagerAzureEndpointArgs;
import com.pulumi.azure.network.inputs.TrafficManagerAzureEndpointState;
import com.pulumi.azure.network.outputs.TrafficManagerAzureEndpointCustomHeader;
import com.pulumi.azure.network.outputs.TrafficManagerAzureEndpointSubnet;
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.Optional;
import javax.annotation.Nullable;
/**
* Manages an Azure Endpoint within a Traffic Manager Profile.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.network.PublicIp;
* import com.pulumi.azure.network.PublicIpArgs;
* 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 com.pulumi.azure.network.TrafficManagerAzureEndpoint;
* import com.pulumi.azure.network.TrafficManagerAzureEndpointArgs;
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
*
* var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
* .name("example-public-ip")
* .location(example.location())
* .resourceGroupName(example.name())
* .allocationMethod("Static")
* .domainNameLabel("example-public-ip")
* .build());
*
* var exampleTrafficManagerProfile = new TrafficManagerProfile("exampleTrafficManagerProfile", TrafficManagerProfileArgs.builder()
* .name("example-profile")
* .resourceGroupName(example.name())
* .trafficRoutingMethod("Weighted")
* .dnsConfig(TrafficManagerProfileDnsConfigArgs.builder()
* .relativeName("example-profile")
* .ttl(100)
* .build())
* .monitorConfig(TrafficManagerProfileMonitorConfigArgs.builder()
* .protocol("HTTP")
* .port(80)
* .path("/")
* .intervalInSeconds(30)
* .timeoutInSeconds(9)
* .toleratedNumberOfFailures(3)
* .build())
* .tags(Map.of("environment", "Production"))
* .build());
*
* var exampleTrafficManagerAzureEndpoint = new TrafficManagerAzureEndpoint("exampleTrafficManagerAzureEndpoint", TrafficManagerAzureEndpointArgs.builder()
* .name("example-endpoint")
* .profileId(exampleTrafficManagerProfile.id())
* .alwaysServeEnabled(true)
* .weight(100)
* .targetResourceId(examplePublicIp.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Azure Endpoints can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:network/trafficManagerAzureEndpoint:TrafficManagerAzureEndpoint example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Network/trafficManagerProfiles/example-profile/AzureEndpoints/example-endpoint
* ```
*
*/
@ResourceType(type="azure:network/trafficManagerAzureEndpoint:TrafficManagerAzureEndpoint")
public class TrafficManagerAzureEndpoint extends com.pulumi.resources.CustomResource {
/**
* If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic routing method. Defaults to `false`.
*
*/
@Export(name="alwaysServeEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> alwaysServeEnabled;
/**
* @return If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic routing method. Defaults to `false`.
*
*/
public Output> alwaysServeEnabled() {
return Codegen.optional(this.alwaysServeEnabled);
}
/**
* One or more `custom_header` blocks as defined below.
*
*/
@Export(name="customHeaders", refs={List.class,TrafficManagerAzureEndpointCustomHeader.class}, tree="[0,1]")
private Output* @Nullable */ List> customHeaders;
/**
* @return One or more `custom_header` blocks as defined below.
*
*/
public Output>> customHeaders() {
return Codegen.optional(this.customHeaders);
}
/**
* Is the endpoint enabled? Defaults to `true`.
*
*/
@Export(name="enabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enabled;
/**
* @return Is the endpoint enabled? Defaults to `true`.
*
*/
public Output> enabled() {
return Codegen.optional(this.enabled);
}
/**
* 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](https://docs.microsoft.com/rest/api/trafficmanager/geographichierarchies/getdefault).
*
*/
@Export(name="geoMappings", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> geoMappings;
/**
* @return 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](https://docs.microsoft.com/rest/api/trafficmanager/geographichierarchies/getdefault).
*
*/
public Output>> geoMappings() {
return Codegen.optional(this.geoMappings);
}
/**
* The name of the Azure Endpoint. 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 Azure Endpoint. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* 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. Defaults to `1`.
*
*/
@Export(name="priority", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> priority;
/**
* @return 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. Defaults to `1`.
*
*/
public Output> priority() {
return Codegen.optional(this.priority);
}
/**
* The ID of the Traffic Manager Profile that this Azure Endpoint should be created within. Changing this forces a new resource to be created.
*
*/
@Export(name="profileId", refs={String.class}, tree="[0]")
private Output profileId;
/**
* @return The ID of the Traffic Manager Profile that this Azure Endpoint should be created within. Changing this forces a new resource to be created.
*
*/
public Output profileId() {
return this.profileId;
}
/**
* One or more `subnet` blocks as defined below. Changing this forces a new resource to be created.
*
*/
@Export(name="subnets", refs={List.class,TrafficManagerAzureEndpointSubnet.class}, tree="[0,1]")
private Output* @Nullable */ List> subnets;
/**
* @return One or more `subnet` blocks as defined below. Changing this forces a new resource to be created.
*
*/
public Output>> subnets() {
return Codegen.optional(this.subnets);
}
/**
* The ID of the Azure Resource which should be used as a target.
*
*/
@Export(name="targetResourceId", refs={String.class}, tree="[0]")
private Output targetResourceId;
/**
* @return The ID of the Azure Resource which should be used as a target.
*
*/
public Output targetResourceId() {
return this.targetResourceId;
}
/**
* 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`. Defaults to `1`.
*
*/
@Export(name="weight", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> weight;
/**
* @return 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`. Defaults to `1`.
*
*/
public Output> weight() {
return Codegen.optional(this.weight);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public TrafficManagerAzureEndpoint(java.lang.String name) {
this(name, TrafficManagerAzureEndpointArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public TrafficManagerAzureEndpoint(java.lang.String name, TrafficManagerAzureEndpointArgs 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 TrafficManagerAzureEndpoint(java.lang.String name, TrafficManagerAzureEndpointArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:network/trafficManagerAzureEndpoint:TrafficManagerAzureEndpoint", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private TrafficManagerAzureEndpoint(java.lang.String name, Output id, @Nullable TrafficManagerAzureEndpointState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:network/trafficManagerAzureEndpoint:TrafficManagerAzureEndpoint", name, state, makeResourceOptions(options, id), false);
}
private static TrafficManagerAzureEndpointArgs makeArgs(TrafficManagerAzureEndpointArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? TrafficManagerAzureEndpointArgs.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())
.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 TrafficManagerAzureEndpoint get(java.lang.String name, Output id, @Nullable TrafficManagerAzureEndpointState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new TrafficManagerAzureEndpoint(name, id, state, options);
}
}