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

Terraform Cloud joining: Support Terraform Enterprise issuers #46051

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

timothyb89
Copy link
Contributor

@timothyb89 timothyb89 commented Aug 30, 2024

This adds support for hostname/issuer overrides, needed to support on-prem Terraform Enterprise installs. When the new hostname field is unset, behavior is changed, but when set, the JWT is validated against it instead of app.terraform.io.

Additionally, this renames join_terraform.go to join_terraformcloud.go, since that was missed during the rename in #45574.

changelog: Support self-hosted Terraform Enterprise instances in Terraform Cloud joining

This adds support for hostname/issuer overrides, needed to support
on-prem Terraform Enterprise installs. When the new `hostname` field
is unset, behavior is changed, but when set, the JWT is validated
against it instead of `app.terraform.io`.

Additionally, this renames `join_terraform.go` to
`join_terraformcloud.go`, since that was missed during the rename
in #45574.
@timothyb89
Copy link
Contributor Author

I'm reasonably confident this should work, but unfortunately do not have any Terraform Enterprise instances to test against. We'll need to decide how/if we want to merge it in light of that, but I figure it's at least ready for review.

Copy link

github-actions bot commented Sep 7, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link

github-actions bot commented Sep 7, 2024

🤖 Vercel preview here: https://docs-zg4xx1ina-goteleport.vercel.app/docs/ver/preview

Copy link

github-actions bot commented Sep 9, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link

github-actions bot commented Sep 9, 2024

🤖 Vercel preview here: https://docs-ahh2wuwop-goteleport.vercel.app/docs/ver/preview

@timothyb89 timothyb89 added this pull request to the merge queue Sep 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 10, 2024
@timothyb89 timothyb89 added this pull request to the merge queue Sep 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 10, 2024
Copy link

🤖 Vercel preview here: https://docs-l8fiyga9f-goteleport.vercel.app/docs/ver/preview

@timothyb89 timothyb89 added this pull request to the merge queue Sep 10, 2024
Merged via the queue into master with commit db689c7 Sep 10, 2024
43 checks passed
@timothyb89 timothyb89 deleted the timothyb89/terraform-enterprise-joining branch September 10, 2024 01:52
timothyb89 added a commit that referenced this pull request Sep 13, 2024
This adds support for hostname/issuer overrides, needed to support
on-prem Terraform Enterprise installs. When the new `hostname` field
is unset, behavior is changed, but when set, the JWT is validated
against it instead of `app.terraform.io`.

Additionally, this renames `join_terraform.go` to
`join_terraformcloud.go`, since that was missed during the rename
in #45574.
github-merge-queue bot pushed a commit that referenced this pull request Sep 18, 2024
* Machine ID: Terraform Cloud joining (#45574)

Backport of #45574 for branch/v16

---

* Machine ID: Terraform Cloud joining

This adds a new `terraform` join method, which uses Terraform Cloud's
Workload Identity OIDC provider to provide delegated joining support
for Machine ID bots. As the Terraform provider now embeds tbot, this
means - with some light modifications - that the Terraform provider
can now join using this join method, and without any secrets.

* Address some review feedback, add first batch of tests

This addresses a few feedback items, defaulting the audience to the
Teleport cluster name and requiring allow rules specify an
organization + at least one other parameter.

Also, adds a first batch of tests.

* Update autogenerated CRD docs

* Add tests for RegisterUsingToken and provisioning token init

* Fix imports

* Fix CRD docs

* Update tfschema

* Update tf docs

* Update docstring to make it clear that `Audience` is optional

* Update manifests

* Update CRD docs

* Code review feedback; docstring fixes

* Rename lib/terraform to lib/terraformcloud

* Rename terraform -> terraform_cloud

Renames the new join method to terraform_cloud to make it clear that
it won't work for TF running elsewhere (where other join methods
should be used)

* Fix tests and docs lints

* Update api/proto/teleport/legacy/types/types.proto

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Update proto artifacts

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Terraform Cloud joining: Support Terraform Enterprise issuers (#46051)

This adds support for hostname/issuer overrides, needed to support
on-prem Terraform Enterprise installs. When the new `hostname` field
is unset, behavior is changed, but when set, the JWT is validated
against it instead of `app.terraform.io`.

Additionally, this renames `join_terraform.go` to
`join_terraformcloud.go`, since that was missed during the rename
in #45574.

* Enable Terraform Cloud joining for Teleport Community Edition (#46419)

* Terraform Cloud joining: Support Terraform Enterprise issuers

This adds support for hostname/issuer overrides, needed to support
on-prem Terraform Enterprise installs. When the new `hostname` field
is unset, behavior is changed, but when set, the JWT is validated
against it instead of `app.terraform.io`.

Additionally, this renames `join_terraform.go` to
`join_terraformcloud.go`, since that was missed during the rename
in #45574.

* Enable Terraform Cloud joining for Teleport Community Edition

This enables Terraform Cloud joining for Community Edition when
using the public HCP Terraform SaaS. Teleport Enterprise is still
required for use with self-hosted Terraform Enterprise.

changelog: Enable Terraform Cloud joining for Teleport Community Edition when using HCP Terraform

* Fix unit tests

* Update lib/auth/join_terraformcloud.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* Fix linter

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants