Last updated on 
                
                    Apr 27, 2021
                
            
            
        
        
    
Description
This function updates the provisioned throughput settings, global secondary indexes, or DynamoDB Streams settings for a specified table.
For more information, see UpdateTable.
Category
History
ColdFusion (2021 release): Added this function.
Syntax
serviceHandle.updateTable(requestParameters)
Parameters
See the request parameters of UpdateTable.
Example
<cfscript> 
    cred = { 
        "credentialAlias" : "myalias", 
        "vendorName" : "AWS", 
        "region" : "us-east-2", 
        "secretAccessKey" : "xxxxx", 
        "accessKeyId" : "xxxx" 
    } 
    config = { 
        "serviceName" = "DYNAMODB" 
    } 
    dynamo = getCloudService(cred, config) 
 
    tableName="NewProductCatalog" 
 
    oldReadCapacityUnits=50 
    oldWriteCapacityUnits=50 
    newReadCapacityUnits=100 
    newWriteCapacityUnits=100 
 
    updateTableStruct={ 
        "TableName": "#tableName#", 
        "ProvisionedThroughput": { 
            "ReadCapacityUnits": "#newReadCapacityUnits#", 
            "WriteCapacityUnits": "#newWriteCapacityUnits#" 
        } 
    } 
 
    try{ 
        updateTableResponse=dynamo.updateTable(updateTableStruct) 
        if( 
            (updateTableResponse.HttpResponse.StatusCode==200) and 
            (updateTableResponse.TableDescription.ProvisionedThroughput.ReadCapacityUnits==oldReadCapacityUnits) and 
            (updateTableResponse.TableDescription.ProvisionedThroughput.WriteCapacityUnits==oldWriteCapacityUnits) and 
            (updateTableResponse.TableDescription.TableStatus=="UPDATING") 
        ) 
        { 
            writeOutput("Old read and write values correct.") 
        } 
        else { 
            writeOutput("Old read and write values incorrect.") 
        } 
    } 
    catch(any e){ 
        writeDump(e) 
    } 
</cfscript>