-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glue Crawler: Add catalog target config #9430
Conversation
Hi @bflad, could you review this, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @azclub 👋 Thanks so much for contributing this. Its off to a great start. A few little testing things and we should be able to get this in. Please reach out if you have any questions or do not have time to implement the feedback. 😄
EOF | ||
|
||
data "aws_iam_policy" "AWSGlueServiceRole" { | ||
arn = "arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the usage of the aws_partition
data source -- we run this acceptance testing across multiple AWS partitions like GovCloud (US).
arn = "arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole" | |
arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSGlueServiceRole" |
@@ -1391,6 +1516,146 @@ resource "aws_glue_crawler" "test" { | |||
`, rName, rName, path1, path2) | |||
} | |||
|
|||
func testAccGlueCrawlerConfig_CatalogTarget_TableResources(tables []string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than creating a separate function that generates configuration, this can be accomplished within configurations that potentially need multiple tables by using count
and count.index
with the resource. e.g.
resource "aws_glue_catalog_table" "test" {
count = %d
database_name = "${aws_glue_catalog_database.test.name}"
name = "%s${count.index}"
table_type = "EXTERNAL_TABLE"
storage_descriptor {
location = "s3://${aws_s3_bucket.default.bucket}"
}
}
The count would be the number to create and the table name would be rName
. References can be simply:
aws_glue_catalog_table.test[*].name
return config | ||
} | ||
|
||
func testAccGlueCrawlerConfig_CatalogTarget_TableList(tables []string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the noted reference above (aws_glue_catalog_table.test[*].name
), this function is extraneous. 👍
} | ||
EOF | ||
} | ||
`, rName, rName, rName, rName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Go's fmt verbs support indexing, e.g. %[1]q
so repeated arguments are not necessary. 👍
Hi @bflad, thank you very much for the review! I've updated the PR, it's ready for review again. The CI failed on Output from acceptance testing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, @azclub, thank you! 🚀
--- PASS: TestAccAWSGlueCrawler_Role_ARN_NoPath (39.80s)
--- PASS: TestAccAWSGlueCrawler_recreates (45.98s)
--- PASS: TestAccAWSGlueCrawler_SchemaChangePolicy (57.52s)
--- PASS: TestAccAWSGlueCrawler_Configuration (59.91s)
--- PASS: TestAccAWSGlueCrawler_SecurityConfiguration (62.03s)
--- PASS: TestAccAWSGlueCrawler_TablePrefix (61.69s)
--- PASS: TestAccAWSGlueCrawler_JdbcTarget_Exclusions (62.45s)
--- PASS: TestAccAWSGlueCrawler_CatalogTarget_Multiple (69.91s)
--- PASS: TestAccAWSGlueCrawler_JdbcTarget_Multiple (70.66s)
--- PASS: TestAccAWSGlueCrawler_Classifiers (71.49s)
--- PASS: TestAccAWSGlueCrawler_Role_Name_Path (76.75s)
--- PASS: TestAccAWSGlueCrawler_Description (79.83s)
--- PASS: TestAccAWSGlueCrawler_S3Target_Multiple (80.29s)
--- PASS: TestAccAWSGlueCrawler_Role_ARN_Path (81.78s)
--- PASS: TestAccAWSGlueCrawler_CatalogTarget (84.14s)
--- PASS: TestAccAWSGlueCrawler_Schedule (86.09s)
--- PASS: TestAccAWSGlueCrawler_S3Target_Exclusions (91.98s)
--- PASS: TestAccAWSGlueCrawler_JdbcTarget (91.91s)
--- PASS: TestAccAWSGlueCrawler_S3Target (124.60s)
--- PASS: TestAccAWSGlueCrawler_DynamodbTarget (124.71s)
This has been released in version 2.23.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Fixes #8631
Release note for CHANGELOG:
Output from acceptance testing: