Skip to content

feat: add resource tagging support#5

Open
tejaskash wants to merge 1 commit intomainfrom
feat/resource-tagging
Open

feat: add resource tagging support#5
tejaskash wants to merge 1 commit intomainfrom
feat/resource-tagging

Conversation

@tejaskash
Copy link
Collaborator

Summary

@github-actions github-actions bot added the size/l PR size: L label Mar 20, 2026
Add `agentcore tag` command for managing AWS resource tags on agents,
memories, and gateways. Supports project-level default tags (inherited
by all resources) and per-resource tag overrides.

- Add TagsSchema to project, agent, memory, and gateway schemas
- Add `tag list|add|remove|set-defaults|remove-defaults` subcommands
- Auto-tag new projects with `agentcore:created-by` and `agentcore:project-name`
- Add unit tests for schema validation and tag actions
- Add integration tests for tag command round-trip
@tejaskash tejaskash force-pushed the feat/resource-tagging branch from 10a7dcb to a5fe86a Compare March 20, 2026 14:12
@github-actions github-actions bot added size/l PR size: L and removed size/l PR size: L labels Mar 20, 2026
@github-actions
Copy link

Package Tarball

aws-agentcore-0.3.0-preview.6.0.tgz

How to install

npm install https://github.com/jesseturner21/agentcore-cli/releases/download/pr-5-tarball/aws-agentcore-0.3.0-preview.6.0.tgz

@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 41.79% 5054 / 12093
🔵 Statements 41.41% 5354 / 12928
🔵 Functions 40.57% 921 / 2270
🔵 Branches 43.12% 3271 / 7585
Generated in workflow #27 for commit a5fe86a by the Vitest Coverage Report Action

return {
name: projectName,
version: 1,
tags: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see this duplicated in a few places, does it make sense to centralize it to avoid drift?

@@ -0,0 +1,6 @@
import type { TaggableResourceType } from './types';

export const TAGGABLE_RESOURCE_TYPES: readonly TaggableResourceType[] = ['agent', 'memory', 'gateway'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this duplicated in src/cli/commands/tag/types.ts?


export const TAGGABLE_RESOURCE_TYPES: readonly TaggableResourceType[] = ['agent', 'memory', 'gateway'];

export const NON_TAGGABLE_NOTE =
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this used, is there a future plan for it?

return { projectDefaults, resources };
}

export async function addTag(resourceRefStr: string, key: string, value: string): Promise<{ success: boolean }> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we apply the schema from src/schema/schemas/primitives/tags.ts here?

@@ -0,0 +1,6 @@
import { z } from 'zod';

export const TagKeySchema = z.string().min(1).max(128);
Copy link
Collaborator

Choose a reason for hiding this comment

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

are there any reserved tags or limits? Ex. ECS doesn't allow more than 50 or aws prefix. Do we know if there are similar rules for AgentCore?


### tag

Manage AWS resource tags on your AgentCore project. Tags are applied to deployed CloudFormation resources (agents,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where exactly do we propagate the tags to cloudformation? Is there a dependent CR to cdk we need to merge or is that already supported automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants