Skip to content

Commit b89473d

Browse files
authored
Merge branch 'main' into tools-release
2 parents ce719b6 + 80d9dea commit b89473d

29 files changed

+1276
-107
lines changed

.doc_gen/metadata/sqs_metadata.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,22 @@ sqs_SendMessage:
481481
github: javav2/example_code/sqs
482482
sdkguide:
483483
excerpts:
484-
- description:
484+
- description: >-
485+
Two examples of the <code>SendMessage</code> operation follow:</para>
486+
<itemizedlist>
487+
<listitem>
488+
<para>Send a message with a body and a delay</para>
489+
</listitem>
490+
<listitem>
491+
<para>Send a message with a body and message attributes</para>
492+
</listitem>
493+
</itemizedlist>
494+
<para>Send a message with a body and a delay.
485495
snippet_tags:
486496
- sqs.java2.send_recieve_messages.main
497+
- description: Send a message with a body and message attributes.
498+
snippet_tags:
499+
- sqs.java2.message_attributes.create
487500
Python:
488501
versions:
489502
- sdk_version: 3
@@ -1006,6 +1019,15 @@ sqs_SetQueueAttributes:
10061019
- description:
10071020
snippet_tags:
10081021
- swift.sqs.SetQueueAttributes
1022+
Java:
1023+
versions:
1024+
- sdk_version: 2
1025+
github: javav2/example_code/sqs
1026+
sdkguide:
1027+
excerpts:
1028+
- description: Configure an &SQS; to use server-side encryption (SSE) using a custom KMS key.
1029+
snippet_tags:
1030+
- sqs.java2.sqs_sse_example.add-encryption-method
10091031
services:
10101032
sqs: {SetQueueAttributes}
10111033
sqs_Scenario_TopicsAndQueues:
@@ -1091,3 +1113,20 @@ sqs_Scenario_TopicsAndQueues:
10911113
services:
10921114
sns: {CreateTopic, Subscribe, Publish, Unsubscribe, DeleteTopic}
10931115
sqs: {CreateQueue, GetQueueAttributes, SetQueueAttributes, ReceiveMessage, DeleteMessageBatch, DeleteQueue}
1116+
sqs_Scenario_WorkWithTags:
1117+
title: Work with queue tags and &SQS; using an &AWS; SDK
1118+
title_abbrev: Work with queue tags
1119+
synopsis: perform tagging operation with &SQS;
1120+
category: Scenarios
1121+
languages:
1122+
Java:
1123+
versions:
1124+
- sdk_version: 2
1125+
github: javav2/example_code/sqs
1126+
sdkguide:
1127+
excerpts:
1128+
- description: The following example creates tags for a queue, lists tags, and removes a tag.
1129+
snippet_tags:
1130+
- sqs.java2.tag-examples
1131+
services:
1132+
sqs: {TagQueue, ListQueueTags, UntagQueue}

aws-cli/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.sh text eol=lf

aws-cli/bash-linux/dynamodb/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ Code examples that show you how to perform the essential operations within a ser
4040

4141
Code excerpts that show you how to call individual service functions.
4242

