1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. polardb
  6. DynamoTable
Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi

    Provides a PolarDB DynamoDB-compatible table resource to manage tables through the DynamoDB-compatible endpoint of a PolarDB for PostgreSQL cluster.

    NOTE: Available since v1.287.0.

    NOTE: This resource requires a PolarDB for PostgreSQL cluster with enableDynamodb set to true, a PolarDB account of type DynamoDB, and a cluster endpoint of type DynamoDB with a reachable (e.g. public) endpoint address.

    NOTE: All operations are performed against the DynamoDB-compatible endpoint (http://<connection_string>:5432) using the DynamoDB API, not the PolarDB OpenAPI.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.polardb.getNodeClasses({
        dbType: "PostgreSQL",
        dbVersion: "16",
        payType: "PostPaid",
        dbNodeClass: "polar.pg.x4.medium",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "172.16.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/24",
        zoneId: _default.then(_default => _default.classes?.[0]?.zoneId),
        vswitchName: name,
    });
    const defaultGlobalSecurityIpGroup = new alicloud.polardb.GlobalSecurityIpGroup("default", {
        globalIpGroupName: "tf_dynamo_whitelist",
        globalIpList: "0.0.0.0/0",
    });
    const defaultCluster = new alicloud.polardb.Cluster("default", {
        dbType: "PostgreSQL",
        dbVersion: "16",
        dbNodeClass: "polar.pg.x4.medium",
        payType: "PostPaid",
        vswitchId: defaultSwitch.id,
        description: name,
        enableDynamodb: true,
        globalSecurityGroupLists: [defaultGlobalSecurityIpGroup.id],
    });
    const dynamo = new alicloud.polardb.Account("dynamo", {
        dbClusterId: defaultCluster.id,
        accountName: "tf_dynamo_acc",
        accountPassword: "Example1234!",
        accountType: "DynamoDB",
    });
    const dynamoEndpoint = new alicloud.polardb.Endpoint("dynamo", {
        dbClusterId: dynamo.dbClusterId,
        endpointType: "DynamoDB",
        readWriteMode: "ReadWrite",
    });
    const dynamoPublic = new alicloud.polardb.EndpointAddress("dynamo_public", {
        dbClusterId: defaultCluster.id,
        dbEndpointId: dynamoEndpoint.dbEndpointId,
        netType: "Public",
    });
    const defaultDynamoTable = new alicloud.polardb.DynamoTable("default", {
        endpoint: pulumi.interpolate`http://${dynamoPublic.connectionString}:5432`,
        dbClusterId: defaultCluster.id,
        accountName: dynamo.accountName,
        accountAuth: dynamo.dynamodbAuthPassword,
        tableName: name,
        hashKey: "pk",
        rangeKey: "sk",
        billingMode: "PAY_PER_REQUEST",
        attributes: [
            {
                name: "pk",
                type: "S",
            },
            {
                name: "sk",
                type: "S",
            },
        ],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.polardb.get_node_classes(db_type="PostgreSQL",
        db_version="16",
        pay_type="PostPaid",
        db_node_class="polar.pg.x4.medium")
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="172.16.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/24",
        zone_id=default.classes[0].zone_id,
        vswitch_name=name)
    default_global_security_ip_group = alicloud.polardb.GlobalSecurityIpGroup("default",
        global_ip_group_name="tf_dynamo_whitelist",
        global_ip_list="0.0.0.0/0")
    default_cluster = alicloud.polardb.Cluster("default",
        db_type="PostgreSQL",
        db_version="16",
        db_node_class="polar.pg.x4.medium",
        pay_type="PostPaid",
        vswitch_id=default_switch.id,
        description=name,
        enable_dynamodb=True,
        global_security_group_lists=[default_global_security_ip_group.id])
    dynamo = alicloud.polardb.Account("dynamo",
        db_cluster_id=default_cluster.id,
        account_name="tf_dynamo_acc",
        account_password="Example1234!",
        account_type="DynamoDB")
    dynamo_endpoint = alicloud.polardb.Endpoint("dynamo",
        db_cluster_id=dynamo.db_cluster_id,
        endpoint_type="DynamoDB",
        read_write_mode="ReadWrite")
    dynamo_public = alicloud.polardb.EndpointAddress("dynamo_public",
        db_cluster_id=default_cluster.id,
        db_endpoint_id=dynamo_endpoint.db_endpoint_id,
        net_type="Public")
    default_dynamo_table = alicloud.polardb.DynamoTable("default",
        endpoint=dynamo_public.connection_string.apply(lambda connection_string: f"http://{connection_string}:5432"),
        db_cluster_id=default_cluster.id,
        account_name=dynamo.account_name,
        account_auth=dynamo.dynamodb_auth_password,
        table_name=name,
        hash_key="pk",
        range_key="sk",
        billing_mode="PAY_PER_REQUEST",
        attributes=[
            {
                "name": "pk",
                "type": "S",
            },
            {
                "name": "sk",
                "type": "S",
            },
        ])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := polardb.GetNodeClasses(ctx, &polardb.GetNodeClassesArgs{
    			DbType:      pulumi.StringRef("PostgreSQL"),
    			DbVersion:   pulumi.StringRef("16"),
    			PayType:     "PostPaid",
    			DbNodeClass: pulumi.StringRef("polar.pg.x4.medium"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID().ToIDOutput().ToStringOutput(),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			ZoneId:      pulumi.String(_default.Classes[0].ZoneId),
    			VswitchName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGlobalSecurityIpGroup, err := polardb.NewGlobalSecurityIpGroup(ctx, "default", &polardb.GlobalSecurityIpGroupArgs{
    			GlobalIpGroupName: pulumi.String("tf_dynamo_whitelist"),
    			GlobalIpList:      pulumi.String("0.0.0.0/0"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCluster, err := polardb.NewCluster(ctx, "default", &polardb.ClusterArgs{
    			DbType:         pulumi.String("PostgreSQL"),
    			DbVersion:      pulumi.String("16"),
    			DbNodeClass:    pulumi.String("polar.pg.x4.medium"),
    			PayType:        pulumi.String("PostPaid"),
    			VswitchId:      defaultSwitch.ID().ToIDOutput().ToStringOutput(),
    			Description:    pulumi.String(name),
    			EnableDynamodb: pulumi.Bool(true),
    			GlobalSecurityGroupLists: pulumi.StringArray{
    				defaultGlobalSecurityIpGroup.ID().ToIDOutput().ToStringOutput(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		dynamo, err := polardb.NewAccount(ctx, "dynamo", &polardb.AccountArgs{
    			DbClusterId:     defaultCluster.ID().ToIDOutput().ToStringOutput(),
    			AccountName:     pulumi.String("tf_dynamo_acc"),
    			AccountPassword: pulumi.String("Example1234!"),
    			AccountType:     pulumi.String("DynamoDB"),
    		})
    		if err != nil {
    			return err
    		}
    		dynamoEndpoint, err := polardb.NewEndpoint(ctx, "dynamo", &polardb.EndpointArgs{
    			DbClusterId:   dynamo.DbClusterId,
    			EndpointType:  pulumi.String("DynamoDB"),
    			ReadWriteMode: pulumi.String("ReadWrite"),
    		})
    		if err != nil {
    			return err
    		}
    		dynamoPublic, err := polardb.NewEndpointAddress(ctx, "dynamo_public", &polardb.EndpointAddressArgs{
    			DbClusterId:  defaultCluster.ID().ToIDOutput().ToStringOutput(),
    			DbEndpointId: dynamoEndpoint.DbEndpointId,
    			NetType:      pulumi.String("Public"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = polardb.NewDynamoTable(ctx, "default", &polardb.DynamoTableArgs{
    			Endpoint: dynamoPublic.ConnectionString.ApplyT(func(connectionString string) (string, error) {
    				return fmt.Sprintf("http://%v:5432", connectionString), nil
    			}).(pulumi.StringOutput),
    			DbClusterId: defaultCluster.ID().ToIDOutput().ToStringOutput(),
    			AccountName: dynamo.AccountName,
    			AccountAuth: dynamo.DynamodbAuthPassword,
    			TableName:   pulumi.String(name),
    			HashKey:     pulumi.String("pk"),
    			RangeKey:    pulumi.String("sk"),
    			BillingMode: pulumi.String("PAY_PER_REQUEST"),
    			Attributes: polardb.DynamoTableAttributeArray{
    				&polardb.DynamoTableAttributeArgs{
    					Name: pulumi.String("pk"),
    					Type: pulumi.String("S"),
    				},
    				&polardb.DynamoTableAttributeArgs{
    					Name: pulumi.String("sk"),
    					Type: pulumi.String("S"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.PolarDB.GetNodeClasses.Invoke(new()
        {
            DbType = "PostgreSQL",
            DbVersion = "16",
            PayType = "PostPaid",
            DbNodeClass = "polar.pg.x4.medium",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "172.16.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getNodeClassesResult => getNodeClassesResult.Classes[0]?.ZoneId)),
            VswitchName = name,
        });
    
        var defaultGlobalSecurityIpGroup = new AliCloud.PolarDB.GlobalSecurityIpGroup("default", new()
        {
            GlobalIpGroupName = "tf_dynamo_whitelist",
            GlobalIpList = "0.0.0.0/0",
        });
    
        var defaultCluster = new AliCloud.PolarDB.Cluster("default", new()
        {
            DbType = "PostgreSQL",
            DbVersion = "16",
            DbNodeClass = "polar.pg.x4.medium",
            PayType = "PostPaid",
            VswitchId = defaultSwitch.Id,
            Description = name,
            EnableDynamodb = true,
            GlobalSecurityGroupLists = new[]
            {
                defaultGlobalSecurityIpGroup.Id,
            },
        });
    
        var dynamo = new AliCloud.PolarDB.Account("dynamo", new()
        {
            DbClusterId = defaultCluster.Id,
            AccountName = "tf_dynamo_acc",
            AccountPassword = "Example1234!",
            AccountType = "DynamoDB",
        });
    
        var dynamoEndpoint = new AliCloud.PolarDB.Endpoint("dynamo", new()
        {
            DbClusterId = dynamo.DbClusterId,
            EndpointType = "DynamoDB",
            ReadWriteMode = "ReadWrite",
        });
    
        var dynamoPublic = new AliCloud.PolarDB.EndpointAddress("dynamo_public", new()
        {
            DbClusterId = defaultCluster.Id,
            DbEndpointId = dynamoEndpoint.DbEndpointId,
            NetType = "Public",
        });
    
        var defaultDynamoTable = new AliCloud.PolarDB.DynamoTable("default", new()
        {
            Endpoint = dynamoPublic.ConnectionString.Apply(connectionString => $"http://{connectionString}:5432"),
            DbClusterId = defaultCluster.Id,
            AccountName = dynamo.AccountName,
            AccountAuth = dynamo.DynamodbAuthPassword,
            TableName = name,
            HashKey = "pk",
            RangeKey = "sk",
            BillingMode = "PAY_PER_REQUEST",
            Attributes = new[]
            {
                new AliCloud.PolarDB.Inputs.DynamoTableAttributeArgs
                {
                    Name = "pk",
                    Type = "S",
                },
                new AliCloud.PolarDB.Inputs.DynamoTableAttributeArgs
                {
                    Name = "sk",
                    Type = "S",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.polardb.PolardbFunctions;
    import com.pulumi.alicloud.polardb.inputs.GetNodeClassesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.polardb.GlobalSecurityIpGroup;
    import com.pulumi.alicloud.polardb.GlobalSecurityIpGroupArgs;
    import com.pulumi.alicloud.polardb.Cluster;
    import com.pulumi.alicloud.polardb.ClusterArgs;
    import com.pulumi.alicloud.polardb.Account;
    import com.pulumi.alicloud.polardb.AccountArgs;
    import com.pulumi.alicloud.polardb.Endpoint;
    import com.pulumi.alicloud.polardb.EndpointArgs;
    import com.pulumi.alicloud.polardb.EndpointAddress;
    import com.pulumi.alicloud.polardb.EndpointAddressArgs;
    import com.pulumi.alicloud.polardb.DynamoTable;
    import com.pulumi.alicloud.polardb.DynamoTableArgs;
    import com.pulumi.alicloud.polardb.inputs.DynamoTableAttributeArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = PolardbFunctions.getNodeClasses(GetNodeClassesArgs.builder()
                .dbType("PostgreSQL")
                .dbVersion("16")
                .payType("PostPaid")
                .dbNodeClass("polar.pg.x4.medium")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/24")
                .zoneId(default_.classes()[0].zoneId())
                .vswitchName(name)
                .build());
    
            var defaultGlobalSecurityIpGroup = new GlobalSecurityIpGroup("defaultGlobalSecurityIpGroup", GlobalSecurityIpGroupArgs.builder()
                .globalIpGroupName("tf_dynamo_whitelist")
                .globalIpList("0.0.0.0/0")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
                .dbType("PostgreSQL")
                .dbVersion("16")
                .dbNodeClass("polar.pg.x4.medium")
                .payType("PostPaid")
                .vswitchId(defaultSwitch.id())
                .description(name)
                .enableDynamodb(true)
                .globalSecurityGroupLists(defaultGlobalSecurityIpGroup.id())
                .build());
    
            var dynamo = new Account("dynamo", AccountArgs.builder()
                .dbClusterId(defaultCluster.id())
                .accountName("tf_dynamo_acc")
                .accountPassword("Example1234!")
                .accountType("DynamoDB")
                .build());
    
            var dynamoEndpoint = new Endpoint("dynamoEndpoint", EndpointArgs.builder()
                .dbClusterId(dynamo.dbClusterId())
                .endpointType("DynamoDB")
                .readWriteMode("ReadWrite")
                .build());
    
            var dynamoPublic = new EndpointAddress("dynamoPublic", EndpointAddressArgs.builder()
                .dbClusterId(defaultCluster.id())
                .dbEndpointId(dynamoEndpoint.dbEndpointId())
                .netType("Public")
                .build());
    
            var defaultDynamoTable = new DynamoTable("defaultDynamoTable", DynamoTableArgs.builder()
                .endpoint(dynamoPublic.connectionString().applyValue(_connectionString -> String.format("http://%s:5432", _connectionString)))
                .dbClusterId(defaultCluster.id())
                .accountName(dynamo.accountName())
                .accountAuth(dynamo.dynamodbAuthPassword())
                .tableName(name)
                .hashKey("pk")
                .rangeKey("sk")
                .billingMode("PAY_PER_REQUEST")
                .attributes(            
                    DynamoTableAttributeArgs.builder()
                        .name("pk")
                        .type("S")
                        .build(),
                    DynamoTableAttributeArgs.builder()
                        .name("sk")
                        .type("S")
                        .build())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 172.16.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/24
          zoneId: ${default.classes[0].zoneId}
          vswitchName: ${name}
      defaultGlobalSecurityIpGroup:
        type: alicloud:polardb:GlobalSecurityIpGroup
        name: default
        properties:
          globalIpGroupName: tf_dynamo_whitelist
          globalIpList: 0.0.0.0/0
      defaultCluster:
        type: alicloud:polardb:Cluster
        name: default
        properties:
          dbType: PostgreSQL
          dbVersion: '16'
          dbNodeClass: polar.pg.x4.medium
          payType: PostPaid
          vswitchId: ${defaultSwitch.id}
          description: ${name}
          enableDynamodb: true
          globalSecurityGroupLists:
            - ${defaultGlobalSecurityIpGroup.id}
      dynamo:
        type: alicloud:polardb:Account
        properties:
          dbClusterId: ${defaultCluster.id}
          accountName: tf_dynamo_acc
          accountPassword: Example1234!
          accountType: DynamoDB
      dynamoEndpoint:
        type: alicloud:polardb:Endpoint
        name: dynamo
        properties:
          dbClusterId: ${dynamo.dbClusterId}
          endpointType: DynamoDB
          readWriteMode: ReadWrite
      dynamoPublic:
        type: alicloud:polardb:EndpointAddress
        name: dynamo_public
        properties:
          dbClusterId: ${defaultCluster.id}
          dbEndpointId: ${dynamoEndpoint.dbEndpointId}
          netType: Public
      defaultDynamoTable:
        type: alicloud:polardb:DynamoTable
        name: default
        properties:
          endpoint: http://${dynamoPublic.connectionString}:5432
          dbClusterId: ${defaultCluster.id}
          accountName: ${dynamo.accountName}
          accountAuth: ${dynamo.dynamodbAuthPassword}
          tableName: ${name}
          hashKey: pk
          rangeKey: sk
          billingMode: PAY_PER_REQUEST
          attributes:
            - name: pk
              type: S
            - name: sk
              type: S
    variables:
      default:
        fn::invoke:
          function: alicloud:polardb:getNodeClasses
          arguments:
            dbType: PostgreSQL
            dbVersion: '16'
            payType: PostPaid
            dbNodeClass: polar.pg.x4.medium
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_polardb_getnodeclasses" "default" {
      db_type       = "PostgreSQL"
      db_version    = "16"
      pay_type      = "PostPaid"
      db_node_class = "polar.pg.x4.medium"
    }
    
    resource "alicloud_vpc_network" "default" {
      vpc_name   = var.name
      cidr_block = "172.16.0.0/16"
    }
    resource "alicloud_vpc_switch" "default" {
      vpc_id       = alicloud_vpc_network.default.id
      cidr_block   = "172.16.0.0/24"
      zone_id      = data.alicloud_polardb_getnodeclasses.default.classes[0].zone_id
      vswitch_name = var.name
    }
    resource "alicloud_polardb_globalsecurityipgroup" "default" {
      global_ip_group_name = "tf_dynamo_whitelist"
      global_ip_list       = "0.0.0.0/0"
    }
    resource "alicloud_polardb_cluster" "default" {
      db_type                     = "PostgreSQL"
      db_version                  = "16"
      db_node_class               = "polar.pg.x4.medium"
      pay_type                    = "PostPaid"
      vswitch_id                  = alicloud_vpc_switch.default.id
      description                 = var.name
      enable_dynamodb             = true
      global_security_group_lists = [alicloud_polardb_globalsecurityipgroup.default.id]
    }
    resource "alicloud_polardb_account" "dynamo" {
      db_cluster_id    = alicloud_polardb_cluster.default.id
      account_name     = "tf_dynamo_acc"
      account_password = "Example1234!"
      account_type     = "DynamoDB"
    }
    resource "alicloud_polardb_endpoint" "dynamo" {
      db_cluster_id   = alicloud_polardb_account.dynamo.db_cluster_id
      endpoint_type   = "DynamoDB"
      read_write_mode = "ReadWrite"
    }
    resource "alicloud_polardb_endpointaddress" "dynamo_public" {
      db_cluster_id  = alicloud_polardb_cluster.default.id
      db_endpoint_id = alicloud_polardb_endpoint.dynamo.db_endpoint_id
      net_type       = "Public"
    }
    resource "alicloud_polardb_dynamotable" "default" {
      endpoint      ="http://${alicloud_polardb_endpointaddress.dynamo_public.connection_string}:5432"
      db_cluster_id = alicloud_polardb_cluster.default.id
      account_name  = alicloud_polardb_account.dynamo.account_name
      account_auth  = alicloud_polardb_account.dynamo.dynamodb_auth_password
      table_name    = var.name
      hash_key      = "pk"
      range_key     = "sk"
      billing_mode  = "PAY_PER_REQUEST"
      attributes {
        name = "pk"
        type = "S"
      }
      attributes {
        name = "sk"
        type = "S"
      }
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create DynamoTable Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DynamoTable(name: string, args: DynamoTableArgs, opts?: CustomResourceOptions);
    @overload
    def DynamoTable(resource_name: str,
                    args: DynamoTableArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def DynamoTable(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    db_cluster_id: Optional[str] = None,
                    table_name: Optional[str] = None,
                    endpoint: Optional[str] = None,
                    global_secondary_indices: Optional[Sequence[DynamoTableGlobalSecondaryIndexArgs]] = None,
                    billing_mode: Optional[str] = None,
                    attributes: Optional[Sequence[DynamoTableAttributeArgs]] = None,
                    account_auth: Optional[str] = None,
                    hash_key: Optional[str] = None,
                    local_secondary_indices: Optional[Sequence[DynamoTableLocalSecondaryIndexArgs]] = None,
                    range_key: Optional[str] = None,
                    read_capacity: Optional[int] = None,
                    account_name: Optional[str] = None,
                    ttl: Optional[DynamoTableTtlArgs] = None,
                    write_capacity: Optional[int] = None)
    func NewDynamoTable(ctx *Context, name string, args DynamoTableArgs, opts ...ResourceOption) (*DynamoTable, error)
    public DynamoTable(string name, DynamoTableArgs args, CustomResourceOptions? opts = null)
    public DynamoTable(String name, DynamoTableArgs args)
    public DynamoTable(String name, DynamoTableArgs args, CustomResourceOptions options)
    
    type: alicloud:polardb:DynamoTable
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_polardb_dynamo_table" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args DynamoTableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DynamoTableArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DynamoTableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DynamoTableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DynamoTableArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var dynamoTableResource = new AliCloud.PolarDB.DynamoTable("dynamoTableResource", new()
    {
        DbClusterId = "string",
        TableName = "string",
        Endpoint = "string",
        GlobalSecondaryIndices = new[]
        {
            new AliCloud.PolarDB.Inputs.DynamoTableGlobalSecondaryIndexArgs
            {
                Name = "string",
                ProjectionType = "string",
                HashKey = "string",
                NonKeyAttributes = new[]
                {
                    "string",
                },
                RangeKey = "string",
                ReadCapacity = 0,
                WriteCapacity = 0,
            },
        },
        BillingMode = "string",
        Attributes = new[]
        {
            new AliCloud.PolarDB.Inputs.DynamoTableAttributeArgs
            {
                Name = "string",
                Type = "string",
            },
        },
        AccountAuth = "string",
        HashKey = "string",
        LocalSecondaryIndices = new[]
        {
            new AliCloud.PolarDB.Inputs.DynamoTableLocalSecondaryIndexArgs
            {
                Name = "string",
                ProjectionType = "string",
                RangeKey = "string",
                NonKeyAttributes = new[]
                {
                    "string",
                },
            },
        },
        RangeKey = "string",
        ReadCapacity = 0,
        AccountName = "string",
        Ttl = new AliCloud.PolarDB.Inputs.DynamoTableTtlArgs
        {
            AttributeName = "string",
            Enabled = false,
        },
        WriteCapacity = 0,
    });
    
    example, err := polardb.NewDynamoTable(ctx, "dynamoTableResource", &polardb.DynamoTableArgs{
    	DbClusterId: pulumi.String("string"),
    	TableName:   pulumi.String("string"),
    	Endpoint:    pulumi.String("string"),
    	GlobalSecondaryIndices: polardb.DynamoTableGlobalSecondaryIndexArray{
    		&polardb.DynamoTableGlobalSecondaryIndexArgs{
    			Name:           pulumi.String("string"),
    			ProjectionType: pulumi.String("string"),
    			HashKey:        pulumi.String("string"),
    			NonKeyAttributes: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			RangeKey:      pulumi.String("string"),
    			ReadCapacity:  pulumi.Int(0),
    			WriteCapacity: pulumi.Int(0),
    		},
    	},
    	BillingMode: pulumi.String("string"),
    	Attributes: polardb.DynamoTableAttributeArray{
    		&polardb.DynamoTableAttributeArgs{
    			Name: pulumi.String("string"),
    			Type: pulumi.String("string"),
    		},
    	},
    	AccountAuth: pulumi.String("string"),
    	HashKey:     pulumi.String("string"),
    	LocalSecondaryIndices: polardb.DynamoTableLocalSecondaryIndexArray{
    		&polardb.DynamoTableLocalSecondaryIndexArgs{
    			Name:           pulumi.String("string"),
    			ProjectionType: pulumi.String("string"),
    			RangeKey:       pulumi.String("string"),
    			NonKeyAttributes: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	RangeKey:     pulumi.String("string"),
    	ReadCapacity: pulumi.Int(0),
    	AccountName:  pulumi.String("string"),
    	Ttl: &polardb.DynamoTableTtlArgs{
    		AttributeName: pulumi.String("string"),
    		Enabled:       pulumi.Bool(false),
    	},
    	WriteCapacity: pulumi.Int(0),
    })
    
    resource "alicloud_polardb_dynamo_table" "dynamoTableResource" {
      lifecycle {
        create_before_destroy = true
      }
      db_cluster_id = "string"
      table_name    = "string"
      endpoint      = "string"
      global_secondary_indices {
        name               = "string"
        projection_type    = "string"
        hash_key           = "string"
        non_key_attributes = ["string"]
        range_key          = "string"
        read_capacity      = 0
        write_capacity     = 0
      }
      billing_mode = "string"
      attributes {
        name = "string"
        type = "string"
      }
      account_auth = "string"
      hash_key     = "string"
      local_secondary_indices {
        name               = "string"
        projection_type    = "string"
        range_key          = "string"
        non_key_attributes = ["string"]
      }
      range_key     = "string"
      read_capacity = 0
      account_name  = "string"
      ttl = {
        attribute_name = "string"
        enabled        = false
      }
      write_capacity = 0
    }
    
    var dynamoTableResource = new DynamoTable("dynamoTableResource", DynamoTableArgs.builder()
        .dbClusterId("string")
        .tableName("string")
        .endpoint("string")
        .globalSecondaryIndices(DynamoTableGlobalSecondaryIndexArgs.builder()
            .name("string")
            .projectionType("string")
            .hashKey("string")
            .nonKeyAttributes("string")
            .rangeKey("string")
            .readCapacity(0)
            .writeCapacity(0)
            .build())
        .billingMode("string")
        .attributes(DynamoTableAttributeArgs.builder()
            .name("string")
            .type("string")
            .build())
        .accountAuth("string")
        .hashKey("string")
        .localSecondaryIndices(DynamoTableLocalSecondaryIndexArgs.builder()
            .name("string")
            .projectionType("string")
            .rangeKey("string")
            .nonKeyAttributes("string")
            .build())
        .rangeKey("string")
        .readCapacity(0)
        .accountName("string")
        .ttl(DynamoTableTtlArgs.builder()
            .attributeName("string")
            .enabled(false)
            .build())
        .writeCapacity(0)
        .build());
    
    dynamo_table_resource = alicloud.polardb.DynamoTable("dynamoTableResource",
        db_cluster_id="string",
        table_name="string",
        endpoint="string",
        global_secondary_indices=[{
            "name": "string",
            "projection_type": "string",
            "hash_key": "string",
            "non_key_attributes": ["string"],
            "range_key": "string",
            "read_capacity": 0,
            "write_capacity": 0,
        }],
        billing_mode="string",
        attributes=[{
            "name": "string",
            "type": "string",
        }],
        account_auth="string",
        hash_key="string",
        local_secondary_indices=[{
            "name": "string",
            "projection_type": "string",
            "range_key": "string",
            "non_key_attributes": ["string"],
        }],
        range_key="string",
        read_capacity=0,
        account_name="string",
        ttl={
            "attribute_name": "string",
            "enabled": False,
        },
        write_capacity=0)
    
    const dynamoTableResource = new alicloud.polardb.DynamoTable("dynamoTableResource", {
        dbClusterId: "string",
        tableName: "string",
        endpoint: "string",
        globalSecondaryIndices: [{
            name: "string",
            projectionType: "string",
            hashKey: "string",
            nonKeyAttributes: ["string"],
            rangeKey: "string",
            readCapacity: 0,
            writeCapacity: 0,
        }],
        billingMode: "string",
        attributes: [{
            name: "string",
            type: "string",
        }],
        accountAuth: "string",
        hashKey: "string",
        localSecondaryIndices: [{
            name: "string",
            projectionType: "string",
            rangeKey: "string",
            nonKeyAttributes: ["string"],
        }],
        rangeKey: "string",
        readCapacity: 0,
        accountName: "string",
        ttl: {
            attributeName: "string",
            enabled: false,
        },
        writeCapacity: 0,
    });
    
    type: alicloud:polardb:DynamoTable
    properties:
        accountAuth: string
        accountName: string
        attributes:
            - name: string
              type: string
        billingMode: string
        dbClusterId: string
        endpoint: string
        globalSecondaryIndices:
            - hashKey: string
              name: string
              nonKeyAttributes:
                - string
              projectionType: string
              rangeKey: string
              readCapacity: 0
              writeCapacity: 0
        hashKey: string
        localSecondaryIndices:
            - name: string
              nonKeyAttributes:
                - string
              projectionType: string
              rangeKey: string
        rangeKey: string
        readCapacity: 0
        tableName: string
        ttl:
            attributeName: string
            enabled: false
        writeCapacity: 0
    

    DynamoTable Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DynamoTable resource accepts the following input properties:

    DbClusterId string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    TableName string
    The name of the DynamoDB-compatible table.
    AccountAuth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    AccountName string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    Attributes List<Pulumi.AliCloud.PolarDB.Inputs.DynamoTableAttribute>
    List of attribute definitions for the table key schema and indexes. See attribute below.
    BillingMode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    GlobalSecondaryIndices List<Pulumi.AliCloud.PolarDB.Inputs.DynamoTableGlobalSecondaryIndex>
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    HashKey string
    The attribute name used as the partition key (hash key) of the table.
    LocalSecondaryIndices List<Pulumi.AliCloud.PolarDB.Inputs.DynamoTableLocalSecondaryIndex>
    Describe an LSI on the table. See localSecondaryIndex below.
    RangeKey string
    The attribute name used as the sort key (range key) of the table.
    ReadCapacity int
    The number of read capacity units. Required when billingMode is PROVISIONED.
    Ttl Pulumi.AliCloud.PolarDB.Inputs.DynamoTableTtl
    Configuration block for TTL. See ttl below.
    WriteCapacity int
    The number of write capacity units. Required when billingMode is PROVISIONED.
    DbClusterId string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    TableName string
    The name of the DynamoDB-compatible table.
    AccountAuth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    AccountName string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    Attributes []DynamoTableAttributeArgs
    List of attribute definitions for the table key schema and indexes. See attribute below.
    BillingMode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    GlobalSecondaryIndices []DynamoTableGlobalSecondaryIndexArgs
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    HashKey string
    The attribute name used as the partition key (hash key) of the table.
    LocalSecondaryIndices []DynamoTableLocalSecondaryIndexArgs
    Describe an LSI on the table. See localSecondaryIndex below.
    RangeKey string
    The attribute name used as the sort key (range key) of the table.
    ReadCapacity int
    The number of read capacity units. Required when billingMode is PROVISIONED.
    Ttl DynamoTableTtlArgs
    Configuration block for TTL. See ttl below.
    WriteCapacity int
    The number of write capacity units. Required when billingMode is PROVISIONED.
    db_cluster_id string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    table_name string
    The name of the DynamoDB-compatible table.
    account_auth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    account_name string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    attributes list(object)
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billing_mode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    global_secondary_indices list(object)
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hash_key string
    The attribute name used as the partition key (hash key) of the table.
    local_secondary_indices list(object)
    Describe an LSI on the table. See localSecondaryIndex below.
    range_key string
    The attribute name used as the sort key (range key) of the table.
    read_capacity number
    The number of read capacity units. Required when billingMode is PROVISIONED.
    ttl object
    Configuration block for TTL. See ttl below.
    write_capacity number
    The number of write capacity units. Required when billingMode is PROVISIONED.
    dbClusterId String
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    tableName String
    The name of the DynamoDB-compatible table.
    accountAuth String
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    accountName String
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    attributes List<DynamoTableAttribute>
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billingMode String
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    globalSecondaryIndices List<DynamoTableGlobalSecondaryIndex>
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hashKey String
    The attribute name used as the partition key (hash key) of the table.
    localSecondaryIndices List<DynamoTableLocalSecondaryIndex>
    Describe an LSI on the table. See localSecondaryIndex below.
    rangeKey String
    The attribute name used as the sort key (range key) of the table.
    readCapacity Integer
    The number of read capacity units. Required when billingMode is PROVISIONED.
    ttl DynamoTableTtl
    Configuration block for TTL. See ttl below.
    writeCapacity Integer
    The number of write capacity units. Required when billingMode is PROVISIONED.
    dbClusterId string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    tableName string
    The name of the DynamoDB-compatible table.
    accountAuth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    accountName string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    attributes DynamoTableAttribute[]
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billingMode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    globalSecondaryIndices DynamoTableGlobalSecondaryIndex[]
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hashKey string
    The attribute name used as the partition key (hash key) of the table.
    localSecondaryIndices DynamoTableLocalSecondaryIndex[]
    Describe an LSI on the table. See localSecondaryIndex below.
    rangeKey string
    The attribute name used as the sort key (range key) of the table.
    readCapacity number
    The number of read capacity units. Required when billingMode is PROVISIONED.
    ttl DynamoTableTtl
    Configuration block for TTL. See ttl below.
    writeCapacity number
    The number of write capacity units. Required when billingMode is PROVISIONED.
    db_cluster_id str
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint str
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    table_name str
    The name of the DynamoDB-compatible table.
    account_auth str
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    account_name str
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    attributes Sequence[DynamoTableAttributeArgs]
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billing_mode str
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    global_secondary_indices Sequence[DynamoTableGlobalSecondaryIndexArgs]
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hash_key str
    The attribute name used as the partition key (hash key) of the table.
    local_secondary_indices Sequence[DynamoTableLocalSecondaryIndexArgs]
    Describe an LSI on the table. See localSecondaryIndex below.
    range_key str
    The attribute name used as the sort key (range key) of the table.
    read_capacity int
    The number of read capacity units. Required when billingMode is PROVISIONED.
    ttl DynamoTableTtlArgs
    Configuration block for TTL. See ttl below.
    write_capacity int
    The number of write capacity units. Required when billingMode is PROVISIONED.
    dbClusterId String
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    tableName String
    The name of the DynamoDB-compatible table.
    accountAuth String
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    accountName String
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    attributes List<Property Map>
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billingMode String
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    globalSecondaryIndices List<Property Map>
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hashKey String
    The attribute name used as the partition key (hash key) of the table.
    localSecondaryIndices List<Property Map>
    Describe an LSI on the table. See localSecondaryIndex below.
    rangeKey String
    The attribute name used as the sort key (range key) of the table.
    readCapacity Number
    The number of read capacity units. Required when billingMode is PROVISIONED.
    ttl Property Map
    Configuration block for TTL. See ttl below.
    writeCapacity Number
    The number of write capacity units. Required when billingMode is PROVISIONED.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DynamoTable resource produces the following output properties:

    Arn string
    The ARN of the table, if returned by the endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    Arn string
    The ARN of the table, if returned by the endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the table, if returned by the endpoint.
    id string
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the table, if returned by the endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    arn string
    The ARN of the table, if returned by the endpoint.
    id string
    The provider-assigned unique ID for this managed resource.
    arn str
    The ARN of the table, if returned by the endpoint.
    id str
    The provider-assigned unique ID for this managed resource.
    arn String
    The ARN of the table, if returned by the endpoint.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DynamoTable Resource

    Get an existing DynamoTable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: DynamoTableState, opts?: CustomResourceOptions): DynamoTable
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_auth: Optional[str] = None,
            account_name: Optional[str] = None,
            arn: Optional[str] = None,
            attributes: Optional[Sequence[DynamoTableAttributeArgs]] = None,
            billing_mode: Optional[str] = None,
            db_cluster_id: Optional[str] = None,
            endpoint: Optional[str] = None,
            global_secondary_indices: Optional[Sequence[DynamoTableGlobalSecondaryIndexArgs]] = None,
            hash_key: Optional[str] = None,
            local_secondary_indices: Optional[Sequence[DynamoTableLocalSecondaryIndexArgs]] = None,
            range_key: Optional[str] = None,
            read_capacity: Optional[int] = None,
            table_name: Optional[str] = None,
            ttl: Optional[DynamoTableTtlArgs] = None,
            write_capacity: Optional[int] = None) -> DynamoTable
    func GetDynamoTable(ctx *Context, name string, id IDInput, state *DynamoTableState, opts ...ResourceOption) (*DynamoTable, error)
    public static DynamoTable Get(string name, Input<string> id, DynamoTableState? state, CustomResourceOptions? opts = null)
    public static DynamoTable get(String name, Output<String> id, DynamoTableState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:polardb:DynamoTable    get:      id: ${id}
    import {
      to = alicloud_polardb_dynamo_table.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccountAuth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    AccountName string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    Arn string
    The ARN of the table, if returned by the endpoint.
    Attributes List<Pulumi.AliCloud.PolarDB.Inputs.DynamoTableAttribute>
    List of attribute definitions for the table key schema and indexes. See attribute below.
    BillingMode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    DbClusterId string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    GlobalSecondaryIndices List<Pulumi.AliCloud.PolarDB.Inputs.DynamoTableGlobalSecondaryIndex>
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    HashKey string
    The attribute name used as the partition key (hash key) of the table.
    LocalSecondaryIndices List<Pulumi.AliCloud.PolarDB.Inputs.DynamoTableLocalSecondaryIndex>
    Describe an LSI on the table. See localSecondaryIndex below.
    RangeKey string
    The attribute name used as the sort key (range key) of the table.
    ReadCapacity int
    The number of read capacity units. Required when billingMode is PROVISIONED.
    TableName string
    The name of the DynamoDB-compatible table.
    Ttl Pulumi.AliCloud.PolarDB.Inputs.DynamoTableTtl
    Configuration block for TTL. See ttl below.
    WriteCapacity int
    The number of write capacity units. Required when billingMode is PROVISIONED.
    AccountAuth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    AccountName string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    Arn string
    The ARN of the table, if returned by the endpoint.
    Attributes []DynamoTableAttributeArgs
    List of attribute definitions for the table key schema and indexes. See attribute below.
    BillingMode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    DbClusterId string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    GlobalSecondaryIndices []DynamoTableGlobalSecondaryIndexArgs
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    HashKey string
    The attribute name used as the partition key (hash key) of the table.
    LocalSecondaryIndices []DynamoTableLocalSecondaryIndexArgs
    Describe an LSI on the table. See localSecondaryIndex below.
    RangeKey string
    The attribute name used as the sort key (range key) of the table.
    ReadCapacity int
    The number of read capacity units. Required when billingMode is PROVISIONED.
    TableName string
    The name of the DynamoDB-compatible table.
    Ttl DynamoTableTtlArgs
    Configuration block for TTL. See ttl below.
    WriteCapacity int
    The number of write capacity units. Required when billingMode is PROVISIONED.
    account_auth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    account_name string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    arn string
    The ARN of the table, if returned by the endpoint.
    attributes list(object)
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billing_mode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    db_cluster_id string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    global_secondary_indices list(object)
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hash_key string
    The attribute name used as the partition key (hash key) of the table.
    local_secondary_indices list(object)
    Describe an LSI on the table. See localSecondaryIndex below.
    range_key string
    The attribute name used as the sort key (range key) of the table.
    read_capacity number
    The number of read capacity units. Required when billingMode is PROVISIONED.
    table_name string
    The name of the DynamoDB-compatible table.
    ttl object
    Configuration block for TTL. See ttl below.
    write_capacity number
    The number of write capacity units. Required when billingMode is PROVISIONED.
    accountAuth String
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    accountName String
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    arn String
    The ARN of the table, if returned by the endpoint.
    attributes List<DynamoTableAttribute>
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billingMode String
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    dbClusterId String
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    globalSecondaryIndices List<DynamoTableGlobalSecondaryIndex>
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hashKey String
    The attribute name used as the partition key (hash key) of the table.
    localSecondaryIndices List<DynamoTableLocalSecondaryIndex>
    Describe an LSI on the table. See localSecondaryIndex below.
    rangeKey String
    The attribute name used as the sort key (range key) of the table.
    readCapacity Integer
    The number of read capacity units. Required when billingMode is PROVISIONED.
    tableName String
    The name of the DynamoDB-compatible table.
    ttl DynamoTableTtl
    Configuration block for TTL. See ttl below.
    writeCapacity Integer
    The number of write capacity units. Required when billingMode is PROVISIONED.
    accountAuth string
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    accountName string
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    arn string
    The ARN of the table, if returned by the endpoint.
    attributes DynamoTableAttribute[]
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billingMode string
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    dbClusterId string
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    globalSecondaryIndices DynamoTableGlobalSecondaryIndex[]
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hashKey string
    The attribute name used as the partition key (hash key) of the table.
    localSecondaryIndices DynamoTableLocalSecondaryIndex[]
    Describe an LSI on the table. See localSecondaryIndex below.
    rangeKey string
    The attribute name used as the sort key (range key) of the table.
    readCapacity number
    The number of read capacity units. Required when billingMode is PROVISIONED.
    tableName string
    The name of the DynamoDB-compatible table.
    ttl DynamoTableTtl
    Configuration block for TTL. See ttl below.
    writeCapacity number
    The number of write capacity units. Required when billingMode is PROVISIONED.
    account_auth str
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    account_name str
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    arn str
    The ARN of the table, if returned by the endpoint.
    attributes Sequence[DynamoTableAttributeArgs]
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billing_mode str
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    db_cluster_id str
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint str
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    global_secondary_indices Sequence[DynamoTableGlobalSecondaryIndexArgs]
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hash_key str
    The attribute name used as the partition key (hash key) of the table.
    local_secondary_indices Sequence[DynamoTableLocalSecondaryIndexArgs]
    Describe an LSI on the table. See localSecondaryIndex below.
    range_key str
    The attribute name used as the sort key (range key) of the table.
    read_capacity int
    The number of read capacity units. Required when billingMode is PROVISIONED.
    table_name str
    The name of the DynamoDB-compatible table.
    ttl DynamoTableTtlArgs
    Configuration block for TTL. See ttl below.
    write_capacity int
    The number of write capacity units. Required when billingMode is PROVISIONED.
    accountAuth String
    The authentication password for PolarDB DynamoDB. Usually references the dynamodbAuthPassword attribute of an alicloud.polardb.Account with accountType = "DynamoDB". If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    accountName String
    The account name for PolarDB DynamoDB authentication. If not set, it is resolved from the cluster's DynamoDB-type account automatically.
    arn String
    The ARN of the table, if returned by the endpoint.
    attributes List<Property Map>
    List of attribute definitions for the table key schema and indexes. See attribute below.
    billingMode String
    The billing mode of the table. Valid values: PROVISIONED, PAY_PER_REQUEST. Default to PROVISIONED.
    dbClusterId String
    The ID of the PolarDB cluster where DynamoDB is enabled.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    globalSecondaryIndices List<Property Map>
    Describe a GSI for the table. See globalSecondaryIndex below. Changing the key schema or projection of an existing index recreates that index.
    hashKey String
    The attribute name used as the partition key (hash key) of the table.
    localSecondaryIndices List<Property Map>
    Describe an LSI on the table. See localSecondaryIndex below.
    rangeKey String
    The attribute name used as the sort key (range key) of the table.
    readCapacity Number
    The number of read capacity units. Required when billingMode is PROVISIONED.
    tableName String
    The name of the DynamoDB-compatible table.
    ttl Property Map
    Configuration block for TTL. See ttl below.
    writeCapacity Number
    The number of write capacity units. Required when billingMode is PROVISIONED.

    Supporting Types

    DynamoTableAttribute, DynamoTableAttributeArgs

    Name string
    The name of the attribute.
    Type string
    The attribute data type. Valid values: S (string), N (number), B (binary).
    Name string
    The name of the attribute.
    Type string
    The attribute data type. Valid values: S (string), N (number), B (binary).
    name string
    The name of the attribute.
    type string
    The attribute data type. Valid values: S (string), N (number), B (binary).
    name String
    The name of the attribute.
    type String
    The attribute data type. Valid values: S (string), N (number), B (binary).
    name string
    The name of the attribute.
    type string
    The attribute data type. Valid values: S (string), N (number), B (binary).
    name str
    The name of the attribute.
    type str
    The attribute data type. Valid values: S (string), N (number), B (binary).
    name String
    The name of the attribute.
    type String
    The attribute data type. Valid values: S (string), N (number), B (binary).

    DynamoTableGlobalSecondaryIndex, DynamoTableGlobalSecondaryIndexArgs

    Name string
    The name of the index.
    ProjectionType string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    HashKey string
    The attribute name used as the partition key of the index.
    NonKeyAttributes List<string>
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    RangeKey string
    The attribute name used as the sort key of the index.
    ReadCapacity int
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    WriteCapacity int
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.
    Name string
    The name of the index.
    ProjectionType string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    HashKey string
    The attribute name used as the partition key of the index.
    NonKeyAttributes []string
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    RangeKey string
    The attribute name used as the sort key of the index.
    ReadCapacity int
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    WriteCapacity int
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.
    name string
    The name of the index.
    projection_type string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    hash_key string
    The attribute name used as the partition key of the index.
    non_key_attributes list(string)
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    range_key string
    The attribute name used as the sort key of the index.
    read_capacity number
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    write_capacity number
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.
    name String
    The name of the index.
    projectionType String
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    hashKey String
    The attribute name used as the partition key of the index.
    nonKeyAttributes List<String>
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    rangeKey String
    The attribute name used as the sort key of the index.
    readCapacity Integer
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    writeCapacity Integer
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.
    name string
    The name of the index.
    projectionType string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    hashKey string
    The attribute name used as the partition key of the index.
    nonKeyAttributes string[]
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    rangeKey string
    The attribute name used as the sort key of the index.
    readCapacity number
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    writeCapacity number
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.
    name str
    The name of the index.
    projection_type str
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    hash_key str
    The attribute name used as the partition key of the index.
    non_key_attributes Sequence[str]
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    range_key str
    The attribute name used as the sort key of the index.
    read_capacity int
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    write_capacity int
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.
    name String
    The name of the index.
    projectionType String
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    hashKey String
    The attribute name used as the partition key of the index.
    nonKeyAttributes List<String>
    A set of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    rangeKey String
    The attribute name used as the sort key of the index.
    readCapacity Number
    The number of read capacity units for the index. Only valid when billingMode is PROVISIONED.
    writeCapacity Number
    The number of write capacity units for the index. Only valid when billingMode is PROVISIONED.

    DynamoTableLocalSecondaryIndex, DynamoTableLocalSecondaryIndexArgs

    Name string
    The name of the index.
    ProjectionType string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    RangeKey string
    The attribute name used as the sort key of the index.
    NonKeyAttributes List<string>
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    Name string
    The name of the index.
    ProjectionType string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    RangeKey string
    The attribute name used as the sort key of the index.
    NonKeyAttributes []string
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    name string
    The name of the index.
    projection_type string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    range_key string
    The attribute name used as the sort key of the index.
    non_key_attributes list(string)
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    name String
    The name of the index.
    projectionType String
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    rangeKey String
    The attribute name used as the sort key of the index.
    nonKeyAttributes List<String>
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    name string
    The name of the index.
    projectionType string
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    rangeKey string
    The attribute name used as the sort key of the index.
    nonKeyAttributes string[]
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    name str
    The name of the index.
    projection_type str
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    range_key str
    The attribute name used as the sort key of the index.
    non_key_attributes Sequence[str]
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.
    name String
    The name of the index.
    projectionType String
    The set of attributes projected into the index. Valid values: ALL, KEYS_ONLY, INCLUDE.
    rangeKey String
    The attribute name used as the sort key of the index.
    nonKeyAttributes List<String>
    A list of non-key attribute names projected into the index. Only valid when projectionType is INCLUDE.

    DynamoTableTtl, DynamoTableTtlArgs

    AttributeName string
    The name of the attribute that stores the TTL timestamp.
    Enabled bool
    Whether TTL is enabled. Default to false.
    AttributeName string
    The name of the attribute that stores the TTL timestamp.
    Enabled bool
    Whether TTL is enabled. Default to false.
    attribute_name string
    The name of the attribute that stores the TTL timestamp.
    enabled bool
    Whether TTL is enabled. Default to false.
    attributeName String
    The name of the attribute that stores the TTL timestamp.
    enabled Boolean
    Whether TTL is enabled. Default to false.
    attributeName string
    The name of the attribute that stores the TTL timestamp.
    enabled boolean
    Whether TTL is enabled. Default to false.
    attribute_name str
    The name of the attribute that stores the TTL timestamp.
    enabled bool
    Whether TTL is enabled. Default to false.
    attributeName String
    The name of the attribute that stores the TTL timestamp.
    enabled Boolean
    Whether TTL is enabled. Default to false.

    Import

    PolarDB DynamoDB-compatible table can be imported using the id, e.g.

    $ pulumi import alicloud:polardb/dynamoTable:DynamoTable example pc-abc123456:table_name
    

    NOTE: On import, accountName, accountAuth and the endpoint address are resolved from the cluster automatically, but endpoint is a required argument and must still be present in the resource block. In addition, the DynamoDB-compatible endpoint does not return billing and capacity information, so billingMode, readCapacity and writeCapacity are not populated on import and the first plan may show a diff for them.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo alicloud logo
    Viewing docs for Alibaba Cloud v3.106.0
    published on Monday, Aug 24, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial