-
Notifications
You must be signed in to change notification settings - Fork 9.8k
r/aws_athena_workgroup - Add support for managed_query_results_configuration #45223
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
base: main
Are you sure you want to change the base?
r/aws_athena_workgroup - Add support for managed_query_results_configuration #45223
Conversation
…uration % make testacc TESTS=TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration PKG=athena make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 r/aws_athena_workgroup-add_managed_storage 🌿... TF_ACC=1 go1.24.10 test ./internal/service/athena/... -v -count 1 -parallel 20 -run='TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration' -timeout 360m -vet=off 2025/11/20 13:35:33 Creating Terraform AWS Provider (SDKv2-style)... 2025/11/20 13:35:33 Initializing Terraform AWS Provider (SDKv2-style)... === RUN TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration === PAUSE TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration === CONT TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration --- PASS: TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration (34.18s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/athena 38.854s
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
|
For the attribute managed_query_results_configuration.enabled, when set to true, the attribute result_configuration.output_location cannot be set. |
internal/service/athena/workgroup.go
Outdated
| names.AttrEnabled: { | ||
| Type: schema.TypeBool, | ||
| Optional: true, | ||
| Default: false, |
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.
Unless necessary for the API to function, we typically avoid provider-side defaults.
https://hashicorp.github.io/terraform-provider-aws/data-handling-and-conversion/#default-values
| }) | ||
| } | ||
|
|
||
| func TestAccAthenaWorkGroup_ManagedQueryResultsConfiguration(t *testing.T) { |
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.
Can we add additional steps to this test case to exercise disabling, then re-enabling the feature to ensure update works as expected?
|
|
||
| #### Managed Query Results Configuration | ||
|
|
||
| * `enabled` - (Optional) If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under result_configuration.output_location. The default is false. A workgroup cannot have the result_configuration.output_location parameter when you set this field to true. |
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 - making values and attribute names format as code can make the rendered result a bit more readable.
| * `enabled` - (Optional) If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores query results in location specified under result_configuration.output_location. The default is false. A workgroup cannot have the result_configuration.output_location parameter when you set this field to true. | |
| * `enabled` - (Optional) If set to `true`, allows you to store query results in Athena owned storage. If set to `false`, workgroup member stores query results in the location specified by `result_configuration.output_location`. The default is `false`. A workgroup cannot have the `result_configuration.output_location` set when this is `true`. |
Because the attributes are split across arguments, you'll likely need a https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/customizing-differences |
Thank you for your contribution. I would be glad to merge my changes into #44273. However, while trying to test the update functionality, I have noticed a few issues with our previous approach. I suspect the same issues may be causing #37917, as the logic surrounding
To fix these issues, I have changed the approach of the |
|
Thank you for the detailed investigation and for your willingness to merge your changes into #44273. I fully understand the issues you identified regarding the update logic for Please proceed with the merge. Thanks again for your hard work on this! |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
Adds support to aws_athena_workgroup resource for managed storage for Athena query results.
Relations
Closes #43246
References
https://docs.aws.amazon.com/athena/latest/APIReference/API_ManagedQueryResultsConfiguration.html
https://docs.aws.amazon.com/athena/latest/APIReference/API_WorkGroupConfiguration.html
Output from Acceptance Testing