Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Error: No provisioned throughput specified for the global secondary index #108

Closed
okarmusk opened this issue May 1, 2021 · 10 comments
Closed
Assignees
Labels
bug Something isn't working closed-for-staleness This issue was closed because it didn't receive updates documentation Improvements or additions to documentation dynamodb

Comments

@okarmusk
Copy link

okarmusk commented May 1, 2021

Hello,
I'm trying to create table with global secondary index. I followed an example from: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GCICli.html#GCICli.CreateTableWithIndex

Based on documentation, I created script what should create table with global secondary index:

aws dynamodb create-table \
    --table-name ServiceConfiguration \
    --attribute-definitions \
        AttributeName=Version,AttributeType=S \
        AttributeName=ServiceName,AttributeType=S \
        AttributeName=LaunchDate,AttributeType=S \
        AttributeName=Tag,AttributeType=S \
        AttributeName=Checksum,AttributeType=S \
    --key-schema \
        AttributeName=Version,KeyType=HASH \
        AttributeName=ServiceName,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=5 \
    --global-secondary-indexes \
        "[
            {
                \"IndexName\": \"LaunchDateIndex\",
                \"KeySchema\": [{\"AttributeName\":\"LaunchDate\",\"KeyType\":\"HASH\"},
                                {\"AttributeName\":\"Tag\",\"KeyType\":\"RANGE\"}],
                \"Projection\":{
                    \"ProjectionType\":\"INCLUDE\",
                    \"NonKeyAttributes\":[\"Version\", \"ServiceName\", \"Checksum\"]
                }
            }
        ]" \
    --endpoint-url http://localhost:8000

Example from dynamo-db developer guide doesn't work too, returns the same error.

The aws-cli return An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index.

I added line with --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=5 \.

aws-cli version aws-cli/2.2.1 Python/3.8.8 Linux/5.4.0-72-generic exe/x86_64.ubuntu.20 prompt/off
Localhost dynamo-db docker image amazon/dynamodb-local:1.15.0

@okarmusk
Copy link
Author

okarmusk commented May 3, 2021

I tried to use aws-cli to create the same table on real aws dynamo-db service. Also doesn't work.

@kdaily
Copy link
Member

kdaily commented May 3, 2021

Hi @okarmusk,

Sorry to hear you're having an issue. Can you provide the debug logs (add --debug to your command) - please be sure to remove any sensitive information.

The error you're getting is from the service, so I think I'll need to see the request and response to be of any further assistance.

Thanks!

@okarmusk
Copy link
Author

okarmusk commented May 3, 2021

@kdaily Debug log output:

