Skip to content

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

Merged
spikecurtis merged 2 commits into
mainfrom
spike/1967_authenticated_terraform
Jun 3, 2022
Merged

spikecurtis merged 2 commits into
mainfrom
spike/1967_authenticated_terraform

Conversation

@spikecurtis

Copy link
Copy Markdown
Collaborator

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>
@spikecurtis
spikecurtis requested review from bpmct and kylecarbs June 3, 2022 18:15
Signed-off-by: Spike Curtis <spike@coder.com>

@bpmct bpmct left a comment

Copy link
Copy Markdown
Member

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 thread docs/templates.md
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator 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
@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.

2 participants