43-
- [BatchGetItem](dynamodb_operations.sh#L902)
44-
- [BatchWriteItem](dynamodb_operations.sh#L834)
43+
- [BatchGetItem](dynamodb_operations.sh#L892)
44+
- [BatchWriteItem](dynamodb_operations.sh#L824)
4545
- [CreateTable](dynamodb_operations.sh#L17)
46-
- [DeleteItem](dynamodb_operations.sh#L535)
47-
- [DeleteTable](dynamodb_operations.sh#L998)
48-
- [DescribeTable](dynamodb_operations.sh#L183)
49-
- [GetItem](dynamodb_operations.sh#L439)
50-
- [ListTables](dynamodb_operations.sh#L969)
51-
- [PutItem](dynamodb_operations.sh#L257)
52-
- [Query](dynamodb_operations.sh#L614)
53-
- [Scan](dynamodb_operations.sh#L724)
54-
- [UpdateItem](dynamodb_operations.sh#L338)
46+
- [DeleteItem](dynamodb_operations.sh#L525)
47+
- [DeleteTable](dynamodb_operations.sh#L988)
48+
- [DescribeTable](dynamodb_operations.sh#L173)
49+
- [GetItem](dynamodb_operations.sh#L429)
50+
- [ListTables](dynamodb_operations.sh#L959)
51+
- [PutItem](dynamodb_operations.sh#L247)
52+
- [Query](dynamodb_operations.sh#L604)
53+
- [Scan](dynamodb_operations.sh#L714)
54+
- [UpdateItem](dynamodb_operations.sh#L328)
5555

5656

5757
<!--custom.examples.start-->
@@ -111,4 +111,4 @@ in the `aws-cli` folder.
111111

112112
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
113113

114-
SPDX-License-Identifier: Apache-2.0
114+
SPDX-License-Identifier: Apache-2.0

aws-cli/bash-linux/dynamodb/dynamodb_operations.sh

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: Apache-2.0
44

55
###############################################################################
66
#
@@ -24,36 +24,33 @@ source ./awsdocs_general.sh
2424
# -n table_name -- The name of the table to create.
2525
# -a attribute_definitions -- JSON file path of a list of attributes and their types.
2626
# -k key_schema -- JSON file path of a list of attributes and their key types.
27-
# -p provisioned_throughput -- Provisioned throughput settings for the table.
2827
#
2928
# Returns:
3029
# 0 - If successful.
3130
# 1 - If it fails.
3231
###############################################################################
3332
function dynamodb_create_table() {
34-
local table_name attribute_definitions key_schema provisioned_throughput response
33+
local table_name attribute_definitions key_schema response
3534
local option OPTARG # Required to use getopts command in a function.
3635

3736
#######################################
3837
# Function usage explanation
3938
#######################################
4039
function usage() {
4140
echo "function dynamodb_create_table"
42-
echo "Creates an Amazon DynamoDB table."
41+
echo "Creates an Amazon DynamoDB table with on-demand billing."
4342
echo " -n table_name -- The name of the table to create."
4443
echo " -a attribute_definitions -- JSON file path of a list of attributes and their types."
4544
echo " -k key_schema -- JSON file path of a list of attributes and their key types."
46-
echo " -p provisioned_throughput -- Provisioned throughput settings for the table."
4745
echo ""
4846
}
4947

5048
# Retrieve the calling parameters.
51-
while getopts "n:a:k:p:h" option; do
49+
while getopts "n:a:k:h" option; do
5250
case "${option}" in
5351
n) table_name="${OPTARG}" ;;
5452
a) attribute_definitions="${OPTARG}" ;;
5553
k) key_schema="${OPTARG}" ;;
56-
p) provisioned_throughput="${OPTARG}" ;;
5754
h)
5855
usage
5956
return 0
@@ -85,24 +82,17 @@ function dynamodb_create_table() {
8582
return 1
8683
fi
8784

88-
if [[ -z "$provisioned_throughput" ]]; then
89-
errecho "ERROR: You must provide a provisioned throughput json file path the -p parameter."
90-
usage
91-
return 1
92-
fi
93-
9485
iecho "Parameters:\n"
9586
iecho " table_name: $table_name"
9687
iecho " attribute_definitions: $attribute_definitions"
9788
iecho " key_schema: $key_schema"
98-
iecho " provisioned_throughput: $provisioned_throughput"
9989
iecho ""
10090

10191
response=$(aws dynamodb create-table \
10292
--table-name "$table_name" \
10393
--attribute-definitions file://"$attribute_definitions" \
104-
--key-schema file://"$key_schema" \
105-
--provisioned-throughput "$provisioned_throughput")
94+
--billing-mode PAY_PER_REQUEST \
95+
--key-schema file://"$key_schema" )
10696

10797
local error_code=${?}
10898

aws-cli/bash-linux/dynamodb/scenario_getting_started_movies.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0
4-
# bashsupport disable=BP2002
4+
# bashsupport disable=BP2002
55

66
###############################################################################
77
#
@@ -65,8 +65,6 @@ function dynamodb_getting_started_movies() {
6565
get_input
6666
table_name=$get_input_result
6767

68-
local provisioned_throughput="ReadCapacityUnits=5,WriteCapacityUnits=5"
69-
7068
echo '[
7169
{"AttributeName": "year", "KeyType": "HASH"},
7270
{"AttributeName": "title", "KeyType": "RANGE"}
@@ -78,7 +76,7 @@ function dynamodb_getting_started_movies() {
7876
]' >"$attribute_definitions_json_file"
7977

8078
if dynamodb_create_table -n "$table_name" -a "$attribute_definitions_json_file" \
81-
-k "$key_schema_json_file" -p "$provisioned_throughput" 1>/dev/null; then
79+
-k "$key_schema_json_file" 1>/dev/null; then
8280
echo "Created a DynamoDB table named $table_name"
8381
else
8482
errecho "The table failed to create. This demo will exit."

aws-cli/bash-linux/dynamodb/tests/test_dynamodb_examples.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ function main() {
8585
iecho "***************SETUP STEPS******************"
8686
local test_table_name
8787
test_table_name=$(generate_random_name testcli)
88-
local test_provisioned_throughput="ReadCapacityUnits=5,WriteCapacityUnits=5"
8988
local test_key_schema_json_file="test_dynamodb_key_schema.json"
9089
local test_attr_definitions_json_file="test_dynamodb_attr_def.json"
9190
local test_key_json_file="test_dynamodb_key.json"
@@ -111,7 +110,7 @@ function main() {
111110
]' >"$test_attr_definitions_json_file"
112111

113112
run_test "Creating table" \
114-
"dynamodb_create_table -n $test_table_name -a $test_attr_definitions_json_file -k $test_key_schema_json_file -p $test_provisioned_throughput " \
113+
"dynamodb_create_table -n $test_table_name -a $test_attr_definitions_json_file -k $test_key_schema_json_file " \
115114
0
116115

117116
export exit_on_failure=false

gov2/dynamodb/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ Code examples that show you how to perform the essential operations within a ser
4141
Code excerpts that show you how to call individual service functions.
4242

4343
- [BatchExecuteStatement](actions/partiql.go#L7)
44-
- [BatchWriteItem](actions/table_basics.go#L177)
44+
- [BatchWriteItem](actions/table_basics.go#L175)
4545
- [CreateTable](actions/table_basics.go#L54)
46-
- [DeleteItem](actions/table_basics.go#L332)
47-
- [DeleteTable](actions/table_basics.go#L347)
46+
- [DeleteItem](actions/table_basics.go#L330)
47+
- [DeleteTable](actions/table_basics.go#L345)
4848
- [DescribeTable](actions/table_basics.go#L31)
4949
- [ExecuteStatement](actions/partiql.go#L7)
50-
- [GetItem](actions/table_basics.go#L221)
51-
- [ListTables](actions/table_basics.go#L99)
52-
- [PutItem](actions/table_basics.go#L121)
53-
- [Query](actions/table_basics.go#L243)
54-
- [Scan](actions/table_basics.go#L285)
55-
- [UpdateItem](actions/table_basics.go#L140)
50+
- [GetItem](actions/table_basics.go#L219)
51+
- [ListTables](actions/table_basics.go#L97)
52+
- [PutItem](actions/table_basics.go#L119)
53+
- [Query](actions/table_basics.go#L241)
54+
- [Scan](actions/table_basics.go#L283)
55+
- [UpdateItem](actions/table_basics.go#L138)
5656

5757
### Scenarios
5858

@@ -160,4 +160,4 @@ in the `gov2` folder.
160160

161161
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
162162

163-
SPDX-License-Identifier: Apache-2.0
163+
SPDX-License-Identifier: Apache-2.0

gov2/dynamodb/actions/table_basics.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,8 @@ func (basics TableBasics) CreateMovieTable(ctx context.Context) (*types.TableDes
7474
AttributeName: aws.String("title"),
7575
KeyType: types.KeyTypeRange,
7676
}},
77-
TableName: aws.String(basics.TableName),
78-
ProvisionedThroughput: &types.ProvisionedThroughput{
79-
ReadCapacityUnits: aws.Int64(10),
80-
WriteCapacityUnits: aws.Int64(10),
81-
},
77+
TableName: aws.String(basics.TableName),
78+
BillingMode: types.BillingModePayPerRequest,
8279
})
8380
if err != nil {
8481
log.Printf("Couldn't create table %v. Here's why: %v\n", basics.TableName, err)
@@ -90,6 +87,7 @@ func (basics TableBasics) CreateMovieTable(ctx context.Context) (*types.TableDes
9087
log.Printf("Wait for table exists failed. Here's why: %v\n", err)
9188
}
9289
tableDesc = table.TableDescription
90+
log.Printf("Ccreating table test")
9391
}
9492
return tableDesc, err
9593
}

gov2/dynamodb/stubs/table_basics_stubs.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ func StubCreateTable(tableName string, raiseErr *testtools.StubError) testtools.
4545
AttributeName: aws.String("title"),
4646
KeyType: types.KeyTypeRange,
4747
}},
48-
ProvisionedThroughput: &types.ProvisionedThroughput{
49-
ReadCapacityUnits: aws.Int64(10),
50-
WriteCapacityUnits: aws.Int64(10),
51-
},
48+
BillingMode: types.BillingModePayPerRequest,
5249
},
5350
Output: &dynamodb.CreateTableOutput{TableDescription: &types.TableDescription{
5451
TableName: aws.String(tableName)}},

javav2/example_code/sqs/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Code excerpts that show you how to call individual service functions.
4646
- [ReceiveMessage](src/main/java/com/example/sqs/SQSExample.java#L151)
4747
- [SendMessage](src/main/java/com/example/sqs/SendMessages.java#L7)
4848
- [SendMessageBatch](src/main/java/com/example/sqs/SQSExample.java#L132)
49+
- [SetQueueAttributes](src/main/java/com/example/sqs/SSEncryptionExample.java#L64)
4950

5051
### Scenarios
5152

@@ -55,6 +56,7 @@ functions within the same service.
5556
- [Create and publish to a FIFO topic](../sns/src/main/java/com/example/sns/PriceUpdateExample.java)
5657
- [Process S3 event notifications](../s3/src/main/java/com/example/s3/ProcessS3EventNotification.java)
5758
- [Publish messages to queues](../../usecases/topics_and_queues/src/main/java/com/example/sns/SNSWorkflow.java)
59+
- [Work with queue tags](src/main/java/com/example/sqs/TagExamples.java)
5860

5961

6062
<!--custom.examples.start-->
@@ -114,6 +116,18 @@ This example shows you how to do the following:
114116
<!--custom.scenarios.sqs_Scenario_TopicsAndQueues.start-->
115117
<!--custom.scenarios.sqs_Scenario_TopicsAndQueues.end-->
116118

119+
#### Work with queue tags
120+
121+
This example shows you how to perform tagging operation with Amazon SQS
122+
123+
124+
<!--custom.scenario_prereqs.sqs_Scenario_WorkWithTags.start-->
125+
<!--custom.scenario_prereqs.sqs_Scenario_WorkWithTags.end-->
126+
127+
128+
<!--custom.scenarios.sqs_Scenario_WorkWithTags.start-->
129+
<!--custom.scenarios.sqs_Scenario_WorkWithTags.end-->
130+
117131
### Tests
118132

119133
⚠ Running tests might result in charges to your AWS account.
@@ -140,4 +154,4 @@ in the `javav2` folder.
140154

141155
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
142156

143-
SPDX-License-Identifier: Apache-2.0
157+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)