Skip to content

Commit

Permalink
Bash: fix output for 2 DynamoDB functions (awsdocs#5685)
Browse files Browse the repository at this point in the history
  • Loading branch information
meyertst-aws committed Jan 4, 2024
1 parent 7a28f0d commit 3929676
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
33 changes: 17 additions & 16 deletions aws-cli/bash-linux/dynamodb/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--Generated by WRITEME on 2023-09-07 15:08:02.300864 (UTC)-->
# DynamoDB code examples for the Command Line Interface with Bash script
<!--Generated by WRITEME on 2023-11-17 16:06:09.565648 (UTC)-->
# DynamoDB code examples for the AWS CLI with Bash script

## Overview

Expand All @@ -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).
Expand All @@ -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



<!--custom.instructions.start-->
<!--custom.instructions.end-->

Expand Down Expand Up @@ -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)

<!--custom.resources.start-->
<!--custom.resources.end-->
Expand Down
6 changes: 3 additions & 3 deletions aws-cli/bash-linux/dynamodb/dynamodb_operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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=${?}

Expand Down

0 comments on commit 3929676

Please sign in to comment.