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

Cloud Composer connection resource #4418

Open
TV4Fun opened this issue Sep 6, 2019 · 12 comments
Open

Cloud Composer connection resource #4418

TV4Fun opened this issue Sep 6, 2019 · 12 comments

Comments

@TV4Fun
Copy link

TV4Fun commented Sep 6, 2019

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

In addition to being able to create Cloud Composer Environments through Terraform, it would be nice if we could set up connections, and perhaps some other internal config as well.

New or Affected Resource(s)

  • google_composer_environment_connection

Potential Terraform Configuration

resource "google_composer_environment" "my-environment" {
  ...
}

# One possible example
resource "google_composer_environment_connection" "my-environment-postgres" {
  composer_environment = google_composer_environment.my-enviroment.name
  conn_id = "my-postgres-db"
  conn_type = "postgres"
  conn_host = "db.example.com"
  conn_port = 1234
  conn_login = username
  conn_password = file("password.txt")
  conn_extra = {
    sslmode = "prefer"
    keepalives_idle = 60
  }
}

This can be implemented via the gcloud utility e.g. gcloud composer environments run my-environment --location us-central1 connections -- --add, but there doesn't appear to be an equivalent REST API command. Still I'm sure there must be a way to do it. Just do whatever gcloud does.

b/299443256

@ghost ghost added the enhancement label Sep 6, 2019
@irvifa
Copy link

irvifa commented Oct 31, 2019

Hi @danawillow when will this implemented in terraform?

@danawillow
Copy link
Contributor

We don't have a timeline for this feature yet. We're happy to accept PRs (see https://github.com/terraform-providers/terraform-provider-google/blob/master/.github/CONTRIBUTING.md; we generally add new resources viaMagic Modules instead of in TF directly). Otherwise, if you have an account manager, customer engineer, or other contact at Google or HashiCorp, you can ask them to reach out to our team to prioritize it higher.

@paddycarver paddycarver added this to the Backlog milestone Dec 6, 2019
@oslobodian
Copy link

Helo @danawillow, any chance for making this happen in 2020?

@danawillow
Copy link
Contributor

Same comment as before applies!

@irvifa
Copy link

irvifa commented Jul 3, 2020

@danawillow I was wondering if there's specific API in golang equivalent with run command. From what I've seen in the API. Note that we're using this for the Terraform Provider there's several utility for ListCall, CreateCall, and DeleteCall. However there's no specific API to run an environment.

@danawillow
Copy link
Contributor

I don't see anything at the link you posted or at https://cloud.google.com/composer/docs/reference/rest. If you run gcloud with --log-http, it'll tell you what requests it's making. Maybe there's a clue there, but it's also possible that it's calling an endpoint that isn't accessible from tools that aren't gcloud. For new resources we'd want them generated with magic modules anyway, so it doesn't matter whether it's in the golang SDK or not, as long as we can call the API publicly.

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Feb 8, 2021
modular-magician added a commit that referenced this issue Feb 8, 2021
Co-authored-by: upodroid <[email protected]>
Signed-off-by: Modular Magician <[email protected]>

Co-authored-by: upodroid <[email protected]>
@franviera92
Copy link

If necessary this feature

@raphaelauv
Copy link

raphaelauv commented Dec 10, 2021

Do not use terraform for everything !

airflow connections
airflow pools
airflow users
airflow variables

store them in JSON files that you load with the airflow cli or airflow REST API ( since airflow v2)

Do that in your CD pipelines the same way you publish your airflow DAGS and airflow plugins with your CD and not terraform

@DrFaust92
Copy link
Contributor

FYI I forked the airflow tf provider and added support for this and more:
https://registry.terraform.io/providers/DrFaust92/airflow/latest

@maguro
Copy link

maguro commented Jun 29, 2022

Do not use terraform for everything !

airflow connections airflow pools airflow users airflow variables

store them in JSON files that you load with the airflow cli or airflow REST API ( since airflow v2)

Do that in your CD pipelines the same way you publish your airflow DAGS and airflow plugins with your CD and not terraform

We use Terraform to publish DAGs etc.

@rileykarson
Copy link
Collaborator

Moving into Goals to mark that we'd like to support this, if possible. We're not sure that this is possible through the Composer API today (although gcloud seems to be able to, as folks suggest). We'll reach out to Cloud Composer engineers to figure out whether we're just missing something.

If this is not possible through their API, we'd want to recommend using other providers, most likely.

@rileykarson rileykarson modified the milestones: Backlog, Goals Jun 20, 2023
@github-actions github-actions bot added service/composer forward/review In review; remove label to forward labels Aug 17, 2023
@roaks3 roaks3 removed the forward/review In review; remove label to forward label Aug 18, 2023
@michalmodras
Copy link

That would require exposing native Airflow configuration directly in Terraform - something we don't do at the moment and do not have plans in the imminent future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests