- Notifications
You must be signed in to change notification settings - Fork24
feat: add coder_task data source#460
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| namestring | ||
| cronExprstring | ||
| expectWarningsbool | ||
| expectErrorsbool |
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.
drive-bygo fmt
mafredri left a comment
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.
Small suggestions but otherwise 👍🏻
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| "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.", |
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.
Should we set optional true, is that possible for computed?
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 don't think we should according to the documentation forComputed:
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.
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.
Ah TIL, I had assumed computed already meant read-only.
Uh oh!
There was an error while loading.Please reload this page.
5fe8d85 intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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 fromthis 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 sidestepthis check in Coder. I'm open to alternative names, but it can't becoder_ai_task.Seecoder/coder#20416 for what this looks like in practice.