Skip to content
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

r/aws_athena_database: validate athena db name with regex as per docs #4133

Merged
merged 2 commits into from
Apr 12, 2018
Merged

r/aws_athena_database: validate athena db name with regex as per docs #4133

merged 2 commits into from
Apr 12, 2018

Conversation

appilon
Copy link
Contributor

@appilon appilon commented Apr 9, 2018

Fix #4128

Validate athena db name with regex as per docs (also wrap name in SQL syntax with `` to support leading underscore as per docs)

https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html

Also simplify config to 1 function

add test cases for possible db names
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Apr 9, 2018
add testcase for uppercase name
refactor test config to one func
@appilon appilon changed the title validate athena db name with regex as per docs r/aws_athena_database: validate athena db name with regex as per docs Apr 10, 2018
@@ -81,7 +117,7 @@ func testAccCheckAWSAthenaDatabaseDestroy(s *terraform.State) error {
}

rInt := acctest.RandInt()
bucketName := fmt.Sprintf("tf-athena-db-%s-%d", rs.Primary.Attributes["name"], rInt)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case where I had an _ in the db name, creating a bucket with that name in it caused an error, the random integer should be sufficient in ensuring a unique bucketName

@appilon appilon requested review from catsby and a team April 10, 2018 00:26
@bflad bflad added bug Addresses a defect in current functionality. service/athena Issues and PRs that pertain to the athena service. labels Apr 12, 2018
@bflad bflad added this to the v1.15.0 milestone Apr 12, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

5 tests passed (all tests)
=== RUN   TestAccAWSAthenaDatabase_nameCantHaveUppercase
--- PASS: TestAccAWSAthenaDatabase_nameCantHaveUppercase (0.99s)
=== RUN   TestAccAWSAthenaDatabase_basic
--- PASS: TestAccAWSAthenaDatabase_basic (31.25s)
=== RUN   TestAccAWSAthenaDatabase_nameStartsWithUnderscore
--- PASS: TestAccAWSAthenaDatabase_nameStartsWithUnderscore (32.78s)
=== RUN   TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds
--- PASS: TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds (36.63s)
=== RUN   TestAccAWSAthenaDatabase_destroyFailsIfTablesExist
--- PASS: TestAccAWSAthenaDatabase_destroyFailsIfTablesExist (41.79s)

@bflad bflad merged commit faac60a into hashicorp:master Apr 12, 2018
bflad added a commit that referenced this pull request Apr 12, 2018
@bflad
Copy link
Contributor

bflad commented Apr 18, 2018

This has been released in version 1.15.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 6, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/athena Issues and PRs that pertain to the athena service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error Creating Athena Database
2 participants