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

com.pulumi.aws.dms.ReplicationSubnetGroup 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.60.0-alpha.1731982519
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.dms;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.dms.ReplicationSubnetGroupArgs;
import com.pulumi.aws.dms.inputs.ReplicationSubnetGroupState;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides a DMS (Data Migration Service) replication subnet group resource. DMS replication subnet groups can be created, updated, deleted, and imported.
 * 
 * > **Note:** AWS requires a special IAM role called `dms-vpc-role` when using this resource. See the example below to create it as part of your configuration.
 * 
 * ## Example Usage
 * 
 * ### Basic
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.dms.ReplicationSubnetGroup;
 * import com.pulumi.aws.dms.ReplicationSubnetGroupArgs;
 * 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) {
 *         // Create a new replication subnet group
 *         var example = new ReplicationSubnetGroup("example", ReplicationSubnetGroupArgs.builder()
 *             .replicationSubnetGroupDescription("Example replication subnet group")
 *             .replicationSubnetGroupId("example-dms-replication-subnet-group-tf")
 *             .subnetIds(            
 *                 "subnet-12345678",
 *                 "subnet-12345679")
 *             .tags(Map.of("Name", "example"))
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ### Creating special IAM role * * If your account does not already include the `dms-vpc-role` IAM role, you will need to create it to allow DMS to manage subnets in the VPC. * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.iam.Role;
 * import com.pulumi.aws.iam.RoleArgs;
 * import com.pulumi.aws.iam.RolePolicyAttachment;
 * import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
 * import com.pulumi.aws.dms.ReplicationSubnetGroup;
 * import com.pulumi.aws.dms.ReplicationSubnetGroupArgs;
 * import static com.pulumi.codegen.internal.Serialization.*;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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 dms_vpc_role = new Role("dms-vpc-role", RoleArgs.builder()
 *             .name("dms-vpc-role")
 *             .description("Allows DMS to manage VPC")
 *             .assumeRolePolicy(serializeJson(
 *                 jsonObject(
 *                     jsonProperty("Version", "2012-10-17"),
 *                     jsonProperty("Statement", jsonArray(jsonObject(
 *                         jsonProperty("Effect", "Allow"),
 *                         jsonProperty("Principal", jsonObject(
 *                             jsonProperty("Service", "dms.amazonaws.com")
 *                         )),
 *                         jsonProperty("Action", "sts:AssumeRole")
 *                     )))
 *                 )))
 *             .build());
 * 
 *         var example = new RolePolicyAttachment("example", RolePolicyAttachmentArgs.builder()
 *             .role(dms_vpc_role.name())
 *             .policyArn("arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole")
 *             .build());
 * 
 *         var exampleReplicationSubnetGroup = new ReplicationSubnetGroup("exampleReplicationSubnetGroup", ReplicationSubnetGroupArgs.builder()
 *             .replicationSubnetGroupDescription("Example")
 *             .replicationSubnetGroupId("example-id")
 *             .subnetIds(            
 *                 "subnet-12345678",
 *                 "subnet-12345679")
 *             .tags(Map.of("Name", "example-id"))
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(example)
 *                 .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import replication subnet groups using the `replication_subnet_group_id`. For example: * * ```sh * $ pulumi import aws:dms/replicationSubnetGroup:ReplicationSubnetGroup test test-dms-replication-subnet-group-tf * ``` * */ @ResourceType(type="aws:dms/replicationSubnetGroup:ReplicationSubnetGroup") public class ReplicationSubnetGroup extends com.pulumi.resources.CustomResource { @Export(name="replicationSubnetGroupArn", refs={String.class}, tree="[0]") private Output replicationSubnetGroupArn; public Output replicationSubnetGroupArn() { return this.replicationSubnetGroupArn; } /** * Description for the subnet group. * */ @Export(name="replicationSubnetGroupDescription", refs={String.class}, tree="[0]") private Output replicationSubnetGroupDescription; /** * @return Description for the subnet group. * */ public Output replicationSubnetGroupDescription() { return this.replicationSubnetGroupDescription; } /** * Name for the replication subnet group. This value is stored as a lowercase string. It must contain no more than 255 alphanumeric characters, periods, spaces, underscores, or hyphens and cannot be `default`. * */ @Export(name="replicationSubnetGroupId", refs={String.class}, tree="[0]") private Output replicationSubnetGroupId; /** * @return Name for the replication subnet group. This value is stored as a lowercase string. It must contain no more than 255 alphanumeric characters, periods, spaces, underscores, or hyphens and cannot be `default`. * */ public Output replicationSubnetGroupId() { return this.replicationSubnetGroupId; } /** * List of at least 2 EC2 subnet IDs for the subnet group. The subnets must cover at least 2 availability zones. * */ @Export(name="subnetIds", refs={List.class,String.class}, tree="[0,1]") private Output> subnetIds; /** * @return List of at least 2 EC2 subnet IDs for the subnet group. The subnets must cover at least 2 availability zones. * */ public Output> subnetIds() { return this.subnetIds; } /** * Map of tags to assign to the 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 the 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; } /** * The ID of the VPC the subnet group is in. * */ @Export(name="vpcId", refs={String.class}, tree="[0]") private Output vpcId; /** * @return The ID of the VPC the subnet group is in. * */ public Output vpcId() { return this.vpcId; } /** * * @param name The _unique_ name of the resulting resource. */ public ReplicationSubnetGroup(java.lang.String name) { this(name, ReplicationSubnetGroupArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ReplicationSubnetGroup(java.lang.String name, ReplicationSubnetGroupArgs 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 ReplicationSubnetGroup(java.lang.String name, ReplicationSubnetGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:dms/replicationSubnetGroup:ReplicationSubnetGroup", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ReplicationSubnetGroup(java.lang.String name, Output id, @Nullable ReplicationSubnetGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:dms/replicationSubnetGroup:ReplicationSubnetGroup", name, state, makeResourceOptions(options, id), false); } private static ReplicationSubnetGroupArgs makeArgs(ReplicationSubnetGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ReplicationSubnetGroupArgs.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 ReplicationSubnetGroup get(java.lang.String name, Output id, @Nullable ReplicationSubnetGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ReplicationSubnetGroup(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy