Class GlobalTable


  • public class GlobalTable
    extends com.pulumi.resources.CustomResource
    Manages [DynamoDB Global Tables V1 (version 2017.11.29)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html). These are layered on top of existing DynamoDB Tables. > **NOTE:** To instead manage [DynamoDB Global Tables V2 (version 2019.11.21)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html), use the `aws.dynamodb.Table` resource `replica` configuration block. > Note: There are many restrictions before you can properly create DynamoDB Global Tables in multiple regions. See the [AWS DynamoDB Global Table Requirements](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables_reqs_bestpractices.html) for more information. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.dynamodb.Table;
     import com.pulumi.aws.dynamodb.TableArgs;
     import com.pulumi.aws.dynamodb.inputs.TableAttributeArgs;
     import com.pulumi.aws.dynamodb.GlobalTable;
     import com.pulumi.aws.dynamodb.GlobalTableArgs;
     import com.pulumi.aws.dynamodb.inputs.GlobalTableReplicaArgs;
     import com.pulumi.resources.CustomResourceOptions;
     import java.util.ArrayList;
     import java.util.Arrays;
     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 us_east_1 = new Table("us-east-1", TableArgs.builder()
                 .attributes(TableAttributeArgs.builder()
                     .name("myAttribute")
                     .type("S")
                     .build())
                 .hashKey("myAttribute")
                 .name("myTable")
                 .streamEnabled(true)
                 .streamViewType("NEW_AND_OLD_IMAGES")
                 .readCapacity(1)
                 .writeCapacity(1)
                 .build());
     
             var us_west_2 = new Table("us-west-2", TableArgs.builder()
                 .attributes(TableAttributeArgs.builder()
                     .name("myAttribute")
                     .type("S")
                     .build())
                 .hashKey("myAttribute")
                 .name("myTable")
                 .streamEnabled(true)
                 .streamViewType("NEW_AND_OLD_IMAGES")
                 .readCapacity(1)
                 .writeCapacity(1)
                 .build());
     
             var myTable = new GlobalTable("myTable", GlobalTableArgs.builder()
                 .replicas(            
                     GlobalTableReplicaArgs.builder()
                         .regionName("us-east-1")
                         .build(),
                     GlobalTableReplicaArgs.builder()
                         .regionName("us-west-2")
                         .build())
                 .name("myTable")
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(                
                         us_east_1,
                         us_west_2)
                     .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import DynamoDB Global Tables using the global table name. For example: ```sh $ pulumi import aws:dynamodb/globalTable:GlobalTable MyTable MyTable ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      static GlobalTable get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, GlobalTableState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.List<GlobalTableReplica>> replicas()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GlobalTable

        public GlobalTable​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • GlobalTable

        public GlobalTable​(java.lang.String name,
                           GlobalTableArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • GlobalTable

        public GlobalTable​(java.lang.String name,
                           GlobalTableArgs args,
                           @Nullable
                           com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the DynamoDB Global Table
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the global table. Must match underlying DynamoDB Table names in all regions.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • replicas

        public com.pulumi.core.Output<java.util.List<GlobalTableReplica>> replicas()
        Returns:
        Underlying DynamoDB Table. At least 1 replica must be defined. See below.
      • get

        public static GlobalTable get​(java.lang.String name,
                                      com.pulumi.core.Output<java.lang.String> id,
                                      @Nullable
                                      GlobalTableState state,
                                      @Nullable
                                      com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.