Add tags or labels to all resources created with shared modules#9
Add tags or labels to all resources created with shared modules#9
Conversation
7d20313 to
b51d236
Compare
a5ebf9a to
e83dc71
Compare
e83dc71 to
c590759
Compare
| - `main_file` - Python file name (e.g., "main.py"), relative to `source_dir`. | ||
| - `schedule` - Cron expression (e.g., "0 9 * * 1-5") | ||
| - `description` - Function/job description | ||
| - `owner` - The owner/team responsible for this scheduled job |
There was a problem hiding this comment.
Nice! Do we want to use some consistent way of naming the team? Like should it be a github tag (@owner or #team), or the list of teams in ownership_data.json, or something else?
There was a problem hiding this comment.
Yeah, I should probably add a predefined list of teams here.
|
|
||
| # Common tags for all resources | ||
| locals { | ||
| common_tags = merge(var.tags, { |
There was a problem hiding this comment.
This seems misnamed -- I'd expect common_tags to just be the 3 common tags you list below, not that merged with var.tags. Should it be all_tags maybe?
Also, who wins in case of a merge conflict? I'm guessing that the ones below take precedence over the ones in var.tags. Is that the desired behavior?
There was a problem hiding this comment.
this means "common for all resources generated by this usage of this module". Does "all_tags" sound better to you?
Good call on the merge conflicts, I'll make sure your guess is correct and document it.
| ``` | ||
|
|
||
| ### Supported Resources | ||
| The following resources support tagging/labeling: |
There was a problem hiding this comment.
What happens if you try to add tags somewhere else? It seems like it's just silently ignored?
There was a problem hiding this comment.
If you add a field not supported in a terraform resource (in this case label or tag), it fails well before an apply, I think it's during the check stage.
Co-authored-by: Craig Silverstein <csilvers@gmail.com>
Summary:
Added comprehensive resource tagging support to the scheduled-job Terraform module with automatic tags and custom tag support.
Changes Made
scheduled-job Module
tagsvariable to allow custom taggingModule-Specific Tags
scheduled-job Module:
module= "scheduled-job"job_name= var.job_nameexecution_type= var.execution_typeOther Modules
Resource Support
Legend:
Example Usage
Benefits
Backward Compatibility
tagsvariable defaults to empty map{}Additional Improvements
job_imagevariable optional with proper validation for Cloud Run JobsIssue: INFRA-XXXX
Test plan:
Update culture-cron to use these updated modules, verify tags were created.