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

WIP!: r/aws-athena-workgroup added #7995

Closed

Conversation

marcotesch
Copy link
Contributor

@marcotesch marcotesch commented Mar 18, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #7650, #7667

Changes proposed in this pull request:

  • Add new resource aws_athena_workgroup

This is now WIP, Test Output will be added when available

resource "aws_athena_workgroup" "hr_workgroup" {
    name                                  = "HR Workgroup"
    description                           = "Athena Workgroup for HR"
    bytes_scanned_cutoff_per_query        = "${var.cut_off_bytes}"
    enforce_workgroup_configuration       = true
    publish_cloudwatch_metrics_enabled    = true
    output_location                       = "s3://path/to/output"
    encryption_option                     = "SSE_KMS"
    kms_key                               = "${aws_kms_key.hr_kms_key.arn}"   
} 

First test(s) are written and running:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSAthenaWorkGroup_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSAthenaWorkGroup_ -timeout 120m
=== RUN   TestAccAWSAthenaWorkGroup_basic
=== PAUSE TestAccAWSAthenaWorkGroup_basic
=== RUN   TestAccAWSAthenaWorkGroup_withDescription
=== PAUSE TestAccAWSAthenaWorkGroup_withDescription
=== RUN   TestAccAWSAthenaWorkGroup_withDescriptionUpdate
=== PAUSE TestAccAWSAthenaWorkGroup_withDescriptionUpdate
=== RUN   TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQuery
=== PAUSE TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQuery
=== RUN   TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQueryUpdate
=== PAUSE TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQueryUpdate
=== RUN   TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfiguration
=== PAUSE TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfiguration
=== RUN   TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfigurationUpdate
=== PAUSE TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfigurationUpdate
=== RUN   TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabled
=== PAUSE TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabled
=== RUN   TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabledUpdate
=== PAUSE TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabledUpdate
=== RUN   TestAccAWSAthenaWorkGroup_withOutputLocation
=== PAUSE TestAccAWSAthenaWorkGroup_withOutputLocation
=== RUN   TestAccAWSAthenaWorkGroup_withOutputLocationUpdate
=== PAUSE TestAccAWSAthenaWorkGroup_withOutputLocationUpdate
=== RUN   TestAccAWSAthenaWorkGroup_withSseS3Encryption
=== PAUSE TestAccAWSAthenaWorkGroup_withSseS3Encryption
=== RUN   TestAccAWSAthenaWorkGroup_withKmsEncryption
=== PAUSE TestAccAWSAthenaWorkGroup_withKmsEncryption
=== RUN   TestAccAWSAthenaWorkGroup_withKmsEncryptionUpdate
=== PAUSE TestAccAWSAthenaWorkGroup_withKmsEncryptionUpdate
=== CONT  TestAccAWSAthenaWorkGroup_basic
=== CONT  TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabled
=== CONT  TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabledUpdate
=== CONT  TestAccAWSAthenaWorkGroup_withKmsEncryptionUpdate
=== CONT  TestAccAWSAthenaWorkGroup_withKmsEncryption
=== CONT  TestAccAWSAthenaWorkGroup_withSseS3Encryption
=== CONT  TestAccAWSAthenaWorkGroup_withOutputLocationUpdate
=== CONT  TestAccAWSAthenaWorkGroup_withOutputLocation
=== CONT  TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQueryUpdate
=== CONT  TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfigurationUpdate
=== CONT  TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfiguration
=== CONT  TestAccAWSAthenaWorkGroup_withDescriptionUpdate
=== CONT  TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQuery
=== CONT  TestAccAWSAthenaWorkGroup_withDescription
--- PASS: TestAccAWSAthenaWorkGroup_basic (9.95s)
--- PASS: TestAccAWSAthenaWorkGroup_withSseS3Encryption (10.62s)
--- PASS: TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabled (11.73s)
--- PASS: TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfiguration (12.21s)
--- PASS: TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQuery (12.51s)
--- PASS: TestAccAWSAthenaWorkGroup_withDescriptionUpdate (16.72s)
--- PASS: TestAccAWSAthenaWorkGroup_withBytesScannedCutoffPerQueryUpdate (16.98s)
--- PASS: TestAccAWSAthenaWorkGroup_withPublishCloudWatchMetricsEnabledUpdate (18.38s)
--- PASS: TestAccAWSAthenaWorkGroup_withEnforceWorkgroupConfigurationUpdate (25.56s)
--- PASS: TestAccAWSAthenaWorkGroup_withDescription (25.80s)
--- PASS: TestAccAWSAthenaWorkGroup_withOutputLocationUpdate (28.07s)
--- PASS: TestAccAWSAthenaWorkGroup_withOutputLocation (30.88s)
--- PASS: TestAccAWSAthenaWorkGroup_withKmsEncryption (32.30s)
--- PASS: TestAccAWSAthenaWorkGroup_withKmsEncryptionUpdate (48.41s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       48.450s

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Mar 18, 2019
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Mar 18, 2019
Signed-off-by: Marco Tesch <mtesch@tecracer.de>
Added skeleton of resourceAwsAthenaWorkgroupUpdate Function

Signed-off-by: Marco Tesch <mtesch@tecracer.de>
@ghost ghost added size/L Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed size/M Managed by automation to categorize the size of a PR. labels Mar 18, 2019
@marcotesch
Copy link
Contributor Author

Added first TestCase, still working on create/update/read functionality.

#7667 might become an issue as the SDK does not allow to have an ARN for the WorkGroup, which is needed to list-tags. But still working on it.

@marcotesch
Copy link
Contributor Author

@bflad : Got some Travis CI Problems with the govet/nillness checks you have fixed here how I might recover my branch from that?

@bflad bflad added new-resource Introduces a new resource. service/athena Issues and PRs that pertain to the athena service. labels Mar 18, 2019
@bflad
Copy link
Contributor

bflad commented Mar 18, 2019

@marcotesch the fixes need to be reviewed and merged into master first then we can restart the TravisCI build. You could also pull in my commits, but that could be troublesome if we change the implementation during review.

Signed-off-by: Marco Tesch <mtesch@tecracer.de>
Signed-off-by: Marco Tesch <mtesch@tecracer.de>
Signed-off-by: Marco Tesch <mtesch@tecracer.de>
@marcotesch
Copy link
Contributor Author

@marcotesch the fixes need to be reviewed and merged into master first then we can restart the TravisCI build. You could also pull in my commits, but that could be troublesome if we change the implementation during review.

Looks good now @bflad. I will keep working on this, probably tags will not be ready for the first release version and get added later on, if thats fine with you?

@florianlocqueneux
Copy link

florianlocqueneux commented Mar 20, 2019

Athena workgroups provide the ability to follow costs using tag allocation for specific processing, without the tags, workgroups are useless ( for my usage )

Added Update Functionality for the Parameter

Signed-off-by: Marco Tesch <mtesch@tecracer.de>
Added Updated Test for WorkGroup w. BSCPQ Param.

Signed-off-by: Marco Tesch <mtesch@tecracer.de>
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Mar 20, 2019
@marcotesch
Copy link
Contributor Author

Athena workgroups provide the ability to follow costs using tag allocation for specific processing, without the tags, workgroups are useless ( for my usage )

@florianlocqueneux: For sure there are UseCases where Tags are needed. But lets look at the plain resource functionality, for that tags are not needed at all. So imho a working resource might be the first merge and the tag support for said resource might be a second seperate merge.

This does not imply that I'm not trying to squeeze tag-support in the resource right from the get go but there might be some problems wich are not that easy to overcome.

Signed-off-by: Marco Tesch <mtesch@tecracer.de>
@marcotesch
Copy link
Contributor Author

marcotesch commented Mar 27, 2019

This is now the first functioning version without Tags, so far.

I will now add some documentation, but the main code is ready for an official review (@bflad) at this point in time.

@xmj
Copy link

xmj commented Apr 10, 2019

@marcotesch wondering if you could fix the merge conflicts

thanks!

@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Apr 10, 2019
@zerfahp
Copy link

zerfahp commented Jun 3, 2019

Would it be possible to get this one going? Sorry, I can't tell if this is difficult or not. It would be extremely useful to have this capability. Thanks.

@DominicBreuker
Copy link

would also love to see it merged :)

@marcotesch marcotesch requested a review from a team June 25, 2019 13:13
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XXL Managed by automation to categorize the size of a PR. labels Jun 25, 2019
@marcotesch
Copy link
Contributor Author

At the moment, I unfortunately don't have the time to write the needed documentation, which leads to the problem that this might not be merged any time soon. But for now I resolved the existing merge conflict.

@bflad
Copy link
Contributor

bflad commented Jul 9, 2019

Hi @marcotesch 👋 Would it be okay if the maintainers or another community member finished up this functionality in followup commits?

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jul 9, 2019
@marcotesch
Copy link
Contributor Author

marcotesch commented Jul 9, 2019 via email

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Jul 9, 2019
@bflad
Copy link
Contributor

bflad commented Jul 9, 2019

@marcotesch no worries, you did great work and many people will be happy when the functionality is made available! We hope that you can continue contributing in the future. 😄

I will post a followup PR either later today or tomorrow that combines this with #8136

@bflad bflad self-assigned this Jul 9, 2019
@bflad
Copy link
Contributor

bflad commented Jul 10, 2019

Followup PR which includes all the commits here is available at: #9290

Please follow that pull request for further updates and thank you again for all the hard work, @marcotesch!

@bflad bflad closed this Jul 10, 2019
@zerfahp
Copy link

zerfahp commented Jul 10, 2019

Thanks for pushing on with this. Much appreciated. Looking forward to putting it to use soon.

@DominicBreuker
Copy link

thx a lot!

@bflad bflad added this to the v2.19.0 milestone Jul 11, 2019
@bflad
Copy link
Contributor

bflad commented Jul 11, 2019

#9290 has been merged and will release with version 2.19.0 of the Terraform AWS Provider, likely later today. 👍

@ghost
Copy link

ghost commented Nov 2, 2019

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 Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/athena Issues and PRs that pertain to the athena service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Resource: aws_athena_workgroup
6 participants