CreateTable

Description

The CreateTable function creates a table in your AWS account. In an AWS account, table names must be unique in each Region. You can have two tables with same name if you create the tables in different regions.

For more information, see CreateTable.

Category

History

ColdFusion (2021 release): Added this function.

Syntax

serviceHandle.createTable(requestParameters)

Parameters

See request parameters of CreateTable.

Example

<cfscript> 
  cred = { 
    "credentialAlias" : "myalias", 
    "vendorName" : "AWS", 
    "region" : "us-east-2", 
    "secretAccessKey" : "xxxxx", 
    "accessKeyId" : "xxxx" 
  } 
  config = { 
    "serviceName" = "DYNAMODB" 
  } 
  dynamo = getCloudService(cred, config) 
  // create table movies 
  tableStruct={ 
    TableName : "MoviesNew", 
    KeySchema:[ 
        { AttributeName: "year", KeyType: "HASH"},  // Partition key 
        { AttributeName: "title", KeyType: "RANGE"}  // Sort key 
    ], 
    AttributeDefinitions:[ 
        { AttributeName: "year", AttributeType: "N" }, 
        { AttributeName: "title", AttributeType: "S" } 
    ], 
    ProvisionedThroughput:{ 
        ReadCapacityUnits: 10, 
        WriteCapacityUnits: 10 
    } 
 } 
  createTableResponse=dynamo.createTable(tableStruct,{"customResponse": true}) 
  writeDump(createTableResponse) 
</cfscript> 

Output

CreateTable output
CreateTable output

 Adobe

Dapatkan bantuan lebih cepat dan lebih mudah

Pengguna baru?

Adobe MAX 2024

Adobe MAX
Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX

Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX 2024

Adobe MAX
Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX

Konferensi Kreativitas

14–16 Oktober Miami Beach dan online