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

com.pulumi.aws.directoryservice.ServiceRegion Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.66.3
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.aws.directoryservice;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.directoryservice.ServiceRegionArgs;
import com.pulumi.aws.directoryservice.inputs.ServiceRegionState;
import com.pulumi.aws.directoryservice.outputs.ServiceRegionVpcSettings;
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.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a replicated Region and directory for Multi-Region replication.
 * Multi-Region replication is only supported for the Enterprise Edition of AWS Managed Microsoft AD.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.AwsFunctions;
 * import com.pulumi.aws.inputs.GetRegionArgs;
 * import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
 * import com.pulumi.aws.ec2.Vpc;
 * import com.pulumi.aws.ec2.VpcArgs;
 * import com.pulumi.aws.ec2.Subnet;
 * import com.pulumi.aws.ec2.SubnetArgs;
 * import com.pulumi.aws.directoryservice.Directory;
 * import com.pulumi.aws.directoryservice.DirectoryArgs;
 * import com.pulumi.aws.directoryservice.inputs.DirectoryVpcSettingsArgs;
 * import com.pulumi.aws.directoryservice.ServiceRegion;
 * import com.pulumi.aws.directoryservice.ServiceRegionArgs;
 * import com.pulumi.aws.directoryservice.inputs.ServiceRegionVpcSettingsArgs;
 * import com.pulumi.codegen.internal.KeyedValue;
 * 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) {
 *         final var example = AwsFunctions.getRegion();
 * 
 *         final var available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
 *             .state("available")
 *             .filters(GetAvailabilityZonesFilterArgs.builder()
 *                 .name("opt-in-status")
 *                 .values("opt-in-not-required")
 *                 .build())
 *             .build());
 * 
 *         var exampleVpc = new Vpc("exampleVpc", VpcArgs.builder()
 *             .cidrBlock("10.0.0.0/16")
 *             .tags(Map.of("Name", "Primary"))
 *             .build());
 * 
 *         for (var i = 0; i < 2; i++) {
 *             new Subnet("exampleSubnet-" + i, SubnetArgs.builder()
 *                 .vpcId(exampleVpc.id())
 *                 .availabilityZone(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.names())[range.value()])
 *                 .cidrBlock(exampleVpc.cidrBlock().applyValue(cidrBlock -> StdFunctions.cidrsubnet()).applyValue(invoke -> invoke.result()))
 *                 .tags(Map.of("Name", "Primary"))
 *                 .build());
 * 
 *         
 * }
 *         var exampleDirectory = new Directory("exampleDirectory", DirectoryArgs.builder()
 *             .name("example.com")
 *             .password("SuperSecretPassw0rd")
 *             .type("MicrosoftAD")
 *             .vpcSettings(DirectoryVpcSettingsArgs.builder()
 *                 .vpcId(exampleVpc.id())
 *                 .subnetIds(exampleSubnet.stream().map(element -> element.id()).collect(toList()))
 *                 .build())
 *             .build());
 * 
 *         final var available-secondary = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
 *             .state("available")
 *             .filters(GetAvailabilityZonesFilterArgs.builder()
 *                 .name("opt-in-status")
 *                 .values("opt-in-not-required")
 *                 .build())
 *             .build());
 * 
 *         var example_secondary = new Vpc("example-secondary", VpcArgs.builder()
 *             .cidrBlock("10.1.0.0/16")
 *             .tags(Map.of("Name", "Secondary"))
 *             .build());
 * 
 *         for (var i = 0; i < 2; i++) {
 *             new Subnet("example-secondarySubnet-" + i, SubnetArgs.builder()
 *                 .vpcId(example_secondary.id())
 *                 .availabilityZone(available_secondary.names()[range.value()])
 *                 .cidrBlock(example_secondary.cidrBlock().applyValue(cidrBlock -> StdFunctions.cidrsubnet()).applyValue(invoke -> invoke.result()))
 *                 .tags(Map.of("Name", "Secondary"))
 *                 .build());
 * 
 *         
 * }
 *         var exampleServiceRegion = new ServiceRegion("exampleServiceRegion", ServiceRegionArgs.builder()
 *             .directoryId(exampleDirectory.id())
 *             .regionName(example.applyValue(getRegionResult -> getRegionResult.name()))
 *             .vpcSettings(ServiceRegionVpcSettingsArgs.builder()
 *                 .vpcId(example_secondary.id())
 *                 .subnetIds(example_secondarySubnet.stream().map(element -> element.id()).collect(toList()))
 *                 .build())
 *             .tags(Map.of("Name", "Secondary"))
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import Replicated Regions using directory ID,Region name. For example: * * ```sh * $ pulumi import aws:directoryservice/serviceRegion:ServiceRegion example d-9267651497,us-east-2 * ``` * */ @ResourceType(type="aws:directoryservice/serviceRegion:ServiceRegion") public class ServiceRegion extends com.pulumi.resources.CustomResource { /** * The number of domain controllers desired in the replicated directory. Minimum value of `2`. * */ @Export(name="desiredNumberOfDomainControllers", refs={Integer.class}, tree="[0]") private Output desiredNumberOfDomainControllers; /** * @return The number of domain controllers desired in the replicated directory. Minimum value of `2`. * */ public Output desiredNumberOfDomainControllers() { return this.desiredNumberOfDomainControllers; } /** * The identifier of the directory to which you want to add Region replication. * */ @Export(name="directoryId", refs={String.class}, tree="[0]") private Output directoryId; /** * @return The identifier of the directory to which you want to add Region replication. * */ public Output directoryId() { return this.directoryId; } /** * The name of the Region where you want to add domain controllers for replication. * */ @Export(name="regionName", refs={String.class}, tree="[0]") private Output regionName; /** * @return The name of the Region where you want to add domain controllers for replication. * */ public Output regionName() { return this.regionName; } /** * Map of tags to assign to this resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Map of tags to assign to this resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * * @deprecated * Please use `tags` instead. * */ @Deprecated /* Please use `tags` instead. */ @Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tagsAll; /** * @return A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * */ public Output> tagsAll() { return this.tagsAll; } /** * VPC information in the replicated Region. Detailed below. * */ @Export(name="vpcSettings", refs={ServiceRegionVpcSettings.class}, tree="[0]") private Output vpcSettings; /** * @return VPC information in the replicated Region. Detailed below. * */ public Output vpcSettings() { return this.vpcSettings; } /** * * @param name The _unique_ name of the resulting resource. */ public ServiceRegion(java.lang.String name) { this(name, ServiceRegionArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ServiceRegion(java.lang.String name, ServiceRegionArgs 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 ServiceRegion(java.lang.String name, ServiceRegionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:directoryservice/serviceRegion:ServiceRegion", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ServiceRegion(java.lang.String name, Output id, @Nullable ServiceRegionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:directoryservice/serviceRegion:ServiceRegion", name, state, makeResourceOptions(options, id), false); } private static ServiceRegionArgs makeArgs(ServiceRegionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ServiceRegionArgs.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 ServiceRegion get(java.lang.String name, Output id, @Nullable ServiceRegionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ServiceRegion(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy