From 258f4b04dcaa4dc0fecb4904f704bd8d5e538a94 Mon Sep 17 00:00:00 2001 From: Steven Meyer <108885656+meyertst-aws@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:31:37 -0500 Subject: [PATCH] Bash: fix output for 2 DynamoDB functions (#5685) --- aws-cli/bash-linux/dynamodb/README.md | 33 ++++++++++--------- .../dynamodb/dynamodb_operations.sh | 6 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/aws-cli/bash-linux/dynamodb/README.md b/aws-cli/bash-linux/dynamodb/README.md index 9dbc67f0b93..ceb4d76059f 100644 --- a/aws-cli/bash-linux/dynamodb/README.md +++ b/aws-cli/bash-linux/dynamodb/README.md @@ -1,5 +1,5 @@ - -# DynamoDB code examples for the Command Line Interface with Bash script + +# DynamoDB code examples for the AWS CLI with Bash script ## Overview @@ -12,7 +12,7 @@ Shows how to use the AWS Command Line Interface with Bash script to work with Am ## ⚠ Important -* Running this code might result in charges to your AWS account. +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/?aws-products-pricing.sort-by=item.additionalFields.productNameLowercase&aws-products-pricing.sort-order=asc&awsf.Free%20Tier%20Type=*all&awsf.tech-category=*all) and [Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all). * Running the tests might result in charges to your AWS account. * We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). * This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). @@ -35,30 +35,31 @@ For prerequisites, see the [README](../../README.md#Prerequisites) in the `aws-c Code excerpts that show you how to call individual service functions. * [Create a table](dynamodb_operations.sh#L22) (`CreateTable`) -* [Delete a table](dynamodb_operations.sh#L936) (`DeleteTable`) -* [Delete an item from a table](dynamodb_operations.sh#L477) (`DeleteItem`) -* [Get a batch of items](dynamodb_operations.sh#L840) (`BatchGetItem`) -* [Get an item from a table](dynamodb_operations.sh#L382) (`GetItem`) -* [Get information about a table](dynamodb_operations.sh#L126) (`DescribeTable`) -* [List tables](dynamodb_operations.sh#L907) (`ListTables`) -* [Put an item in a table](dynamodb_operations.sh#L200) (`PutItem`) -* [Query a table](dynamodb_operations.sh#L556) (`Query`) -* [Scan a table](dynamodb_operations.sh#L664) (`Scan`) -* [Update an item in a table](dynamodb_operations.sh#L283) (`UpdateItem`) -* [Write a batch of items](dynamodb_operations.sh#L772) (`BatchWriteItem`) +* [Delete a table](dynamodb_operations.sh#L1003) (`DeleteTable`) +* [Delete an item from a table](dynamodb_operations.sh#L540) (`DeleteItem`) +* [Get a batch of items](dynamodb_operations.sh#L907) (`BatchGetItem`) +* [Get an item from a table](dynamodb_operations.sh#L444) (`GetItem`) +* [Get information about a table](dynamodb_operations.sh#L188) (`DescribeTable`) +* [List tables](dynamodb_operations.sh#L974) (`ListTables`) +* [Put an item in a table](dynamodb_operations.sh#L262) (`PutItem`) +* [Query a table](dynamodb_operations.sh#L619) (`Query`) +* [Scan a table](dynamodb_operations.sh#L729) (`Scan`) +* [Update an item in a table](dynamodb_operations.sh#L343) (`UpdateItem`) +* [Write a batch of items](dynamodb_operations.sh#L839) (`BatchWriteItem`) ### Scenarios Code examples that show you how to accomplish a specific task by calling multiple functions within the same service. -* [Get started with tables, items, and queries](scenario_getting_started_movies.sh) +* [Get started with tables, items, and queries](scenario_getting_started_movies.sh) ## Run the examples ### Instructions + @@ -99,7 +100,7 @@ in the `aws-cli` folder. * [DynamoDB Developer Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html) * [DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/Welcome.html) -* [Command Line Interface with Bash script DynamoDB reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html) +* [AWS CLI with Bash script DynamoDB reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html) diff --git a/aws-cli/bash-linux/dynamodb/dynamodb_operations.sh b/aws-cli/bash-linux/dynamodb/dynamodb_operations.sh index ea7d2404914..7b01a7a0ec0 100644 --- a/aws-cli/bash-linux/dynamodb/dynamodb_operations.sh +++ b/aws-cli/bash-linux/dynamodb/dynamodb_operations.sh @@ -515,7 +515,8 @@ function dynamodb_get_item() { response=$( aws dynamodb get-item \ --table-name "$table_name" \ - --key file://"$keys" + --key file://"$keys" \ + --output text ) fi @@ -1053,8 +1054,7 @@ function dynamodb_delete_table() { iecho "" response=$(aws dynamodb delete-table \ - --table-name "$table_name" \ - --output text) + --table-name "$table_name") local error_code=${?}