serverless / serverless/serverless

Support tagging per resource type

Open
#11,722 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs feedback
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

Is there an existing issue for this?
  • I have searched existing issues, it hasn't been reported yet
Use case description

I have a large number of lambda functions in a few stacks, and a requirement to add tags to every resource being deployed. Right now, we're using the deprecated serverless-plugin-tag-cloud-watch-logs but are looking to replace that, preferably with native functionality as the approach used in that plugin causes throttling for us in some cases.

Proposed solution (optional)
  • In the existing provider.logs object, add an attribute called tags for global tags added to all serverless-controlled log groups (for lambda functions, httpApi, apiGateway, and websocket).
  • Extend the provider.log settings for each of httpApi, apiGateway, and websocket to allow for independent tags in a property called tags
  • Add either a property called logGroupTags in the function or logs.tags (the latter option for consistency with the provider section) to allow for specific tagging for the log group for a specific function
  • Add a boolean flag at the provider level called something like applyProviderTagsToLogGroups to allow for applying provider.tags to all log groups; this would default to false as it would be a breaking change

The hierarchy would be provider.tags (if enabled) -> provider.log.tags -> provider.logs.<event>.tags/function[].logs.tags

I understand that there's been a lot of back and forth on this over the years, but I'm cautiously optimistic that this approach solves the long-standing concerns that people have around tagging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the provider.logs, provider.log, and function logging settings are represented and applied to deployed log groups. Compare the proposed tag hierarchy and opt-in provider.tags behavior against the existing configuration model. Done means the supported resource-specific and global tag options are defined, documented, and covered for the listed log-group types.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.