-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Terraform: Add teleport_bot_v2 resource and teleport_bot datasource
#60310
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
base: master
Are you sure you want to change the base?
Conversation
|
@boxofrad - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes. |
|
Amplify deployment status
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do slightly worry that teleport_bot_v2 could be setting ourselves up for pain if we were to ever introduce BotV2 in Teleport itself. I'd be curious what Hugo and/or the rest of the team thinks.
What happens if they haven't upgraded the auth server first? |
It's certainly awkward. In that case, you'd likely need to write: resource "teleport_bot_v2" "bot" {
version = "v2"
# ...
}
The provider will exit with this error when you update a bot: Because it'll just sit in a retry loop reading the bot and checking if its revision has changed. One alternative would be to mark the resource with |
1acfb75 to
3bff1cd
Compare
3bff1cd to
73ff976
Compare
Fixes #40654, #51555, and #56910 by deprecating and replacing
teleport_botwith a newteleport_bot_v2resource.Background
Our current Terraform resource for managing bots is hand-rolled, doesn't follow the same conventions as our other resources, deletes and recreates the user and role whenever the bot is modified, and doesn't support importing bots.
This PR replaces it with a new resource generated from its protobuf definition by
protoc-gen-terraform.I went with
teleport_bot_v2because this seems to be the established convention for versioning Terraform resources, and we don't typically tie the version suffix to the Teleport resource type version (which you provide as an attribute on the resource itself).I wasn't sure whether to add the suffix to the data source for symmetry, or to omit it because there is no v1, so went for the latter.
The migration path for existing users would be roughly:
Using the new resource type will require upgrading the auth server first, because the generated Terraform code relies on the resource's revision changing to detect when writes have been propagated to the cache, which we previously weren't setting on bots.
changelog: Terraform: Add
teleport_bot_v2resource andteleport_botdatasource