Skip to content

Conversation

@psantus
Copy link
Contributor

@psantus psantus commented Oct 16, 2025

Description

Adds support for RDS Data Query, with the Terraform action workflow.

Simple usage:

action "aws_rdsdata_query" "example" {
  config {
    resource_arn = aws_rds_cluster.example.arn
    secret_arn   = aws_secretsmanager_secret_version.example.arn
    sql          = "SELECT COUNT(*) FROM users"
  }
}

Parameterized query

action "aws_rdsdata_query" "user_lookup" {
  config {
    resource_arn = aws_rds_cluster.example.arn
    secret_arn   = aws_secretsmanager_secret_version.example.arn
    database     = "example"
    sql          = "SELECT * FROM users WHERE status = :status AND created_date > :date"

    parameters {
      name  = "status"
      value = "active"
    }

    parameters {
      name  = "date"
      value = "2024-01-01"
    }
  }
}

Relations

On top of #44629 ( Add RDS Data Service) #44630 (aws_rdsdata_query datasource) #44643 (aws_rdsdata_query resource)

Closes #44472

References

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html
https://docs.aws.amazon.com/rdsdataservice/latest/APIReference/API_ExecuteStatement.html

Output from Acceptance Testing

% make testacc TESTS=TestAccRDSDataQueryAction_basic PKG=rdsdata

2025/10/16 16:26:40 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/16 16:26:40 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccRDSDataQueryAction_basic
=== PAUSE TestAccRDSDataQueryAction_basic
=== CONT  TestAccRDSDataQueryAction_basic
--- PASS: TestAccRDSDataQueryAction_basic (1218.59s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/rdsdata    1223.308s

@github-actions
Copy link
Contributor

Community Guidelines

This 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

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

⚠️ Our automation has detected the following potential issues with your pull request


❌ Changelog Entry Required (Click to expand)

The proposed change requires a changelog entry. Please see the Changelog Process section of the contributing guide for information on the changelog generation process.

Tip: This check is not triggered for draft pull requests, since the pull request number is not known until the pull request is opened and is required to create a changelog entry. Opening a pull request first as a draft, adding the requisite changelog entry file, and then marking the pull request as ready for review will prevent future warnings.

@psantus psantus changed the title F/rdsdata query action Add aws_rdsdata_query action Oct 16, 2025
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. provider Pertains to the provider itself, rather than any interaction with AWS. linter Pertains to changes to or issues with the various linters. sweeper Pertains to changes to or issues with the sweeper. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. service/rdsdata Issues and PRs that pertain to the rdsdata service. size/XL Managed by automation to categorize the size of a PR. labels Oct 16, 2025
@justinretzolk justinretzolk added new-action Introduces a new action. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 22, 2025
@psantus psantus marked this pull request as ready for review November 12, 2025 21:57
@psantus psantus requested a review from a team as a code owner November 12, 2025 21:57
@psantus psantus force-pushed the f/rdsdata-query-action branch 2 times, most recently from 75dd16f to 6294753 Compare November 26, 2025 15:16
@psantus
Copy link
Contributor Author

psantus commented Nov 26, 2025

(rebased)

@psantus psantus force-pushed the f/rdsdata-query-action branch 3 times, most recently from 3259083 to 09e4828 Compare November 26, 2025 17:01
@psantus psantus force-pushed the f/rdsdata-query-action branch from 09e4828 to 6c7a538 Compare November 26, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-connections Pertains to the AWS Client and service connections. documentation Introduces or discusses updates to documentation. generators Relates to code generators. linter Pertains to changes to or issues with the various linters. new-action Introduces a new action. provider Pertains to the provider itself, rather than any interaction with AWS. service/rdsdata Issues and PRs that pertain to the rdsdata service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. 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.

Action for RDS Data API ExecuteStatement

2 participants