Skip to content

Support DiscoveryConfig in terraform provider#61680

Merged
avatus merged 2 commits intomasterfrom
avatus/tf
Nov 26, 2025
Merged

Support DiscoveryConfig in terraform provider#61680
avatus merged 2 commits intomasterfrom
avatus/tf

Conversation

@avatus
Copy link
Copy Markdown
Contributor

@avatus avatus commented Nov 21, 2025

Closes #60809

This will allow users to manage the DiscoveryConfig resource via terraform

Changelog: DiscoveryConfig resources can now be managed via the Teleport Terraform Provider

@public-teleport-github-review-bot
Copy link
Copy Markdown

@avatus - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

@avatus
Copy link
Copy Markdown
Contributor Author

avatus commented Nov 21, 2025

i know there are generated files involved, but 5k lines? is that normal?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 21, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
avatus/tf 01f169e 7 ✅SUCCEED avatus-tf 2025-11-26 14:45:40

Comment on lines +33 to +37
install_params = {
join_method = "iam"
join_token = "aws-discovery-token"
script_name = "default-installer"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are a couple of values that are set when the install_params is not set in the teleport.yaml/discovery_service.aws[].install or in discovery_config.spec.aws[].install.

As an example, if the install_params is not set, it will set the:

  • enroll_mode to script enum value
  • install_teleport to true

I'm not sure we can do the same logic here, but if possible let's at least ensure the example value is set to those values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we update the bot to ignore this generated code when sizing the PR?

Copy link
Copy Markdown
Contributor

@hugoShaka hugoShaka Nov 26, 2025

Choose a reason for hiding this comment

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

You got pulled in not because of the PR size bot but because I bumped the protoc-gen-tfschema versa and it was referenced in a GHA job. Any gha workflow requires approval from codeowners.

I think file is already ignored, else the PR would have pulled all admins initially, and not only when the version got bumped.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hrmm are you sure, the label is size/xl and the bot left a comment asking for an admin reviewer.

Copy link
Copy Markdown
Contributor

@hugoShaka hugoShaka Nov 26, 2025

Choose a reason for hiding this comment

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

I'll check the size bot rules, I had changes to do anyway, but you did get pulled because of my commit:
image

avatus and others added 2 commits November 26, 2025 08:40
Closes #60809

This will allow users to manage the DiscoveryConfig resource via
terraform
There no need to roll our own JoinMethod type, the join method
underlying type is a regular string. We can tell the schema geenrator to
use the native string type instead of having to write our own types
(which is error prone, we already messed up the bool option once).

This commit requires the protoc-gen-terraform v3.0.3 (with a schema
override fix, unreleased as of now).

protoc-gen-tfschema 3.0.2 -> 3.0.3
@avatus avatus enabled auto-merge November 26, 2025 14:48
@avatus avatus added this pull request to the merge queue Nov 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2025
@avatus avatus added this pull request to the merge queue Nov 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 26, 2025
@avatus avatus added this pull request to the merge queue Nov 26, 2025
Merged via the queue into master with commit 96f222c Nov 26, 2025
49 checks passed
@avatus avatus deleted the avatus/tf branch November 26, 2025 16:14
cthach pushed a commit that referenced this pull request Dec 1, 2025
* Support DiscoveryConfig in terraform provider

Closes #60809

This will allow users to manage the DiscoveryConfig resource via
terraform

* Use TF types overrides instead of custom types

There no need to roll our own JoinMethod type, the join method
underlying type is a regular string. We can tell the schema geenrator to
use the native string type instead of having to write our own types
(which is error prone, we already messed up the bool option once).

This commit requires the protoc-gen-terraform v3.0.3 (with a schema
override fix, unreleased as of now).

protoc-gen-tfschema 3.0.2 -> 3.0.3

---------

Co-authored-by: hugoShaka <hugo.hervieux@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add terraform support for discovery config

6 participants