Repository navigation
feat: add coder_task data source - #460
Merged
Merged
Conversation
johnstcn
commented
Nov 4, 2025
Comment on lines
+134
to
+137
| name string | ||
| cronExpr string | ||
| expectWarnings bool | ||
| expectErrors bool |
mafredri
approved these changes
Nov 4, 2025
mafredri
left a comment
Member
There was a problem hiding this comment.
Small suggestions but otherwise 👍🏻
| "id": { | ||
| Type: schema.TypeString, | ||
| Computed: true, | ||
| Description: "The UUID of the task, if executing in a Coder Task context. Empty in a Coder Workspace context.", |
Member
There was a problem hiding this comment.
Should we set optional true, is that possible for computed?
Member
Author
There was a problem hiding this comment.
I don't think we should according to the documentation for Computed:
If Required and Optional are both false, the attribute will be considered "read only" for the practitioner, with only the provider able to set its value.
Member
There was a problem hiding this comment.
Ah TIL, I had assumed computed already meant read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Terraform will tolerate a certain amount of self-reference, but this changes when using
count.For example, the below is accepted
Whereas this outputs a cycle error:
After some cursory searching, I didn't find much more information on this apart from this post.
Adding a data source is not too big a deal as the required environment variables are already present.
With this additional data source, the above example becomes:
NB: I explicitly named this
coder_taskto sidestep this check in Coder. I'm open to alternative names, but it can't becoder_ai_task.See coder/coder#20416 for what this looks like in practice.