2021-05-03 21:46:40,233 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.2.1 Python/3.8.8 Linux/5.4.0-72-generic exe/x86_64.ubuntu.20
2021-05-03 21:46:40,234 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['dynamodb', 'create-table', '--table-name', 'ServiceConfiguration', '--attribute-definitions', 'AttributeName=Version,AttributeType=S', 'AttributeName=ServiceName,AttributeType=S', 'AttributeName=LaunchDate,AttributeType=S', 'AttributeName=Tag,AttributeType=S', 'AttributeName=Checksum,AttributeType=S', '--key-schema', 'AttributeName=Version,KeyType=HASH', 'AttributeName=ServiceName,KeyType=RANGE', '--provisioned-throughput', 'ReadCapacityUnits=10,WriteCapacityUnits=5', '--global-secondary-indexes', '[\n            {\n                "IndexName": "LaunchDateIndex",\n                "KeySchema": [{"AttributeName":"LaunchDate","KeyType":"HASH"},\n                                {"AttributeName":"Tag","KeyType":"RANGE"}],\n                "Projection":{\n                    "ProjectionType":"INCLUDE",\n                    "NonKeyAttributes":["Version", "ServiceName", "Checksum"]\n                }\n            }\n        ]', '--endpoint-url', 'http://localhost:8000', '--debug']
2021-05-03 21:46:40,242 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7fefab7bc550>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7fefab935310>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7fefab958af0>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7fefab962c10>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7fefab781f70>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7fefab902160>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2021-05-03 21:46:40,243 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7fefab7811f0>
2021-05-03 21:46:40,243 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.2.1/dist/awscli/data/cli.json
2021-05-03 21:46:40,246 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7fefab831160>
2021-05-03 21:46:40,246 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7fefab831ca0>
2021-05-03 21:46:40,246 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7fefab831c10>
2021-05-03 21:46:40,246 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7fefab831dc0>
2021-05-03 21:46:40,246 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7fefab831d30>
2021-05-03 21:46:40,246 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7fefab6a2180>
2021-05-03 21:46:40,247 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.2.1 Python/3.8.8 Linux/5.4.0-72-generic exe/x86_64.ubuntu.20 prompt/off
2021-05-03 21:46:40,247 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['dynamodb', 'create-table', '--table-name', 'ServiceConfiguration', '--attribute-definitions', 'AttributeName=Version,AttributeType=S', 'AttributeName=ServiceName,AttributeType=S', 'AttributeName=LaunchDate,AttributeType=S', 'AttributeName=Tag,AttributeType=S', 'AttributeName=Checksum,AttributeType=S', '--key-schema', 'AttributeName=Version,KeyType=HASH', 'AttributeName=ServiceName,KeyType=RANGE', '--provisioned-throughput', 'ReadCapacityUnits=10,WriteCapacityUnits=5', '--global-secondary-indexes', '[\n            {\n                "IndexName": "LaunchDateIndex",\n                "KeySchema": [{"AttributeName":"LaunchDate","KeyType":"HASH"},\n                                {"AttributeName":"Tag","KeyType":"RANGE"}],\n                "Projection":{\n                    "ProjectionType":"INCLUDE",\n                    "NonKeyAttributes":["Version", "ServiceName", "Checksum"]\n                }\n            }\n        ]', '--endpoint-url', 'http://localhost:8000', '--debug']
2021-05-03 21:46:40,247 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7fefab7bcb80>
2021-05-03 21:46:40,247 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7fefac218e50>
2021-05-03 21:46:40,247 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7fefab6e69d0>
2021-05-03 21:46:40,247 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7fefac216310>
2021-05-03 21:46:40,247 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7fefac178af0>
2021-05-03 21:46:40,248 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2021-05-03 21:46:40,249 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7fefab902040>
2021-05-03 21:46:40,250 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7fefab9321f0>
2021-05-03 21:46:40,258 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.2.1/dist/botocore/data/dynamodb/2012-08-10/service-2.json
2021-05-03 21:46:40,269 - MainThread - botocore.hooks - DEBUG - Event building-command-table.dynamodb: calling handler <function _add_wizard_command at 0x7fefab6e6940>
2021-05-03 21:46:40,269 - MainThread - botocore.hooks - DEBUG - Event building-command-table.dynamodb: calling handler <function add_waiters at 0x7fefab7811f0>
2021-05-03 21:46:40,277 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.2.1/dist/botocore/data/dynamodb/2012-08-10/waiters-2.json
2021-05-03 21:46:40,278 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('attribute-definitions', <awscli.arguments.ListArgument object at 0x7fefaacaa220>), ('table-name', <awscli.arguments.CLIArgument object at 0x7fefaacaa250>), ('key-schema', <awscli.arguments.ListArgument object at 0x7fefaacaa280>), ('local-secondary-indexes', <awscli.arguments.ListArgument object at 0x7fefaacaa2b0>), ('global-secondary-indexes', <awscli.arguments.ListArgument object at 0x7fefaacaa2e0>), ('billing-mode', <awscli.arguments.CLIArgument object at 0x7fefaacaa310>), ('provisioned-throughput', <awscli.arguments.CLIArgument object at 0x7fefaacaa340>), ('stream-specification', <awscli.arguments.CLIArgument object at 0x7fefaacaa370>), ('sse-specification', <awscli.arguments.CLIArgument object at 0x7fefaacaa3a0>), ('tags', <awscli.arguments.ListArgument object at 0x7fefaacaa3d0>)])
2021-05-03 21:46:40,278 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.create-table: calling handler <function add_streaming_output_arg at 0x7fefab77e160>
2021-05-03 21:46:40,278 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.create-table: calling handler <function add_cli_input_json at 0x7fefac17c3a0>
2021-05-03 21:46:40,279 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.create-table: calling handler <function add_cli_input_yaml at 0x7fefac17c670>
2021-05-03 21:46:40,279 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.create-table: calling handler <function unify_paging_params at 0x7fefab935940>
2021-05-03 21:46:40,287 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.2.1/dist/botocore/data/dynamodb/2012-08-10/paginators-1.json
2021-05-03 21:46:40,287 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.create-table: calling handler <function add_generate_skeleton at 0x7fefab826700>
2021-05-03 21:46:40,287 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.create-table: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7fefaacaa520>>
2021-05-03 21:46:40,287 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.create-table: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7fefaacaa550>>
2021-05-03 21:46:40,287 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.create-table: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7fefaacaa6a0>>
2021-05-03 21:46:40,288 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.attribute-definitions: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,288 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.dynamodb.create-table: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fefac1bdc40>
2021-05-03 21:46:40,288 - MainThread - awscli.argprocess - DEBUG - Parsing param --attribute-definitions as shorthand
2021-05-03 21:46:40,289 - MainThread - awscli.arguments - DEBUG - Unpacked value of ['AttributeName=Version,AttributeType=S', 'AttributeName=ServiceName,AttributeType=S', 'AttributeName=LaunchDate,AttributeType=S', 'AttributeName=Tag,AttributeType=S', 'AttributeName=Checksum,AttributeType=S'] for parameter "attribute_definitions": [{'AttributeName': 'Version', 'AttributeType': 'S'}, {'AttributeName': 'ServiceName', 'AttributeType': 'S'}, {'AttributeName': 'LaunchDate', 'AttributeType': 'S'}, {'AttributeName': 'Tag', 'AttributeType': 'S'}, {'AttributeName': 'Checksum', 'AttributeType': 'S'}]
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.table-name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.dynamodb.create-table: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fefac1bdc40>
2021-05-03 21:46:40,289 - MainThread - awscli.arguments - DEBUG - Unpacked value of 'ServiceConfiguration' for parameter "table_name": 'ServiceConfiguration'
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.key-schema: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.dynamodb.create-table: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fefac1bdc40>
2021-05-03 21:46:40,289 - MainThread - awscli.argprocess - DEBUG - Parsing param --key-schema as shorthand
2021-05-03 21:46:40,289 - MainThread - awscli.arguments - DEBUG - Unpacked value of ['AttributeName=Version,KeyType=HASH', 'AttributeName=ServiceName,KeyType=RANGE'] for parameter "key_schema": [{'AttributeName': 'Version', 'KeyType': 'HASH'}, {'AttributeName': 'ServiceName', 'KeyType': 'RANGE'}]
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.local-secondary-indexes: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.global-secondary-indexes: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,289 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.dynamodb.create-table: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fefac1bdc40>
2021-05-03 21:46:40,290 - MainThread - awscli.argprocess - DEBUG - Param global_secondary_indexes looks like JSON, not considered for param shorthand.
2021-05-03 21:46:40,290 - MainThread - awscli.arguments - DEBUG - Unpacked value of ['[\n            {\n                "IndexName": "LaunchDateIndex",\n                "KeySchema": [{"AttributeName":"LaunchDate","KeyType":"HASH"},\n                                {"AttributeName":"Tag","KeyType":"RANGE"}],\n                "Projection":{\n                    "ProjectionType":"INCLUDE",\n                    "NonKeyAttributes":["Version", "ServiceName", "Checksum"]\n                }\n            }\n        ]'] for parameter "global_secondary_indexes": [OrderedDict([('IndexName', 'LaunchDateIndex'), ('KeySchema', [OrderedDict([('AttributeName', 'LaunchDate'), ('KeyType', 'HASH')]), OrderedDict([('AttributeName', 'Tag'), ('KeyType', 'RANGE')])]), ('Projection', OrderedDict([('ProjectionType', 'INCLUDE'), ('NonKeyAttributes', ['Version', 'ServiceName', 'Checksum'])]))])]
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.billing-mode: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.provisioned-throughput: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.dynamodb.create-table: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fefac1bdc40>
2021-05-03 21:46:40,290 - MainThread - awscli.argprocess - DEBUG - Parsing param --provisioned-throughput as shorthand
2021-05-03 21:46:40,290 - MainThread - awscli.arguments - DEBUG - Unpacked value of 'ReadCapacityUnits=10,WriteCapacityUnits=5' for parameter "provisioned_throughput": {'ReadCapacityUnits': 10, 'WriteCapacityUnits': 5}
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.stream-specification: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.sse-specification: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.tags: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.cli-input-json: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.cli-input-yaml: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.create-table.generate-cli-skeleton: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fefaae64520>
2021-05-03 21:46:40,290 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.create-table: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7fefaacaa520>>
2021-05-03 21:46:40,291 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.create-table: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7fefaacaa550>>
2021-05-03 21:46:40,291 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.create-table: calling handler <bound method GenerateCliSkeletonArgument.generate_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7fefaacaa6a0>>
2021-05-03 21:46:40,291 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.create-table: calling handler <bound method DynamoDBPaginatorFix._maybe_register_pagination_fix of <awscli.customizations.dynamodb.paginatorfix.DynamoDBPaginatorFix object at 0x7fefab70af40>>
2021-05-03 21:46:40,291 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2021-05-03 21:46:40,291 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2021-05-03 21:46:40,291 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2021-05-03 21:46:40,291 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2021-05-03 21:46:40,291 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2021-05-03 21:46:40,291 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2021-05-03 21:46:40,292 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.2.1/dist/botocore/data/endpoints.json
2021-05-03 21:46:40,298 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fefadaedaf0>
2021-05-03 21:46:40,299 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.dynamodb: calling handler <function add_generate_presigned_url at 0x7fefadb1be50>
2021-05-03 21:46:40,303 - MainThread - botocore.endpoint - DEBUG - Setting dynamodb timeout as (60, 60)
2021-05-03 21:46:40,304 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.dynamodb.CreateTable: calling handler <function base64_decode_input_blobs at 0x7fefab6eb160>
2021-05-03 21:46:40,304 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.dynamodb.CreateTable: calling handler <function generate_idempotent_uuid at 0x7fefadb11b80>
2021-05-03 21:46:40,305 - MainThread - botocore.hooks - DEBUG - Event before-call.dynamodb.CreateTable: calling handler <function inject_api_version_header_if_needed at 0x7fefadb15430>
2021-05-03 21:46:40,305 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=CreateTable) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'DynamoDB_20120810.CreateTable', 'Content-Type': 'application/x-amz-json-1.0', 'User-Agent': 'aws-cli/2.2.1 Python/3.8.8 Linux/5.4.0-72-generic exe/x86_64.ubuntu.20 prompt/off command/dynamodb.create-table'}, 'body': b'{"AttributeDefinitions": [{"AttributeName": "Version", "AttributeType": "S"}, {"AttributeName": "ServiceName", "AttributeType": "S"}, {"AttributeName": "LaunchDate", "AttributeType": "S"}, {"AttributeName": "Tag", "AttributeType": "S"}, {"AttributeName": "Checksum", "AttributeType": "S"}], "TableName": "ServiceConfiguration", "KeySchema": [{"AttributeName": "Version", "KeyType": "HASH"}, {"AttributeName": "ServiceName", "KeyType": "RANGE"}], "GlobalSecondaryIndexes": [{"IndexName": "LaunchDateIndex", "KeySchema": [{"AttributeName": "LaunchDate", "KeyType": "HASH"}, {"AttributeName": "Tag", "KeyType": "RANGE"}], "Projection": {"ProjectionType": "INCLUDE", "NonKeyAttributes": ["Version", "ServiceName", "Checksum"]}}], "ProvisionedThroughput": {"ReadCapacityUnits": 10, "WriteCapacityUnits": 5}}', 'url': 'http://localhost:8000/', 'context': {'client_region': 'xx-xxxx-x', 'client_config': <botocore.config.Config object at 0x7fefaaa1c8e0>, 'has_streaming_input': False, 'auth_type': None}}
2021-05-03 21:46:40,305 - MainThread - botocore.hooks - DEBUG - Event request-created.dynamodb.CreateTable: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7fefaaa1c9a0>>
2021-05-03 21:46:40,305 - MainThread - botocore.hooks - DEBUG - Event choose-signer.dynamodb.CreateTable: calling handler <function set_operation_specific_signer at 0x7fefadb11a60>
2021-05-03 21:46:40,305 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2021-05-03 21:46:40,305 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.0
host:localhost:8000
x-amz-date:20210503T194640Z
x-amz-target:DynamoDB_20120810.CreateTable

content-type;host;x-amz-date;x-amz-target
a160d95b906d2a0010f4bc7c8b50622ea12644eaeac662a6c787a850af1b50f7
2021-05-03 21:46:40,305 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20210503T194640Z
20210503/xx-xxxx-x/dynamodb/aws4_request
79e484d111115aebfbc714fac52d83b059ec3f1dacf45796bcdfc6fe12238368
2021-05-03 21:46:40,305 - MainThread - botocore.auth - DEBUG - Signature:
6543b411b2e353062d0f7e500742579c298af01215011201e45c7a5fee4d0026
2021-05-03 21:46:40,306 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=http://localhost:8000/, headers={'X-Amz-Target': b'DynamoDB_20120810.CreateTable', 'Content-Type': b'application/x-amz-json-1.0', 'User-Agent': b'aws-cli/2.2.1 Python/3.8.8 Linux/5.4.0-72-generic exe/x86_64.ubuntu.20 prompt/off command/dynamodb.create-table', 'X-Amz-Date': b'20210503T194640Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=xxxxxxxxxxxxxxxxx/20210503/xx-xxxx-x/dynamodb/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=6543b411b2e353062d0f7e500742579c298af01215011201e45c7a5fee4d0026', 'Content-Length': '802'}>
2021-05-03 21:46:40,306 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): localhost:8000
2021-05-03 21:46:40,313 - MainThread - urllib3.connectionpool - DEBUG - http://localhost:8000 "POST / HTTP/1.1" 400 137
2021-05-03 21:46:40,314 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Mon, 03 May 2021 19:46:40 GMT', 'Content-Type': 'application/x-amz-json-1.0', 'x-amzn-RequestId': '123aaacc-2304-4bba-9966-e7615cd3f2f0', 'Content-Length': '137', 'Server': 'Jetty(9.4.18.v20190429)'}
2021-05-03 21:46:40,314 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"__type":"com.amazon.coral.validate#ValidationException","Message":"No provisioned throughput specified for the global secondary index"}'
2021-05-03 21:46:40,319 - MainThread - botocore.hooks - DEBUG - Event needs-retry.dynamodb.CreateTable: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7fefaa9e1430>>
2021-05-03 21:46:40,320 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2021-05-03 21:46:40,320 - MainThread - botocore.hooks - DEBUG - Event after-call.dynamodb.CreateTable: calling handler <function parse_last_evaluated_key_binary at 0x7fefab8e3940>
2021-05-03 21:46:40,320 - MainThread - botocore.hooks - DEBUG - Event after-call.dynamodb.CreateTable: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7fefaaa1cf70>>
2021-05-03 21:46:40,321 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "awscli/clidriver.py", line 459, in main
  File "awscli/clidriver.py", line 594, in __call__
  File "awscli/clidriver.py", line 770, in __call__
  File "awscli/clidriver.py", line 901, in invoke
  File "awscli/clidriver.py", line 913, in _make_client_call
  File "botocore/client.py", line 249, in _api_call
  File "botocore/client.py", line 568, in _make_api_call
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index

An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index

@okarmusk
Copy link
Author

okarmusk commented May 7, 2021

@kdaily Are there any news regarding the issue?

@supercoinman
Copy link

same here.

@kdaily kdaily self-assigned this Aug 18, 2021
@kdaily
Copy link
Member

kdaily commented Aug 18, 2021

I can reproduce, also using the example directly from the documentation page (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GCICli.html#GCICli.CreateTableWithIndex). I've reported this to the DynamoDB team.

@kdaily
Copy link
Member

kdaily commented Aug 18, 2021

I do not believe that this is an AWS CLI issue, so I'm going to transfer this to the centralized AWS SDK repository.

@kdaily kdaily transferred this issue from aws/aws-cli Aug 18, 2021
@kdaily kdaily added bug Something isn't working dynamodb labels Aug 18, 2021
@kdaily
Copy link
Member

kdaily commented Aug 18, 2021

V416963781

@kdaily
Copy link
Member

kdaily commented Aug 20, 2021

Hi @okarmusk and @supercoinman,

I heard back from the DynamoDB team, who confirmed that the example in the documentation is not correct. This is a working example of how to add provisioned throughput to a GSI, which would replace the example from the Amazon DynamoDB Developer Guide here:

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GCICli.html#GCICli.CreateTableWithIndex

aws dynamodb create-table \
    --table-name GameScores \
    --attribute-definitions AttributeName=UserId,AttributeType=S \
                            AttributeName=GameTitle,AttributeType=S \
                            AttributeName=TopScore,AttributeType=N  \
    --key-schema AttributeName=UserId,KeyType=HASH \
                 AttributeName=GameTitle,KeyType=RANGE \
    --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=5 \
    --global-secondary-indexes \
        "[
            {
                \"IndexName\": \"GameTitleIndex\",
                \"KeySchema\": [{\"AttributeName\":\"GameTitle\",\"KeyType\":\"HASH\"},
                                {\"AttributeName\":\"TopScore\",\"KeyType\":\"RANGE\"}],
                \"Projection\":{
                    \"ProjectionType\":\"INCLUDE\",
                    \"NonKeyAttributes\":[\"UserId\"]
                },
                \"ProvisionedThroughput\": {
                    \"ReadCapacityUnits\": 10,
                    \"WriteCapacityUnits\": 5
                }
            }
        ]"

Of note, the API documentation IS correct for this, which shows the use of the ProvisionedThroughput property of the GlobalSecondaryIndexes parameter:

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html#DDB-CreateTable-request-GlobalSecondaryIndexes

I will leave this open as a documentation issue to be corrected. Thanks again!

@kdaily kdaily added the documentation Improvements or additions to documentation label Aug 20, 2021
@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will be closed soon label Aug 21, 2022
@github-actions github-actions bot added closed-for-staleness This issue was closed because it didn't receive updates and removed closing-soon This issue will be closed soon labels Aug 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working closed-for-staleness This issue was closed because it didn't receive updates documentation Improvements or additions to documentation dynamodb
Projects
None yet
Development

No branches or pull requests

3 participants