Skip to content

Add IaC label and usertasks to integration stats#62518

Merged
avatus merged 1 commit intomasterfrom
avatus/iaclabel
Jan 6, 2026
Merged

Add IaC label and usertasks to integration stats#62518
avatus merged 1 commit intomasterfrom
avatus/iaclabel

Conversation

@avatus
Copy link
Contributor

@avatus avatus commented Dec 29, 2025

Two small changes combined into one. This supports #60819 and #60818 (is required by #62145)

This adds a new label to mark when a resource has been created by IaC of some form. We originally wanted to add this to the Origin label, but

if m.Origin() != "" {
if !slices.Contains(common.OriginValues, m.Origin()) {
return trace.BadParameter("invalid origin value %q, must be one of %v", m.Origin(), common.OriginValues)
}
}
makes any new labels incompatible with older clusters. We will form a plan to get this check out eventually, but for now, we can create a new label (and migrate later easily, without breaking clusters).

Also, adds the user tasks to the stats endpoint response, in order to support the overview page.

@avatus avatus added the no-changelog Indicates that a PR does not require a changelog entry label Dec 29, 2025
@github-actions github-actions bot requested review from atburke and eriktate December 29, 2025 17:39
ret.Integration = uiIg

if req.integration != nil {
if val, ok := req.integration.GetLabel(types.CreatedByIaCLabel); ok && val == "terraform" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Extract "terraform" into named constant.

SubKind: ig.GetSubKind(),
}

if val, ok := ig.GetLabel(types.CreatedByIaCLabel); ok && val == "terraform" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto regarding named constant.

ADLabel = TeleportNamespace + "/ad"

// CreatedByIaCLabel is a resource metadata label name used to identify if resource was created by IaC tooling.
CreatedByIaCLabel = TeleportNamespace + "/iac"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this label could be more explicit
Maybe /created-by-iac-tool?

Or maybe we could even add a /managed-by-iac-tool
This way, we could enforce only the iac tool can perform changes to the resource (unless we pass in a --force flag or equivalent in the API).

Copy link
Contributor

Choose a reason for hiding this comment

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

/iac-tool might be another option. I'd be weary of restricting operations like this, but a warning would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i went with /iac-tool

}
ret.UserTasks = append(ret.UserTasks, ui.MakeUserTasks(userTasks)...)

ret.UnresolvedUserTasks += len(userTasks)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do a single len call after the loop

@avatus avatus added this pull request to the merge queue Jan 6, 2026
Merged via the queue into master with commit d4d5d13 Jan 6, 2026
43 checks passed
@avatus avatus deleted the avatus/iaclabel branch January 6, 2026 19:56
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2026
* Add IaC label and usertasks to integration stats (#62518)

* Add IaC Integration Overview Page (#62533)

* Add Activity tab to IaC Integration Overview page (#62534)

* Use new integrations page for IaC integrations (#63033)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants