- Notifications
You must be signed in to change notification settings - Fork927
Don't use parameters to pass secrets to GCP or AWS#2039
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -23,8 +23,6 @@ vim <template-name>/main.tf | ||
coder templates<create/update><template-name> | ||
``` | ||
##Persistent and ephemeral resources | ||
Coder supports both ephemeral and persistent resources in workspaces. Ephemeral | ||
@@ -53,6 +51,42 @@ Templates often contain *parameters*. In Coder, there are two types of parameter | ||
each workspace, often personalization settings such as "preferred | ||
region" or "workspace image". | ||
##Best Practices | ||
###Template Changes | ||
We recommend source controlling your templates. | ||
###Authenticating with Cloud Providers | ||
Coder's provisioner process needs to authenticate with cloud provider APIs to provision | ||
workspaces. We strongly advise against including credentials directly in your templates. You | ||
can either pass credentials to the provisioner as parameters, or execute Coder | ||
in an environment that is authenticated with the cloud provider. | ||
We encourage the latter where supported. This approach simplifies the template, keeps cloud | ||
provider credentials out of Coder's database (making it a less valuable target for attackers), | ||
and is compatible with agent-based authentication schemes (that handle credential rotation | ||
and/or ensure the credentials are not written to disk). | ||
Cloud providers for which the Terraform provider supports authenticated environments include | ||
*[Google Cloud](https://registry.terraform.io/providers/hashicorp/google/latest/docs) | ||
*[Amazon Web Services](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) | ||
*[Microsoft Azure](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs) | ||
*[Kubernetes](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs) | ||
Additional providers may be supported; check the | ||
[documentation of the Terraform provider](https://registry.terraform.io/browse/providers) for | ||
details. | ||
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. | ||
Comment on lines +84 to +88 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Appreciate the detail here 👍🏼 | ||
--- | ||
Next:[Workspaces](./workspaces.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,6 +10,13 @@ tags: [cloud, aws] | ||
Pick this template in`coder templates init` and follow instructions. | ||
##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). | ||
Comment on lines +13 to +18 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Currently, this isn't really be visible when creating a template via Any ideas? Perhaps it's also fair to rely on the default Terraform errors (+ these docs) to warn users. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
##Required permissions / policy | ||
This example policy allows Coder to create EC2 instances and modify instances provisioned by Coder. | ||