Skip to content

Add plugin for IaC alternatives to tctl resources - #688

Open
ptgott wants to merge 2 commits into
mainfrom
paul.gottschling/2026-06-03-remark-resource
Open

ptgott wants to merge 2 commits into
mainfrom
paul.gottschling/2026-06-03-remark-resource

Conversation

@ptgott

@ptgott ptgott commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

The plugin transforms any code fence with the teleport-resource label into a Tabs component with separate tabs for tctl, the Teleport operator, and the Teleport Terraform provider. It shells out to the script added in gravitational/teleport#67528 to perform the conversion.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/2026-06-03-remark-resource 40e93d8 39 ✅SUCCEED paul-gottschling-2026-06-03-remark-resource 2026-07-24 17:12:01

@ptgott

ptgott commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Once I fix the type issues and get the preview to work, a proof of concept will be visible at:

https://paul-gottschling-2026-06-03-remark-resource.d2mrezcly5gcqm.amplifyapp.com/docs/zero-trust-access/rbac-get-started/role-demo/

@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 47a4878 to 175805e Compare June 8, 2026 14:40
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 175805e to 435dff4 Compare June 8, 2026 15:04
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 435dff4 to 6439eec Compare June 15, 2026 17:27
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 6439eec to cfa996b Compare June 16, 2026 13:28
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from cfa996b to 2fc83ed Compare June 16, 2026 19:03
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 2fc83ed to 146d0aa Compare June 16, 2026 19:09
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 146d0aa to 495fca9 Compare June 16, 2026 19:15
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 495fca9 to 247f7f1 Compare June 16, 2026 19:25
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 247f7f1 to 11af048 Compare June 17, 2026 18:58
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 11af048 to 2f0f4fa Compare June 17, 2026 19:07
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 2f0f4fa to 4a681ba Compare June 17, 2026 19:36
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 4a681ba to 96f7efa Compare June 17, 2026 20:36
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 96f7efa to b4971ed Compare June 17, 2026 21:15
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from b4971ed to 565e4db Compare June 17, 2026 21:45
@ptgott
ptgott marked this pull request as ready for review June 18, 2026 20:08
@ptgott
ptgott requested a review from taraspos June 18, 2026 20:08
Comment thread scripts/download-content-archive.sh
@ptgott
ptgott marked this pull request as draft June 18, 2026 20:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 565e4dbd5f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/prepare-files.mts Outdated
Comment thread config.json Outdated
Comment thread scripts/prepare-files.mts
process.env.GOPATH && isAbsolute(process.env.GOPATH)
? process.env.GOPATH
: join(process.cwd(), process.env.GOPATH);
const proc = spawn(goBinary, ["build", "."], {

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.

You should be able to use just go run ./tooling/cmd/convert-resource/, which will build the binary automatically in the background.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We'd need to run go run twice for every teleport-resource code snippet, since the plugin shells out to the convert-resource script once for HCL and once for Kubernetes. As far as I understand it, this would add some overhead.

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.

go should be smart about it and re-use cached binary if source code didn't change.

So it might be simpler to use go run to simplify the code, but this is also ok with me :)

Comment thread scripts/prepare-files.mts Outdated
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from 565e4db to 84f7c98 Compare June 30, 2026 15:14
@ptgott
ptgott temporarily deployed to docs-amplify July 2, 2026 09:40 — with GitHub Actions Inactive
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from e37bed7 to bbf8d9a Compare July 24, 2026 15:57
ptgott added 2 commits July 24, 2026 12:59
The plugin transforms any code fence with the `teleport-resource` label
into a `Tabs` component with separate tabs for `tctl`, the Teleport
operator, and the Teleport Terraform provider. It shells out to the
script added in gravitational/teleport#67528 to perform the conversion.
These are absolute paths in the Amplify build config now, so there is no
need to reassign them in `prepare-files.mts`.
@ptgott
ptgott force-pushed the paul.gottschling/2026-06-03-remark-resource branch from bbf8d9a to 40e93d8 Compare July 24, 2026 16:59
@ptgott

ptgott commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@taraspos Just checking if there's anything left to do here. I think we'll need to merge this before gravitational/teleport#67528 since that PR introduced teleport-resource code snippets that will have an unknown label otherwise.

@ptgott
ptgott marked this pull request as ready for review July 30, 2026 19:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40e93d8026

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

# Tooling that accesses the Teleport source. The build.assets/tooling module
# relies on api and lib in the root gravitational/teleport module.
'*/build.assets/tooling'
'*/*.go'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep tar wildcard from matching every Go file

In the GNU tar path used by the CI/archive build, this pattern is much broader than it looks: with --wildcards, * matches / unless --no-wildcards-match-slash is used (confirmed from tar --help and a local tar extraction check), so */*.go extracts every .go file anywhere in the Teleport archive rather than only the root Go files needed with api and lib. On the Linux archive build this can pull a large, unintended slice of the source tree into each content version, inflating build time and disk/cache usage; constrain the match to root files or add the no-match-slash behavior around these root-only patterns.

Useful? React with 👍 / 👎.

@taraspos taraspos left a comment

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.

I don't have too much context regarding the work on teleport repo side. But if you're ready to push it forward that's fine with me.

Comment thread config.json
{
"name": "18.x",
"branch": "branch/v18",
"branch": "paul.gottschling/2026-07-24-resource-converter",

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.

Reminder to revert this back before merging:

Suggested change
"branch": "paul.gottschling/2026-07-24-resource-converter",
"branch": "branch/v18",

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