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

Don't use parameters to pass secrets to GCP or AWS #2039

Merged
merged 2 commits into from
Jun 3, 2022

Conversation

spikecurtis
Copy link
Contributor

First of several PRs for #1967

This updates the AWS and GCP templates. I'd like to also do Kubernetes and Digital Ocean, but I'll need to chase down credentials and/or a test cluster, so let's not block this PR on that.

Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will simplify things a lot, thanks.

Comment on lines +84 to +88
The way these generally work is via the credentials being available to Coder either in some
well-known location on disk (e.g. `~/.aws/credentials` for AWS on posix systems), or via
environment variables. It is usually sufficient to authenticate using the CLI or SDK for the
cloud provider before running Coder for this to work, but check the Terraform provider
documentation for details.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the detail here 👍🏼

Comment on lines +13 to +18
## Authentication

This template assumes that coderd is run in an environment that is authenticated
with AWS. For example, run `aws configure import` to import credentials on the
system and user running coderd. For other ways to authenticate [consult the
Terraform docs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication-and-configuration).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, this isn't really be visible when creating a template via coder templates init. I added a mock "variable" in the Docker example, but I'm not really happy with this.

Any ideas? Perhaps it's also fair to rely on the default Terraform errors (+ these docs) to warn users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't like the idea of hijacking parameters to guide end users. If we can't expect users to read the README in the examples, and want do do some handholding, we should build out a guided template init

@spikecurtis spikecurtis merged commit 847e2b1 into main Jun 3, 2022
@spikecurtis spikecurtis deleted the spike/1967_authenticated_terraform branch June 3, 2022 21:29
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
* Don't use parameters to pass secrets to GCP or AWS

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix fmt

Signed-off-by: Spike Curtis <spike@coder.com>
@bpmct bpmct mentioned this pull request Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants