Há mais AWS SDK exemplos disponíveis no GitHub repositório AWS Doc SDK Examples
As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.
Exemplos de Amazon Keyspaces usando SDK para Kotlin
Os exemplos de código a seguir mostram como realizar ações e implementar cenários comuns usando o AWS SDK for Kotlin com Amazon Keyspaces.
As noções básicas são exemplos de código que mostram como realizar as operações essenciais em um serviço.
Ações são trechos de código de programas maiores e devem ser executadas em contexto. Embora as ações mostrem como chamar funções de serviço individuais, é possível ver as ações no contexto em seus cenários relacionados.
Cada exemplo inclui um link para o código-fonte completo, onde você pode encontrar instruções sobre como configurar e executar o código no contexto.
Conceitos básicos
Os exemplos de código a seguir mostram como começar a usar o Amazon Keyspaces.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. /** Before running this Kotlin code example, set up your development environment, including your credentials. For more information, see the following documentation topic: https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html */ suspend fun main() { listKeyspaces() } suspend fun listKeyspaces() { val keyspacesRequest = ListKeyspacesRequest { maxResults = 10 } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.listKeyspaces(keyspacesRequest) response.keyspaces?.forEach { keyspace -> println("The name of the keyspace is ${keyspace.keyspaceName}") } } }
-
Para API obter detalhes, consulte a ListKeyspaces
referência AWS SDKdo Kotlin API.
-
Tópicos
Conceitos básicos
O exemplo de código a seguir mostra como:
Criar um keyspace e uma tabela. O esquema da tabela contém dados do filme e tem a point-in-time recuperação ativada.
Conecte-se ao keyspace usando uma TLS conexão segura com a autenticação SigV4.
Consultar a tabela. Adicionar, recuperar e atualizar dados do filme.
Atualizar a tabela. Adicionar uma coluna para rastrear os filmes assistidos.
Restaurar a tabela ao estado anterior e limpar os recursos.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. /** Before running this Kotlin code example, set up your development environment, including your credentials. For more information, see the following documentation topic: https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html This example uses a secure file format to hold certificate information for Kotlin applications. This is required to make a connection to Amazon Keyspaces. For more information, see the following documentation topic: https://docs.aws.amazon.com/keyspaces/latest/devguide/using_java_driver.html This Kotlin example performs the following tasks: 1. Create a keyspace. 2. Check for keyspace existence. 3. List keyspaces using a paginator. 4. Create a table with a simple movie data schema and enable point-in-time recovery. 5. Check for the table to be in an Active state. 6. List all tables in the keyspace. 7. Use a Cassandra driver to insert some records into the Movie table. 8. Get all records from the Movie table. 9. Get a specific Movie. 10. Get a UTC timestamp for the current time. 11. Update the table schema to add a ‘watched’ Boolean column. 12. Update an item as watched. 13. Query for items with watched = True. 14. Restore the table back to the previous state using the timestamp. 15. Check for completion of the restore action. 16. Delete the table. 17. Confirm that both tables are deleted. 18. Delete the keyspace. */ /* Usage: fileName - The name of the JSON file that contains movie data. (Get this file from the GitHub repo at resources/sample_file.) keyspaceName - The name of the keyspace to create. */ val DASHES: String = String(CharArray(80)).replace("\u0000", "-") suspend fun main() { val fileName = "<Replace with the JSON file that contains movie data>" val keyspaceName = "<Replace with the name of the keyspace to create>" val titleUpdate = "The Family" val yearUpdate = 2013 val tableName = "MovieKotlin" val tableNameRestore = "MovieRestore" val loader = DriverConfigLoader.fromClasspath("application.conf") val session = CqlSession .builder() .withConfigLoader(loader) .build() println(DASHES) println("Welcome to the Amazon Keyspaces example scenario.") println(DASHES) println(DASHES) println("1. Create a keyspace.") createKeySpace(keyspaceName) println(DASHES) println(DASHES) delay(5000) println("2. Check for keyspace existence.") checkKeyspaceExistence(keyspaceName) println(DASHES) println(DASHES) println("3. List keyspaces using a paginator.") listKeyspacesPaginator() println(DASHES) println(DASHES) println("4. Create a table with a simple movie data schema and enable point-in-time recovery.") createTable(keyspaceName, tableName) println(DASHES) println(DASHES) println("5. Check for the table to be in an Active state.") delay(6000) checkTable(keyspaceName, tableName) println(DASHES) println(DASHES) println("6. List all tables in the keyspace.") listTables(keyspaceName) println(DASHES) println(DASHES) println("7. Use a Cassandra driver to insert some records into the Movie table.") delay(6000) loadData(session, fileName, keyspaceName) println(DASHES) println(DASHES) println("8. Get all records from the Movie table.") getMovieData(session, keyspaceName) println(DASHES) println(DASHES) println("9. Get a specific Movie.") getSpecificMovie(session, keyspaceName) println(DASHES) println(DASHES) println("10. Get a UTC timestamp for the current time.") val utc = ZonedDateTime.now(ZoneOffset.UTC) println("DATETIME = ${Date.from(utc.toInstant())}") println(DASHES) println(DASHES) println("11. Update the table schema to add a watched Boolean column.") updateTable(keyspaceName, tableName) println(DASHES) println(DASHES) println("12. Update an item as watched.") delay(10000) // Wait 10 seconds for the update. updateRecord(session, keyspaceName, titleUpdate, yearUpdate) println(DASHES) println(DASHES) println("13. Query for items with watched = True.") getWatchedData(session, keyspaceName) println(DASHES) println(DASHES) println("14. Restore the table back to the previous state using the timestamp.") println("Note that the restore operation can take up to 20 minutes.") restoreTable(keyspaceName, utc) println(DASHES) println(DASHES) println("15. Check for completion of the restore action.") delay(5000) checkRestoredTable(keyspaceName, "MovieRestore") println(DASHES) println(DASHES) println("16. Delete both tables.") deleteTable(keyspaceName, tableName) deleteTable(keyspaceName, tableNameRestore) println(DASHES) println(DASHES) println("17. Confirm that both tables are deleted.") checkTableDelete(keyspaceName, tableName) checkTableDelete(keyspaceName, tableNameRestore) println(DASHES) println(DASHES) println("18. Delete the keyspace.") deleteKeyspace(keyspaceName) println(DASHES) println(DASHES) println("The scenario has completed successfully.") println(DASHES) } suspend fun deleteKeyspace(keyspaceNameVal: String?) { val deleteKeyspaceRequest = DeleteKeyspaceRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient.deleteKeyspace(deleteKeyspaceRequest) } } suspend fun checkTableDelete( keyspaceNameVal: String?, tableNameVal: String?, ) { var status: String var response: GetTableResponse val tableRequest = GetTableRequest { keyspaceName = keyspaceNameVal tableName = tableNameVal } try { KeyspacesClient { region = "us-east-1" }.use { keyClient -> // Keep looping until the table cannot be found and a ResourceNotFoundException is thrown. while (true) { response = keyClient.getTable(tableRequest) status = response.status.toString() println(". The table status is $status") delay(500) } } } catch (e: ResourceNotFoundException) { println(e.message) } println("The table is deleted") } suspend fun deleteTable( keyspaceNameVal: String?, tableNameVal: String?, ) { val tableRequest = DeleteTableRequest { keyspaceName = keyspaceNameVal tableName = tableNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient.deleteTable(tableRequest) } } suspend fun checkRestoredTable( keyspaceNameVal: String?, tableNameVal: String?, ) { var tableStatus = false var status: String var response: GetTableResponse? = null val tableRequest = GetTableRequest { keyspaceName = keyspaceNameVal tableName = tableNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> while (!tableStatus) { response = keyClient.getTable(tableRequest) status = response!!.status.toString() println("The table status is $status") if (status.compareTo("ACTIVE") == 0) { tableStatus = true } delay(500) } val cols = response!!.schemaDefinition?.allColumns if (cols != null) { for (def in cols) { println("The column name is ${def.name}") println("The column type is ${def.type}") } } } } suspend fun restoreTable( keyspaceName: String?, utc: ZonedDateTime, ) { // Create an aws.smithy.kotlin.runtime.time.Instant value. val timeStamp = aws.smithy.kotlin.runtime.time .Instant(utc.toInstant()) val restoreTableRequest = RestoreTableRequest { restoreTimestamp = timeStamp sourceTableName = "MovieKotlin" targetKeyspaceName = keyspaceName targetTableName = "MovieRestore" sourceKeyspaceName = keyspaceName } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.restoreTable(restoreTableRequest) println("The ARN of the restored table is ${response.restoredTableArn}") } } fun getWatchedData( session: CqlSession, keyspaceName: String, ) { val resultSet = session.execute("SELECT * FROM \"$keyspaceName\".\"MovieKotlin\" WHERE watched = true ALLOW FILTERING;") resultSet.forEach { item: Row -> println("The Movie title is ${item.getString("title")}") println("The Movie year is ${item.getInt("year")}") println("The plot is ${item.getString("plot")}") } } fun updateRecord( session: CqlSession, keySpace: String, titleUpdate: String?, yearUpdate: Int, ) { val sqlStatement = "UPDATE \"$keySpace\".\"MovieKotlin\" SET watched=true WHERE title = :k0 AND year = :k1;" val builder = BatchStatement.builder(DefaultBatchType.UNLOGGED) builder.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM) val preparedStatement = session.prepare(sqlStatement) builder.addStatement( preparedStatement .boundStatementBuilder() .setString("k0", titleUpdate) .setInt("k1", yearUpdate) .build(), ) val batchStatement = builder.build() session.execute(batchStatement) } suspend fun updateTable( keySpace: String?, tableNameVal: String?, ) { val def = ColumnDefinition { name = "watched" type = "boolean" } val tableRequest = UpdateTableRequest { keyspaceName = keySpace tableName = tableNameVal addColumns = listOf(def) } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient.updateTable(tableRequest) } } fun getSpecificMovie( session: CqlSession, keyspaceName: String, ) { val resultSet = session.execute("SELECT * FROM \"$keyspaceName\".\"MovieKotlin\" WHERE title = 'The Family' ALLOW FILTERING ;") resultSet.forEach { item: Row -> println("The Movie title is ${item.getString("title")}") println("The Movie year is ${item.getInt("year")}") println("The plot is ${item.getString("plot")}") } } // Get records from the Movie table. fun getMovieData( session: CqlSession, keyspaceName: String, ) { val resultSet = session.execute("SELECT * FROM \"$keyspaceName\".\"MovieKotlin\";") resultSet.forEach { item: Row -> println("The Movie title is ${item.getString("title")}") println("The Movie year is ${item.getInt("year")}") println("The plot is ${item.getString("plot")}") } } // Load data into the table. fun loadData( session: CqlSession, fileName: String, keySpace: String, ) { val sqlStatement = "INSERT INTO \"$keySpace\".\"MovieKotlin\" (title, year, plot) values (:k0, :k1, :k2)" val parser = JsonFactory().createParser(File(fileName)) val rootNode = ObjectMapper().readTree<JsonNode>(parser) val iter: Iterator<JsonNode> = rootNode.iterator() var currentNode: ObjectNode var t = 0 while (iter.hasNext()) { if (t == 50) { break } currentNode = iter.next() as ObjectNode val year = currentNode.path("year").asInt() val title = currentNode.path("title").asText() val info = currentNode.path("info").toString() // Insert the data into the Amazon Keyspaces table. val builder = BatchStatement.builder(DefaultBatchType.UNLOGGED) builder.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM) val preparedStatement: PreparedStatement = session.prepare(sqlStatement) builder.addStatement( preparedStatement .boundStatementBuilder() .setString("k0", title) .setInt("k1", year) .setString("k2", info) .build(), ) val batchStatement = builder.build() session.execute(batchStatement) t++ } } suspend fun listTables(keyspaceNameVal: String?) { val tablesRequest = ListTablesRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient .listTablesPaginated(tablesRequest) .transform { it.tables?.forEach { obj -> emit(obj) } } .collect { obj -> println(" ARN: ${obj.resourceArn} Table name: ${obj.tableName}") } } } suspend fun checkTable( keyspaceNameVal: String?, tableNameVal: String?, ) { var tableStatus = false var status: String var response: GetTableResponse? = null val tableRequest = GetTableRequest { keyspaceName = keyspaceNameVal tableName = tableNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> while (!tableStatus) { response = keyClient.getTable(tableRequest) status = response!!.status.toString() println(". The table status is $status") if (status.compareTo("ACTIVE") == 0) { tableStatus = true } delay(500) } val cols: List<ColumnDefinition>? = response!!.schemaDefinition?.allColumns if (cols != null) { for (def in cols) { println("The column name is ${def.name}") println("The column type is ${def.type}") } } } } suspend fun createTable( keySpaceVal: String?, tableNameVal: String?, ) { // Set the columns. val defTitle = ColumnDefinition { name = "title" type = "text" } val defYear = ColumnDefinition { name = "year" type = "int" } val defReleaseDate = ColumnDefinition { name = "release_date" type = "timestamp" } val defPlot = ColumnDefinition { name = "plot" type = "text" } val colList = ArrayList<ColumnDefinition>() colList.add(defTitle) colList.add(defYear) colList.add(defReleaseDate) colList.add(defPlot) // Set the keys. val yearKey = PartitionKey { name = "year" } val titleKey = PartitionKey { name = "title" } val keyList = ArrayList<PartitionKey>() keyList.add(yearKey) keyList.add(titleKey) val schemaDefinitionOb = SchemaDefinition { partitionKeys = keyList allColumns = colList } val timeRecovery = PointInTimeRecovery { status = PointInTimeRecoveryStatus.Enabled } val tableRequest = CreateTableRequest { keyspaceName = keySpaceVal tableName = tableNameVal schemaDefinition = schemaDefinitionOb pointInTimeRecovery = timeRecovery } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.createTable(tableRequest) println("The table ARN is ${response.resourceArn}") } } suspend fun listKeyspacesPaginator() { KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient .listKeyspacesPaginated(ListKeyspacesRequest {}) .transform { it.keyspaces?.forEach { obj -> emit(obj) } } .collect { obj -> println("Name: ${obj.keyspaceName}") } } } suspend fun checkKeyspaceExistence(keyspaceNameVal: String?) { val keyspaceRequest = GetKeyspaceRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response: GetKeyspaceResponse = keyClient.getKeyspace(keyspaceRequest) val name = response.keyspaceName println("The $name KeySpace is ready") } } suspend fun createKeySpace(keyspaceNameVal: String) { val keyspaceRequest = CreateKeyspaceRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.createKeyspace(keyspaceRequest) println("The ARN of the KeySpace is ${response.resourceArn}") } }
-
Para API obter detalhes, consulte os tópicos a seguir AWS SDKpara referência do Kotlin API.
-
Ações
O código de exemplo a seguir mostra como usar CreateKeyspace
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun createKeySpace(keyspaceNameVal: String) { val keyspaceRequest = CreateKeyspaceRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.createKeyspace(keyspaceRequest) println("The ARN of the KeySpace is ${response.resourceArn}") } }
-
Para API obter detalhes, consulte a CreateKeyspace
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar CreateTable
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun createTable( keySpaceVal: String?, tableNameVal: String?, ) { // Set the columns. val defTitle = ColumnDefinition { name = "title" type = "text" } val defYear = ColumnDefinition { name = "year" type = "int" } val defReleaseDate = ColumnDefinition { name = "release_date" type = "timestamp" } val defPlot = ColumnDefinition { name = "plot" type = "text" } val colList = ArrayList<ColumnDefinition>() colList.add(defTitle) colList.add(defYear) colList.add(defReleaseDate) colList.add(defPlot) // Set the keys. val yearKey = PartitionKey { name = "year" } val titleKey = PartitionKey { name = "title" } val keyList = ArrayList<PartitionKey>() keyList.add(yearKey) keyList.add(titleKey) val schemaDefinitionOb = SchemaDefinition { partitionKeys = keyList allColumns = colList } val timeRecovery = PointInTimeRecovery { status = PointInTimeRecoveryStatus.Enabled } val tableRequest = CreateTableRequest { keyspaceName = keySpaceVal tableName = tableNameVal schemaDefinition = schemaDefinitionOb pointInTimeRecovery = timeRecovery } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.createTable(tableRequest) println("The table ARN is ${response.resourceArn}") } }
-
Para API obter detalhes, consulte a CreateTable
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar DeleteKeyspace
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun deleteKeyspace(keyspaceNameVal: String?) { val deleteKeyspaceRequest = DeleteKeyspaceRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient.deleteKeyspace(deleteKeyspaceRequest) } }
-
Para API obter detalhes, consulte a DeleteKeyspace
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar DeleteTable
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun deleteTable( keyspaceNameVal: String?, tableNameVal: String?, ) { val tableRequest = DeleteTableRequest { keyspaceName = keyspaceNameVal tableName = tableNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient.deleteTable(tableRequest) } }
-
Para API obter detalhes, consulte a DeleteTable
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar GetKeyspace
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun checkKeyspaceExistence(keyspaceNameVal: String?) { val keyspaceRequest = GetKeyspaceRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response: GetKeyspaceResponse = keyClient.getKeyspace(keyspaceRequest) val name = response.keyspaceName println("The $name KeySpace is ready") } }
-
Para API obter detalhes, consulte a GetKeyspace
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar GetTable
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun checkTable( keyspaceNameVal: String?, tableNameVal: String?, ) { var tableStatus = false var status: String var response: GetTableResponse? = null val tableRequest = GetTableRequest { keyspaceName = keyspaceNameVal tableName = tableNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> while (!tableStatus) { response = keyClient.getTable(tableRequest) status = response!!.status.toString() println(". The table status is $status") if (status.compareTo("ACTIVE") == 0) { tableStatus = true } delay(500) } val cols: List<ColumnDefinition>? = response!!.schemaDefinition?.allColumns if (cols != null) { for (def in cols) { println("The column name is ${def.name}") println("The column type is ${def.type}") } } } }
-
Para API obter detalhes, consulte a GetTable
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar ListKeyspaces
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun listKeyspacesPaginator() { KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient .listKeyspacesPaginated(ListKeyspacesRequest {}) .transform { it.keyspaces?.forEach { obj -> emit(obj) } } .collect { obj -> println("Name: ${obj.keyspaceName}") } } }
-
Para API obter detalhes, consulte a ListKeyspaces
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar ListTables
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun listTables(keyspaceNameVal: String?) { val tablesRequest = ListTablesRequest { keyspaceName = keyspaceNameVal } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient .listTablesPaginated(tablesRequest) .transform { it.tables?.forEach { obj -> emit(obj) } } .collect { obj -> println(" ARN: ${obj.resourceArn} Table name: ${obj.tableName}") } } }
-
Para API obter detalhes, consulte a ListTables
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar RestoreTable
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun restoreTable( keyspaceName: String?, utc: ZonedDateTime, ) { // Create an aws.smithy.kotlin.runtime.time.Instant value. val timeStamp = aws.smithy.kotlin.runtime.time .Instant(utc.toInstant()) val restoreTableRequest = RestoreTableRequest { restoreTimestamp = timeStamp sourceTableName = "MovieKotlin" targetKeyspaceName = keyspaceName targetTableName = "MovieRestore" sourceKeyspaceName = keyspaceName } KeyspacesClient { region = "us-east-1" }.use { keyClient -> val response = keyClient.restoreTable(restoreTableRequest) println("The ARN of the restored table is ${response.restoredTableArn}") } }
-
Para API obter detalhes, consulte a RestoreTable
referência AWS SDKdo Kotlin API.
-
O código de exemplo a seguir mostra como usar UpdateTable
.
- SDKpara Kotlin
-
nota
Tem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no Repositório de exemplos de código da AWS
. suspend fun updateTable( keySpace: String?, tableNameVal: String?, ) { val def = ColumnDefinition { name = "watched" type = "boolean" } val tableRequest = UpdateTableRequest { keyspaceName = keySpace tableName = tableNameVal addColumns = listOf(def) } KeyspacesClient { region = "us-east-1" }.use { keyClient -> keyClient.updateTable(tableRequest) } }
-
Para API obter detalhes, consulte a UpdateTable
referência AWS SDKdo Kotlin API.
-