@@ -16,10 +16,10 @@ Parameters:
1616 SubnetAz :
1717 Type : String
1818 Description : Subnet AZ
19- Password :
19+ DatabasesPassword :
2020 Type : String
21- Description : Redshift Password
22- TestUser :
21+ Description : Password for all databases
22+ AWSUserForTests :
2323 Type : String
2424 Description : AWS User that will running the tests on the CLI
2525
@@ -49,7 +49,7 @@ Resources:
4949 - Sid : " Allow administration of the key"
5050 Effect : " Allow"
5151 Principal :
52- AWS : !Join ["", ["arn:aws:iam::", !Ref "AWS::AccountId", ":user/", !Ref TestUser ]]
52+ AWS : !Join ["", ["arn:aws:iam::", !Ref "AWS::AccountId", ":user/", !Ref AWSUserForTests ]]
5353 Action :
5454 - " kms:Create*"
5555 - " kms:Describe*"
@@ -95,7 +95,7 @@ Resources:
9595 - sts:AssumeRole
9696 Path : " /"
9797 Policies :
98- - PolicyName : S3GetAndList
98+ - PolicyName : Root
9999 PolicyDocument :
100100 Version : 2012-10-17
101101 Statement :
@@ -107,6 +107,30 @@ Resources:
107107 Resource :
108108 - !Join ['', ['arn:aws:s3:::', !Ref Bucket]]
109109 - !Join ['', ['arn:aws:s3:::', !Ref Bucket, /*]]
110+ - Effect : Allow
111+ Action :
112+ - " lakeformation:GrantPermissions"
113+ Resource : " *"
114+ - Effect : Allow
115+ Action :
116+ - " glue:SearchTables"
117+ - " glue:GetConnections"
118+ - " glue:GetDataCatalogEncryptionSettings"
119+ - " glue:GetTables"
120+ - " glue:GetTableVersions"
121+ - " glue:GetPartitions"
122+ - " glue:DeleteTableVersion"
123+ - " glue:BatchGetPartition"
124+ - " glue:GetDatabases"
125+ - " glue:GetTags"
126+ - " glue:GetTable"
127+ - " glue:GetDatabase"
128+ - " glue:GetPartition"
129+ - " glue:GetTableVersion"
130+ - " glue:GetConnection"
131+ - " glue:GetUserDefinedFunction"
132+ - " glue:GetUserDefinedFunctions"
133+ Resource : " *"
110134
111135 RedshiftSubnetGroup :
112136 Type : AWS::Redshift::ClusterSubnetGroup
@@ -140,7 +164,7 @@ Resources:
140164 Properties :
141165 DBName : test
142166 MasterUsername : test
143- MasterUserPassword : !Ref Password
167+ MasterUserPassword : !Ref DatabasesPassword
144168 NodeType : dc2.large
145169 ClusterType : single-node
146170 VpcSecurityGroupIds :
@@ -223,7 +247,7 @@ Resources:
223247 Engine : aurora-postgresql
224248 DBClusterIdentifier : postgres-cluster-wrangler
225249 MasterUsername : test
226- MasterUserPassword : !Ref Password
250+ MasterUserPassword : !Ref DatabasesPassword
227251 BackupRetentionPeriod : 1
228252 DBSubnetGroupName : !Ref RdsSubnetGroup
229253 VpcSecurityGroupIds :
@@ -264,19 +288,21 @@ Resources:
264288 Engine : aurora-mysql
265289 DBClusterIdentifier : mysql-cluster-wrangler
266290 MasterUsername : test
267- MasterUserPassword : !Ref Password
291+ MasterUserPassword : !Ref DatabasesPassword
268292 BackupRetentionPeriod : 1
269293 DBSubnetGroupName : !Ref RdsSubnetGroup
270294 VpcSecurityGroupIds :
271295 - !Ref DatabaseSecurityGroup
272296 DBClusterParameterGroupName : !Ref MysqlParameterGroup
297+ DatabaseName : test
273298 AssociatedRoles :
274299 - RoleArn : !GetAtt AuroraRole.Arn
275300
276301 AuroraInstanceMysql :
277302 Type : AWS::RDS::DBInstance
278303 Properties :
279304 Engine : aurora-mysql
305+ # DBName: test
280306 DBInstanceIdentifier : mysql-instance-wrangler
281307 DBClusterIdentifier : !Ref AuroraClusterMysql
282308 DBInstanceClass : db.t3.medium
@@ -285,6 +311,9 @@ Resources:
285311
286312 RedshiftGlueConnection :
287313 Type : AWS::Glue::Connection
314+ DependsOn :
315+ - DatabaseSecurityGroup
316+ - Redshift
288317 Properties :
289318 CatalogId : !Ref AWS::AccountId
290319 ConnectionInput :
@@ -310,12 +339,15 @@ Resources:
310339 ],
311340 ],
312341 " USERNAME " : test,
313- " PASSWORD " : !Ref Password ,
342+ " PASSWORD " : !Ref DatabasesPassword ,
314343 }
315344 Name : " aws-data-wrangler-redshift"
316345
317346 PostgresGlueConnection :
318347 Type : AWS::Glue::Connection
348+ DependsOn :
349+ - DatabaseSecurityGroup
350+ - AuroraInstancePostgres
319351 Properties :
320352 CatalogId : !Ref AWS::AccountId
321353 ConnectionInput :
@@ -341,12 +373,15 @@ Resources:
341373 ],
342374 ],
343375 " USERNAME " : test,
344- " PASSWORD " : !Ref Password ,
376+ " PASSWORD " : !Ref DatabasesPassword ,
345377 }
346378 Name : " aws-data-wrangler-postgres"
347379
348380 MysqlGlueConnection :
349381 Type : AWS::Glue::Connection
382+ DependsOn :
383+ - DatabaseSecurityGroup
384+ - AuroraInstanceMysql
350385 Properties :
351386 CatalogId : !Ref AWS::AccountId
352387 ConnectionInput :
@@ -372,7 +407,7 @@ Resources:
372407 ],
373408 ],
374409 " USERNAME " : test,
375- " PASSWORD " : !Ref Password ,
410+ " PASSWORD " : !Ref DatabasesPassword ,
376411 }
377412 Name : " aws-data-wrangler-mysql"
378413
@@ -398,12 +433,12 @@ Outputs:
398433 Description : Name of the S3 Bucket used for tests.
399434 RedshiftAddress :
400435 Value : !GetAtt Redshift.Endpoint.Address
401- Description : Redshift Password .
436+ Description : Redshift address .
402437 RedshiftPort :
403438 Value : !GetAtt Redshift.Endpoint.Port
404439 Description : Redshift Endpoint Port.
405- Password :
406- Value : !Ref Password
440+ DatabasesPassword :
441+ Value : !Ref DatabasesPassword
407442 Description : Password.
408443 RedshiftRole :
409444 Value : !GetAtt RedshiftRole.Arn
@@ -434,4 +469,7 @@ Outputs:
434469 Description : Mysql Address
435470 DynamoDbTableARN :
436471 Value : !GetAtt DynamoDBTable.Arn
437- Description : DynamoDB table name
472+ Description : DynamoDB table name
473+ Region :
474+ Value : !Ref AWS::Region
475+ Description : AWS Region
0 commit comments