1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. polardb
  6. DynamoItem
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 item resource to manage a single item in a DynamoDB-compatible table of a PolarDB for PostgreSQL cluster.

    NOTE: Available since v1.287.0.

    NOTE: This resource is intended for managing a small amount of well-known, seed-style data. It is not recommended to manage large numbers of items with Terraform.

    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",
            },
        ],
    });
    const defaultDynamoItem = new alicloud.polardb.DynamoItem("default", {
        endpoint: pulumi.interpolate`http://${dynamoPublic.connectionString}:5432`,
        dbClusterId: defaultCluster.id,
        accountName: dynamo.accountName,
        accountAuth: dynamo.dynamodbAuthPassword,
        tableName: defaultDynamoTable.tableName,
        hashKey: "pk",
        rangeKey: "sk",
        item: JSON.stringify({
            pk: {
                S: "test-item-1",
            },
            sk: {
                S: "row1",
            },
            name: {
                S: "Test Item",
            },
            count: {
                N: "42",
            },
        }),
    });
    
    import pulumi
    import json
    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",
            },
        ])
    default_dynamo_item = alicloud.polardb.DynamoItem("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=default_dynamo_table.table_name,
        hash_key="pk",
        range_key="sk",
        item=json.dumps({
            "pk": {
                "S": "test-item-1",
            },
            "sk": {
                "S": "row1",
            },
            "name": {
                "S": "Test Item",
            },
            "count": {
                "N": "42",
            },
        }))
    
    package main
    
    import (
    	"encoding/json"
    	"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
    		}
    		defaultDynamoTable, 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
    		}
    		tmpJSON0, err := json.Marshal(map[string]map[string]string{
    			"pk": map[string]string{
    				"S": "test-item-1",
    			},
    			"sk": map[string]string{
    				"S": "row1",
    			},
    			"name": map[string]string{
    				"S": "Test Item",
    			},
    			"count": map[string]string{
    				"N": "42",
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = polardb.NewDynamoItem(ctx, "default", &polardb.DynamoItemArgs{
    			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:   defaultDynamoTable.TableName,
    			HashKey:     pulumi.String("pk"),
    			RangeKey:    pulumi.String("sk"),
    			Item:        pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    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",
                },
            },
        });
    
        var defaultDynamoItem = new AliCloud.PolarDB.DynamoItem("default", new()
        {
            Endpoint = dynamoPublic.ConnectionString.Apply(connectionString => $"http://{connectionString}:5432"),
            DbClusterId = defaultCluster.Id,
            AccountName = dynamo.AccountName,
            AccountAuth = dynamo.DynamodbAuthPassword,
            TableName = defaultDynamoTable.TableName,
            HashKey = "pk",
            RangeKey = "sk",
            Item = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["pk"] = new Dictionary<string, object?>
                {
                    ["S"] = "test-item-1",
                },
                ["sk"] = new Dictionary<string, object?>
                {
                    ["S"] = "row1",
                },
                ["name"] = new Dictionary<string, object?>
                {
                    ["S"] = "Test Item",
                },
                ["count"] = new Dictionary<string, object?>
                {
                    ["N"] = "42",
                },
            }),
        });
    
    });
    
    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 com.pulumi.alicloud.polardb.DynamoItem;
    import com.pulumi.alicloud.polardb.DynamoItemArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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());
    
            var defaultDynamoItem = new DynamoItem("defaultDynamoItem", DynamoItemArgs.builder()
                .endpoint(dynamoPublic.connectionString().applyValue(_connectionString -> String.format("http://%s:5432", _connectionString)))
                .dbClusterId(defaultCluster.id())
                .accountName(dynamo.accountName())
                .accountAuth(dynamo.dynamodbAuthPassword())
                .tableName(defaultDynamoTable.tableName())
                .hashKey("pk")
                .rangeKey("sk")
                .item(serializeJson(
                    jsonObject(
                        jsonProperty("pk", jsonObject(
                            jsonProperty("S", "test-item-1")
                        )),
                        jsonProperty("sk", jsonObject(
                            jsonProperty("S", "row1")
                        )),
                        jsonProperty("name", jsonObject(
                            jsonProperty("S", "Test Item")
                        )),
                        jsonProperty("count", jsonObject(
                            jsonProperty("N", "42")
                        ))
                    )))
                .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
      defaultDynamoItem:
        type: alicloud:polardb:DynamoItem
        name: default
        properties:
          endpoint: http://${dynamoPublic.connectionString}:5432
          dbClusterId: ${defaultCluster.id}
          accountName: ${dynamo.accountName}
          accountAuth: ${dynamo.dynamodbAuthPassword}
          tableName: ${defaultDynamoTable.tableName}
          hashKey: pk
          rangeKey: sk
          item:
            fn::toJSON:
              pk:
                S: test-item-1
              sk:
                S: row1
              name:
                S: Test Item
              count:
                N: '42'
    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"
      }
    }
    resource "alicloud_polardb_dynamoitem" "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    = alicloud_polardb_dynamotable.default.table_name
      hash_key      = "pk"
      range_key     = "sk"
      item = jsonencode({
        "pk" = {
          "S" = "test-item-1"
        }
        "sk" = {
          "S" = "row1"
        }
        "name" = {
          "S" = "Test Item"
        }
        "count" = {
          "N" = "42"
        }
      })
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create DynamoItem Resource

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

    Constructor syntax

    new DynamoItem(name: string, args: DynamoItemArgs, opts?: CustomResourceOptions);
    @overload
    def DynamoItem(resource_name: str,
                   args: DynamoItemArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def DynamoItem(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   db_cluster_id: Optional[str] = None,
                   endpoint: Optional[str] = None,
                   hash_key: Optional[str] = None,
                   item: Optional[str] = None,
                   table_name: Optional[str] = None,
                   account_auth: Optional[str] = None,
                   account_name: Optional[str] = None,
                   range_key: Optional[str] = None)
    func NewDynamoItem(ctx *Context, name string, args DynamoItemArgs, opts ...ResourceOption) (*DynamoItem, error)
    public DynamoItem(string name, DynamoItemArgs args, CustomResourceOptions? opts = null)
    public DynamoItem(String name, DynamoItemArgs args)
    public DynamoItem(String name, DynamoItemArgs args, CustomResourceOptions options)
    
    type: alicloud:polardb:DynamoItem
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_polardb_dynamo_item" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args DynamoItemArgs
    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 DynamoItemArgs
    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 DynamoItemArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DynamoItemArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DynamoItemArgs
    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 dynamoItemResource = new AliCloud.PolarDB.DynamoItem("dynamoItemResource", new()
    {
        DbClusterId = "string",
        Endpoint = "string",
        HashKey = "string",
        Item = "string",
        TableName = "string",
        AccountAuth = "string",
        AccountName = "string",
        RangeKey = "string",
    });
    
    example, err := polardb.NewDynamoItem(ctx, "dynamoItemResource", &polardb.DynamoItemArgs{
    	DbClusterId: pulumi.String("string"),
    	Endpoint:    pulumi.String("string"),
    	HashKey:     pulumi.String("string"),
    	Item:        pulumi.String("string"),
    	TableName:   pulumi.String("string"),
    	AccountAuth: pulumi.String("string"),
    	AccountName: pulumi.String("string"),
    	RangeKey:    pulumi.String("string"),
    })
    
    resource "alicloud_polardb_dynamo_item" "dynamoItemResource" {
      lifecycle {
        create_before_destroy = true
      }
      db_cluster_id = "string"
      endpoint      = "string"
      hash_key      = "string"
      item          = "string"
      table_name    = "string"
      account_auth  = "string"
      account_name  = "string"
      range_key     = "string"
    }
    
    var dynamoItemResource = new DynamoItem("dynamoItemResource", DynamoItemArgs.builder()
        .dbClusterId("string")
        .endpoint("string")
        .hashKey("string")
        .item("string")
        .tableName("string")
        .accountAuth("string")
        .accountName("string")
        .rangeKey("string")
        .build());
    
    dynamo_item_resource = alicloud.polardb.DynamoItem("dynamoItemResource",
        db_cluster_id="string",
        endpoint="string",
        hash_key="string",
        item="string",
        table_name="string",
        account_auth="string",
        account_name="string",
        range_key="string")
    
    const dynamoItemResource = new alicloud.polardb.DynamoItem("dynamoItemResource", {
        dbClusterId: "string",
        endpoint: "string",
        hashKey: "string",
        item: "string",
        tableName: "string",
        accountAuth: "string",
        accountName: "string",
        rangeKey: "string",
    });
    
    type: alicloud:polardb:DynamoItem
    properties:
        accountAuth: string
        accountName: string
        dbClusterId: string
        endpoint: string
        hashKey: string
        item: string
        rangeKey: string
        tableName: string
    

    DynamoItem 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 DynamoItem resource accepts the following input properties:

    DbClusterId string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    HashKey string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    Item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    TableName string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    RangeKey string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    DbClusterId string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    HashKey string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    Item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    TableName string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    RangeKey string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    db_cluster_id string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hash_key string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    table_name string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    range_key string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    dbClusterId String
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hashKey String
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item String

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    tableName String
    The name of the DynamoDB-compatible table that contains the item.
    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.
    rangeKey String
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    dbClusterId string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hashKey string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    tableName string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    rangeKey string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    db_cluster_id str
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint str
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hash_key str
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item str

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    table_name str
    The name of the DynamoDB-compatible table that contains the item.
    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.
    range_key str
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    dbClusterId String
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hashKey String
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item String

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    tableName String
    The name of the DynamoDB-compatible table that contains the item.
    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.
    rangeKey String
    The sort key (range key) attribute name of the item. Required if the table has a range key.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DynamoItem Resource

    Get an existing DynamoItem 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?: DynamoItemState, opts?: CustomResourceOptions): DynamoItem
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_auth: Optional[str] = None,
            account_name: Optional[str] = None,
            db_cluster_id: Optional[str] = None,
            endpoint: Optional[str] = None,
            hash_key: Optional[str] = None,
            item: Optional[str] = None,
            range_key: Optional[str] = None,
            table_name: Optional[str] = None) -> DynamoItem
    func GetDynamoItem(ctx *Context, name string, id IDInput, state *DynamoItemState, opts ...ResourceOption) (*DynamoItem, error)
    public static DynamoItem Get(string name, Input<string> id, DynamoItemState? state, CustomResourceOptions? opts = null)
    public static DynamoItem get(String name, Output<String> id, DynamoItemState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:polardb:DynamoItem    get:      id: ${id}
    import {
      to = alicloud_polardb_dynamo_item.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.
    DbClusterId string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    HashKey string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    Item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    RangeKey string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    TableName string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    DbClusterId string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    Endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    HashKey string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    Item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    RangeKey string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    TableName string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    db_cluster_id string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hash_key string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    range_key string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    table_name string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    dbClusterId String
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hashKey String
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item String

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    rangeKey String
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    tableName String
    The name of the DynamoDB-compatible table that contains the item.
    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.
    dbClusterId string
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint string
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hashKey string
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item string

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    rangeKey string
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    tableName string
    The name of the DynamoDB-compatible table that contains the item.
    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.
    db_cluster_id str
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint str
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hash_key str
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item str

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    range_key str
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    table_name str
    The name of the DynamoDB-compatible table that contains the item.
    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.
    dbClusterId String
    The ID of the PolarDB cluster where the DynamoDB table resides.
    endpoint String
    The PolarDB DynamoDB-compatible endpoint URL, in the format http://<connection_string>:5432.
    hashKey String
    The partition key (hash key) attribute name of the item. Must match the table's hash key.
    item String

    JSON representation of the item attributes in DynamoDB attribute value format, e.g. {"pk": {"S": "value"}, "count": {"N": "42"}}. The item must contain the hashKey attribute (and the rangeKey attribute if set). Supported type descriptors: S, N, B, BOOL, NULL, L, M, SS, NS, BS.

    NOTE: Changing the key attribute values inside item results in a new item being written; the resource ID will be recomputed accordingly.

    rangeKey String
    The sort key (range key) attribute name of the item. Required if the table has a range key.
    tableName String
    The name of the DynamoDB-compatible table that contains the item.

    Import

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

    $ pulumi import alicloud:polardb/dynamoItem:DynamoItem example pc-abc123456:table_name:hash_value:range_value
    

    NOTE: On import, accountName, accountAuth, hashKey, rangeKey and the endpoint address are resolved from the cluster and table schema automatically, but endpoint, hashKey and the other required arguments must still be present in the resource block.

    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