File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -376,6 +376,22 @@ Resources:
376376 }
377377 Name : " aws-data-wrangler-mysql"
378378
379+ DynamoDBTable :
380+ Type : AWS::DynamoDB::Table
381+ Properties :
382+ AttributeDefinitions :
383+ - AttributeName : " attr_hash"
384+ AttributeType : " S"
385+ - AttributeName : " attr_range"
386+ AttributeType : " S"
387+ KeySchema :
388+ - AttributeName : " attr_hash"
389+ KeyType : " HASH"
390+ - AttributeName : " attr_range"
391+ KeyType : " RANGE"
392+ BillingMode : " PAY_PER_REQUEST"
393+ TableName : " aws-data-wrangler-test"
394+
379395Outputs :
380396 BucketName :
381397 Value : !Ref Bucket
@@ -415,4 +431,7 @@ Outputs:
415431 Description : Postgres Address
416432 MysqlAddress :
417433 Value : !GetAtt AuroraInstanceMysql.Endpoint.Address
418- Description : Mysql Address
434+ Description : Mysql Address
435+ DynamoDbTableARN :
436+ Value : !GetAtt DynamoDBTable.Arn
437+ Description : DynamoDB table name
Original file line number Diff line number Diff line change 1+ import logging
2+
3+ import boto3
4+ import pytest
5+
6+ # import awswrangler as wr
7+
8+ logging .basicConfig (level = logging .INFO , format = "[%(asctime)s][%(levelname)s][%(name)s][%(funcName)s] %(message)s" )
9+ logging .getLogger ("awswrangler" ).setLevel (logging .DEBUG )
10+
11+
12+ @pytest .fixture (scope = "module" )
13+ def cloudformation_outputs ():
14+ response = boto3 .client ("cloudformation" ).describe_stacks (StackName = "aws-data-wrangler-test" )
15+ outputs = {}
16+ for output in response .get ("Stacks" )[0 ].get ("Outputs" ):
17+ outputs [output .get ("OutputKey" )] = output .get ("OutputValue" )
18+ yield outputs
19+
20+
21+ @pytest .fixture (scope = "module" )
22+ def ddb_table_arn (session , cloudformation_outputs ):
23+ if "DynamoDbTableARN" in cloudformation_outputs :
24+ arn = cloudformation_outputs ["DynamoDbTableARN" ]
25+ else :
26+ raise Exception ("You must deploy the test infrastructure using Cloudformation!" )
27+ yield arn
You can’t perform that action at this time.
0 commit comments