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

Support for creating deploy_key #40

Open
janario opened this issue Aug 9, 2024 · 4 comments
Open

Support for creating deploy_key #40

janario opened this issue Aug 9, 2024 · 4 comments
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@janario
Copy link

janario commented Aug 9, 2024

As in the rest resources https://open-api.netlify.com/#tag/deployKey

It would be great to have this with terraform, so it would simplify a lot our infra provisioning.

e.g.

resource "netlify_deploy_key" "key" {
  # if any custom param? but I guess the create doesn't need any
}

# easy integrate my gitlab
resource "gitlab_deploy_key" "netlify_key" {
  project = "my-gitlab-project"
  title   = "Netlify deployment key"
  key     = netlify_deploy_key.key.public_key # allows the just created key to access my-gitlab-project
}

@ramonsnir ramonsnir added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Aug 9, 2024
@ramonsnir
Copy link
Member

Sites should be created with at least one deploy key, in most/all flows. You can query that key using data.netlify_site: https://registry.terraform.io/providers/netlify/netlify/latest/docs/data-sources/site#git_deploy_key

Would that be sufficient for your use case?

@janario
Copy link
Author

janario commented Aug 10, 2024

That would work also, but in our case we have a monorepo with around 30 sites, so I guess it would result in 30 deploy keys right?

So far we used other unofficial providers to do the 1 deploy_key all 30 sites with the same key and our gitlab repo with this 1 key.

@ramonsnir
Copy link
Member

I see. So the key part of this is the ability to set the deploy key of a site to an existing one, and not the creation itself of keys. Makes sense!

@janario
Copy link
Author

janario commented Aug 10, 2024

For our scenario create a deploy key and reuse in other resources Gitlab repo and all the 30 sites creation with the same deploy key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

2 participants