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

com.pulumi.azurenative.security.JitNetworkAccessPolicy Maven / Gradle / Ivy

There is a newer version: 2.82.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.security;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.security.JitNetworkAccessPolicyArgs;
import com.pulumi.azurenative.security.outputs.JitNetworkAccessPolicyVirtualMachineResponse;
import com.pulumi.azurenative.security.outputs.JitNetworkAccessRequestResponse;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Azure REST API version: 2020-01-01. Prior API version in Azure Native 1.x: 2020-01-01.
 * 
 * ## Example Usage
 * ### Create JIT network access policy
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.JitNetworkAccessPolicy;
 * import com.pulumi.azurenative.security.JitNetworkAccessPolicyArgs;
 * import com.pulumi.azurenative.security.inputs.JitNetworkAccessRequestArgs;
 * import com.pulumi.azurenative.security.inputs.JitNetworkAccessPolicyVirtualMachineArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var jitNetworkAccessPolicy = new JitNetworkAccessPolicy("jitNetworkAccessPolicy", JitNetworkAccessPolicyArgs.builder()
 *             .ascLocation("westeurope")
 *             .jitNetworkAccessPolicyName("default")
 *             .kind("Basic")
 *             .requests(JitNetworkAccessRequestArgs.builder()
 *                 .requestor("barbara}{@literal @}{@code contoso.com")
 *                 .startTimeUtc("2018-05-17T08:06:45.5691611Z")
 *                 .virtualMachines(JitNetworkAccessRequestVirtualMachineArgs.builder()
 *                     .id("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1")
 *                     .ports(JitNetworkAccessRequestPortArgs.builder()
 *                         .allowedSourceAddressPrefix("192.127.0.2")
 *                         .endTimeUtc("2018-05-17T09:06:45.5691611Z")
 *                         .number(3389)
 *                         .status("Initiated")
 *                         .statusReason("UserRequested")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .resourceGroupName("myRg1")
 *             .virtualMachines(JitNetworkAccessPolicyVirtualMachineArgs.builder()
 *                 .id("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1")
 *                 .ports(                
 *                     JitNetworkAccessPortRuleArgs.builder()
 *                         .allowedSourceAddressPrefix("*")
 *                         .maxRequestAccessDuration("PT3H")
 *                         .number(22)
 *                         .protocol("*")
 *                         .build(),
 *                     JitNetworkAccessPortRuleArgs.builder()
 *                         .allowedSourceAddressPrefix("*")
 *                         .maxRequestAccessDuration("PT3H")
 *                         .number(3389)
 *                         .protocol("*")
 *                         .build())
 *                 .build())
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:security:JitNetworkAccessPolicy default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} * ``` * */ @ResourceType(type="azure-native:security:JitNetworkAccessPolicy") public class JitNetworkAccessPolicy extends com.pulumi.resources.CustomResource { /** * Kind of the resource * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return Kind of the resource * */ public Output> kind() { return Codegen.optional(this.kind); } /** * Location where the resource is stored * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Location where the resource is stored * */ public Output location() { return this.location; } /** * Resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name * */ public Output name() { return this.name; } /** * Gets the provisioning state of the Just-in-Time policy. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return Gets the provisioning state of the Just-in-Time policy. * */ public Output provisioningState() { return this.provisioningState; } @Export(name="requests", refs={List.class,JitNetworkAccessRequestResponse.class}, tree="[0,1]") private Output> requests; public Output>> requests() { return Codegen.optional(this.requests); } /** * Resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type * */ public Output type() { return this.type; } /** * Configurations for Microsoft.Compute/virtualMachines resource type. * */ @Export(name="virtualMachines", refs={List.class,JitNetworkAccessPolicyVirtualMachineResponse.class}, tree="[0,1]") private Output> virtualMachines; /** * @return Configurations for Microsoft.Compute/virtualMachines resource type. * */ public Output> virtualMachines() { return this.virtualMachines; } /** * * @param name The _unique_ name of the resulting resource. */ public JitNetworkAccessPolicy(java.lang.String name) { this(name, JitNetworkAccessPolicyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public JitNetworkAccessPolicy(java.lang.String name, JitNetworkAccessPolicyArgs 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 JitNetworkAccessPolicy(java.lang.String name, JitNetworkAccessPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:security:JitNetworkAccessPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private JitNetworkAccessPolicy(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:security:JitNetworkAccessPolicy", name, null, makeResourceOptions(options, id), false); } private static JitNetworkAccessPolicyArgs makeArgs(JitNetworkAccessPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? JitNetworkAccessPolicyArgs.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:security/v20150601preview:JitNetworkAccessPolicy").build()), Output.of(Alias.builder().type("azure-native:security/v20200101:JitNetworkAccessPolicy").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 JitNetworkAccessPolicy get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new JitNetworkAccessPolicy(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy