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

Datasource google_sql_database_instances #8164

Closed
omelnyk1 opened this issue Jan 11, 2021 · 4 comments
Closed

Datasource google_sql_database_instances #8164

omelnyk1 opened this issue Jan 11, 2021 · 4 comments

Comments

@omelnyk1
Copy link

omelnyk1 commented Jan 11, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Affected Resource(s)

  • google_sql_database_instances

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

# List of sql instances created in GCP project with name foobar
# gcloud sql instances list --project=foobar
data "google_sql_database_instances" "this" {
    project = "foobar"
}

# List all sql instances with status RUNNABLE and location - europe-west1-b
# gcloud sql instances list --filter "STATUS=RUNNABLE AND LOCATION=europe-west1-b"

data "google_sql_database_instances" "this" {
    status   = "RUNNABLE"
    location = "europe-west1-b"
}

Arguments:
project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
database_version - (Optional) The MySQL, PostgreSQL or SQL Server (beta) version to use.
location - (Optional) zone name in which the resource belongs.
tier - (Optional) The machine type to use.
status - (Optional) The current serving state of the database instance. https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances#sqlinstancestate

Attributes:
instances - list of sql instance names.

References

https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/list

  • #0000
@ghost ghost added enhancement labels Jan 11, 2021
@omelnyk1 omelnyk1 changed the title Datasource sql_database_instances Datasource google_sql_database_instances Jan 11, 2021
@slevenick
Copy link
Collaborator

Hey @omelnyk1 can I ask what your use case for this datasource would be? I'm not sure why having this list would be helpful within Terraform

@omelnyk1
Copy link
Author

Hi @slevenick ,
For cloud-sql-proxy I'd like to generate instances parameter with connection string to all sql instances available in current GCP project. I have no idea the name, state and count.
I tried data source google_sql_database_instance, however it requires name argument.

@roaks3
Copy link
Collaborator

roaks3 commented Jul 31, 2024

Appears to be resolved by GoogleCloudPlatform/magic-modules#6980

@roaks3 roaks3 closed this as completed Jul 31, 2024
Copy link

github-actions bot commented Sep 2, 2024

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants