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

com.pulumi.azurenative.network.ConnectionMonitor Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** 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.azurenative.network;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.network.ConnectionMonitorArgs;
import com.pulumi.azurenative.network.outputs.ConnectionMonitorDestinationResponse;
import com.pulumi.azurenative.network.outputs.ConnectionMonitorEndpointResponse;
import com.pulumi.azurenative.network.outputs.ConnectionMonitorOutputResponse;
import com.pulumi.azurenative.network.outputs.ConnectionMonitorSourceResponse;
import com.pulumi.azurenative.network.outputs.ConnectionMonitorTestConfigurationResponse;
import com.pulumi.azurenative.network.outputs.ConnectionMonitorTestGroupResponse;
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;

/**
 * Information about the connection monitor.
 * Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01.
 * 
 * Other available API versions: 2019-09-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01.
 * 
 * ## Example Usage
 * ### Create connection monitor V1
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.network.ConnectionMonitor;
 * import com.pulumi.azurenative.network.ConnectionMonitorArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorEndpointArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorTestConfigurationArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorTcpConfigurationArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorTestGroupArgs;
 * 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 connectionMonitor = new ConnectionMonitor("connectionMonitor", ConnectionMonitorArgs.builder()
 *             .connectionMonitorName("cm1")
 *             .endpoints(            
 *                 ConnectionMonitorEndpointArgs.builder()
 *                     .name("source")
 *                     .resourceId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1")
 *                     .build(),
 *                 ConnectionMonitorEndpointArgs.builder()
 *                     .address("bing.com")
 *                     .name("destination")
 *                     .build())
 *             .location("eastus")
 *             .networkWatcherName("nw1")
 *             .resourceGroupName("rg1")
 *             .testConfigurations(ConnectionMonitorTestConfigurationArgs.builder()
 *                 .name("tcp")
 *                 .protocol("Tcp")
 *                 .tcpConfiguration(ConnectionMonitorTcpConfigurationArgs.builder()
 *                     .port(80)
 *                     .build())
 *                 .testFrequencySec(60)
 *                 .build())
 *             .testGroups(ConnectionMonitorTestGroupArgs.builder()
 *                 .destinations("destination")
 *                 .name("tg")
 *                 .sources("source")
 *                 .testConfigurations("tcp")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create connection monitor V2 * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.network.ConnectionMonitor;
 * import com.pulumi.azurenative.network.ConnectionMonitorArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorEndpointArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorEndpointFilterArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorTestConfigurationArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorTcpConfigurationArgs;
 * import com.pulumi.azurenative.network.inputs.ConnectionMonitorTestGroupArgs;
 * 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 connectionMonitor = new ConnectionMonitor("connectionMonitor", ConnectionMonitorArgs.builder()
 *             .connectionMonitorName("cm1")
 *             .endpoints(            
 *                 ConnectionMonitorEndpointArgs.builder()
 *                     .name("vm1")
 *                     .resourceId("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1")
 *                     .build(),
 *                 ConnectionMonitorEndpointArgs.builder()
 *                     .filter(ConnectionMonitorEndpointFilterArgs.builder()
 *                         .items(ConnectionMonitorEndpointFilterItemArgs.builder()
 *                             .address("npmuser")
 *                             .type("AgentAddress")
 *                             .build())
 *                         .type("Include")
 *                         .build())
 *                     .name("CanaryWorkspaceVamshi")
 *                     .resourceId("/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace")
 *                     .build(),
 *                 ConnectionMonitorEndpointArgs.builder()
 *                     .address("bing.com")
 *                     .name("bing")
 *                     .build(),
 *                 ConnectionMonitorEndpointArgs.builder()
 *                     .address("google.com")
 *                     .name("google")
 *                     .build())
 *             .networkWatcherName("nw1")
 *             .outputs()
 *             .resourceGroupName("rg1")
 *             .testConfigurations(ConnectionMonitorTestConfigurationArgs.builder()
 *                 .name("testConfig1")
 *                 .protocol("Tcp")
 *                 .tcpConfiguration(ConnectionMonitorTcpConfigurationArgs.builder()
 *                     .disableTraceRoute(false)
 *                     .port(80)
 *                     .build())
 *                 .testFrequencySec(60)
 *                 .build())
 *             .testGroups(ConnectionMonitorTestGroupArgs.builder()
 *                 .destinations(                
 *                     "bing",
 *                     "google")
 *                 .disable(false)
 *                 .name("test1")
 *                 .sources(                
 *                     "vm1",
 *                     "CanaryWorkspaceVamshi")
 *                 .testConfigurations("testConfig1")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:network:ConnectionMonitor cm1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName} * ``` * */ @ResourceType(type="azure-native:network:ConnectionMonitor") public class ConnectionMonitor extends com.pulumi.resources.CustomResource { /** * Determines if the connection monitor will start automatically once created. * */ @Export(name="autoStart", refs={Boolean.class}, tree="[0]") private Output autoStart; /** * @return Determines if the connection monitor will start automatically once created. * */ public Output> autoStart() { return Codegen.optional(this.autoStart); } /** * Type of connection monitor. * */ @Export(name="connectionMonitorType", refs={String.class}, tree="[0]") private Output connectionMonitorType; /** * @return Type of connection monitor. * */ public Output connectionMonitorType() { return this.connectionMonitorType; } /** * Describes the destination of connection monitor. * */ @Export(name="destination", refs={ConnectionMonitorDestinationResponse.class}, tree="[0]") private Output destination; /** * @return Describes the destination of connection monitor. * */ public Output> destination() { return Codegen.optional(this.destination); } /** * List of connection monitor endpoints. * */ @Export(name="endpoints", refs={List.class,ConnectionMonitorEndpointResponse.class}, tree="[0,1]") private Output> endpoints; /** * @return List of connection monitor endpoints. * */ public Output>> endpoints() { return Codegen.optional(this.endpoints); } /** * A unique read-only string that changes whenever the resource is updated. * */ @Export(name="etag", refs={String.class}, tree="[0]") private Output etag; /** * @return A unique read-only string that changes whenever the resource is updated. * */ public Output etag() { return this.etag; } /** * Connection monitor location. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Connection monitor location. * */ public Output> location() { return Codegen.optional(this.location); } /** * Monitoring interval in seconds. * */ @Export(name="monitoringIntervalInSeconds", refs={Integer.class}, tree="[0]") private Output monitoringIntervalInSeconds; /** * @return Monitoring interval in seconds. * */ public Output> monitoringIntervalInSeconds() { return Codegen.optional(this.monitoringIntervalInSeconds); } /** * The monitoring status of the connection monitor. * */ @Export(name="monitoringStatus", refs={String.class}, tree="[0]") private Output monitoringStatus; /** * @return The monitoring status of the connection monitor. * */ public Output monitoringStatus() { return this.monitoringStatus; } /** * Name of the connection monitor. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Name of the connection monitor. * */ public Output name() { return this.name; } /** * Optional notes to be associated with the connection monitor. * */ @Export(name="notes", refs={String.class}, tree="[0]") private Output notes; /** * @return Optional notes to be associated with the connection monitor. * */ public Output> notes() { return Codegen.optional(this.notes); } /** * List of connection monitor outputs. * */ @Export(name="outputs", refs={List.class,ConnectionMonitorOutputResponse.class}, tree="[0,1]") private Output> outputs; /** * @return List of connection monitor outputs. * */ public Output>> outputs() { return Codegen.optional(this.outputs); } /** * The provisioning state of the connection monitor. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return The provisioning state of the connection monitor. * */ public Output provisioningState() { return this.provisioningState; } /** * Describes the source of connection monitor. * */ @Export(name="source", refs={ConnectionMonitorSourceResponse.class}, tree="[0]") private Output source; /** * @return Describes the source of connection monitor. * */ public Output> source() { return Codegen.optional(this.source); } /** * The date and time when the connection monitor was started. * */ @Export(name="startTime", refs={String.class}, tree="[0]") private Output startTime; /** * @return The date and time when the connection monitor was started. * */ public Output startTime() { return this.startTime; } /** * Connection monitor tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Connection monitor tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * List of connection monitor test configurations. * */ @Export(name="testConfigurations", refs={List.class,ConnectionMonitorTestConfigurationResponse.class}, tree="[0,1]") private Output> testConfigurations; /** * @return List of connection monitor test configurations. * */ public Output>> testConfigurations() { return Codegen.optional(this.testConfigurations); } /** * List of connection monitor test groups. * */ @Export(name="testGroups", refs={List.class,ConnectionMonitorTestGroupResponse.class}, tree="[0,1]") private Output> testGroups; /** * @return List of connection monitor test groups. * */ public Output>> testGroups() { return Codegen.optional(this.testGroups); } /** * Connection monitor type. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Connection monitor type. * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public ConnectionMonitor(java.lang.String name) { this(name, ConnectionMonitorArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ConnectionMonitor(java.lang.String name, ConnectionMonitorArgs 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 ConnectionMonitor(java.lang.String name, ConnectionMonitorArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:network:ConnectionMonitor", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ConnectionMonitor(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:network:ConnectionMonitor", name, null, makeResourceOptions(options, id), false); } private static ConnectionMonitorArgs makeArgs(ConnectionMonitorArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ConnectionMonitorArgs.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-native:network/v20171001:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20171101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20180101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20180201:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20180401:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20180601:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20180701:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20180801:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20181001:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20181101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20181201:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20190201:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20190401:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20190601:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20190701:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20190801:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20190901:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20191101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20191201:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20200301:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20200401:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20200501:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20200601:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20200701:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20200801:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20201101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20210201:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20210301:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20210501:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20210801:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20220101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20220501:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20220701:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20220901:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20221101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20230201:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20230401:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20230501:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20230601:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20230901:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20231101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20240101:ConnectionMonitor").build()), Output.of(Alias.builder().type("azure-native:network/v20240301:ConnectionMonitor").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 options Optional settings to control the behavior of the CustomResource. */ public static ConnectionMonitor get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ConnectionMonitor(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy