You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---
- hosts: localhost
remote_user: bob
tasks:
- name: Create the Tank table
dynamodb_table:
name: Tank
hash_key_name: id
hash_key_type: STRING
read_capacity: 1
write_capacity: 1
Expected to create a DynamoDB table in LocalStack since AWS_URL points to it
ACTUAL RESULTS
The command fails with the following output, looks like it still tries to hit some default AWS endpoints instead of AWS_URL
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [Create the Tank table] ***************************************************
fatal: [localhost]: FAILED! => {"changed": false, "hash_key_name": "id", "hash_key_type": "STRING", "indexes": [], "msg": "Failed to create/update dynamo table due to error: Traceback (most recent call last):\n File \"/var/folders/y7/bpszvwgj7lv54vjwp99lgg2h0000gn/T/ansible_dynamodb_table_payload_kapu_np8/ansible_dynamodb_table_payload.zip/ansible/modules/cloud/amazon/dynamodb_table.py\", line 213, in create_or_update_dynamo_table\n File \"/var/folders/y7/bpszvwgj7lv54vjwp99lgg2h0000gn/T/ansible_dynamodb_table_payload_kapu_np8/ansible_dynamodb_table_payload.zip/ansible/modules/cloud/amazon/dynamodb_table.py\", line 292, in dynamo_table_exists\n File \"/var/folders/y7/bpszvwgj7lv54vjwp99lgg2h0000gn/T/ansible_dynamodb_table_payload_kapu_np8/ansible_dynamodb_table_payload.zip/ansible/modules/cloud/amazon/dynamodb_table.py\", line 285, in dynamo_table_exists\n File \"/usr/local/Cellar/ansible/2.9.3/libexec/lib/python3.8/site-packages/boto/dynamodb2/table.py\", line 356, in describe\n result = self.connection.describe_table(self.table_name)\n File \"/usr/local/Cellar/ansible/2.9.3/libexec/lib/python3.8/site-packages/boto/dynamodb2/layer1.py\", line 977, in describe_table\n return self.make_request(action='DescribeTable',\n File \"/usr/local/Cellar/ansible/2.9.3/libexec/lib/python3.8/site-packages/boto/dynamodb2/layer1.py\", line 2840, in make_request\n response = self._mexe(http_request, sender=None,\n File \"/usr/local/Cellar/ansible/2.9.3/libexec/lib/python3.8/site-packages/boto/connection.py\", line 954, in _mexe\n status = retry_handler(response, i, next_sleep)\n File \"/usr/local/Cellar/ansible/2.9.3/libexec/lib/python3.8/site-packages/boto/dynamodb2/layer1.py\", line 2884, in _retry_handler\n raise self.ResponseError(response.status, response.reason,\nboto.exception.JSONResponseError: JSONResponseError: 400 Bad Request\n{'__type': 'com.amazon.coral.service#UnrecognizedClientException', 'message': 'The security token included in the request is invalid.'}\n", "range_key_name": null, "range_key_type": "STRING", "read_capacity": 1, "region": "us-east-1", "table_name": "Tank", "write_capacity": 1}
PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
@derekmwright unfortunately most of dynamodb_table is currently a boto v2 module, so I'm not entirely surprised that it doesn't behave well with GovCloud.
There's an in-progress PR (#65) which would likely fix the issue by migrating to boto3 and our various helpers, however it appears to need some additional work.
SUMMARY
dynamodb_table module doesn't use AWS_URL as described in the documentation. Which prevents us from running it against LocalStack
ISSUE TYPE
COMPONENT NAME
dynamodb_table
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
macOS Catalina
STEPS TO REPRODUCE
Running the following playbook
using the following command
AWS_URL=http://localhost:4566 AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=NONE_FOR_LOCAL AWS_SECRET_ACCESS_KEY=NONE_FOR_LOCAL ansible-playbook ./playbook-dynamo.yml
EXPECTED RESULTS
Expected to create a DynamoDB table in LocalStack since AWS_URL points to it
ACTUAL RESULTS
The command fails with the following output, looks like it still tries to hit some default AWS endpoints instead of AWS_URL
Related issues:
The text was updated successfully, but these errors were encountered: