Repository: cloud-custodian/cloud-custodian

Issue:
DynamoDB auto-tag error : takes 1 positional argument but 2 were given
When I apply auto-tag for DynamoDB with the policy like below

```
- name: owner-autotagging-on_dynamodb_creation
  description: |
     Autotags any newly created DynamoDB table
  resource: dynamodb-table
  mode:
     type: cloudtrail
     role: arn:aws:iam::{account_id}:role/administrator
     events:
       - CreateTable
  actions:
     - type: auto-tag-user
       tag: creator-name
       principal_id_tag: creator-id
```

when I want to create a test DynamoDB after applying the policy,  auto-tag can not be generated and I get the error in CloudWatch like below;

```
[ERROR]	2019-04-10T10:27:52.703Z	edb844ed-282f-4f84-8fe4-3d0f7cb4fda2	error during policy execution
Traceback (most recent call last):
File "/var/task/c7n/handler.py", line 165, in dispatch_event
p.push(event, context)
File "/var/task/c7n/policy.py", line 903, in push
return mode.run(event, lambda_ctx)
File "/var/task/c7n/policy.py", line 444, in run
resources = self.resolve_resources(event)
File "/var/task/c7n/policy.py", line 421, in resolve_resources
resources = self.policy.resource_manager.get_resources(resource_ids)
File "/var/task/c7n/query.py", line 476, in get_resources
resources = self.source.get_resources(ids)
File "/var/task/c7n/resources/dynamodb.py", line 93, in get_resources
waiter.wait(tid, WaiterConfig=waiter_config)
TypeError: wait() takes 1 positional argument but 2 were given
[ERROR] TypeError: wait() takes 1 positional argument but 2 were given
Traceback (most recent call last):
  File "/var/task/custodian_policy.py", line 4, in run
    return handler.dispatch_event(event, context)
  File "/var/task/c7n/handler.py", line 165, in dispatch_event
    p.push(event, context)
  File "/var/task/c7n/policy.py", line 903, in push
    return mode.run(event, lambda_ctx)
  File "/var/task/c7n/policy.py", line 444, in run
    resources = self.resolve_resources(event)
  File "/var/task/c7n/policy.py", line 421, in resolve_resources
    resources = self.policy.resource_manager.get_resources(resource_ids)
  File "/var/task/c7n/query.py", line 476, in get_resources
    resources = self.source.get_resources(ids)
  File "/var/task/c7n/resources/dynamodb.py", line 93, in get_resources
    waiter.wait(tid, WaiterConfig=waiter_config)
END RequestId: edb844ed-282f-4f84-8fe4-3d0f7cb4fda2
REPORT RequestId: edb844ed-282f-4f84-8fe4-3d0f7cb4fda2	Duration: 30.11 ms	Billed Duration: 100 ms Memory Size: 512 MB	Max Memory Used: 86 MB	

```

I try to understand whats wrong with policy?




Discussion:
what version of c7n and boto3 are you using?
Here is the info about versions

```
(custodian) [root@cb2441aad546 EXAMPLES]# pip list|grep boto
boto3              1.9.97
botocore           1.12.97

(custodian) [root@cb2441aad546 EXAMPLES]# custodian version
0.8.42.1
(custodian) [root@cb2441aad546 EXAMPLES]#
```
the versions look good. 
ill play around with it today and see if i can replicate the problem. 
i did get the same error. will work on finding why that is happening. 

Resolving patch:
diff --git a/c7n/resources/dynamodb.py b/c7n/resources/dynamodb.py
--- a/c7n/resources/dynamodb.py
+++ b/c7n/resources/dynamodb.py
@@ -90,7 +90,7 @@ def get_resources(self, ids, *args, **kw):
                 'CreateTable' in self.manager.data['mode']['events']):
             waiter, waiter_config = self.get_waiter()
             for tid in ids:
-                waiter.wait(tid, WaiterConfig=waiter_config)
+                waiter.wait(TableName=tid, WaiterConfig=waiter_config)
         return super(DescribeTable, self).get_resources(ids, *args, **kw)
 
     def get_waiter(self):


Test patch: