Whatever message this page gives is out now! Go check it out!

CreateTable

Last update:
May 18, 2026

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

Figure: CreateTable output
CreateTable output

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page