-
Notifications
You must be signed in to change notification settings - Fork 49
feat: add agentcore destroy command #100
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add agentcore destroy command #100
Conversation
deb99f2
to
f54c0a7
Compare
Signed-off-by: Syoitu Den <[email protected]>
endpoint_response = client.get_agent_runtime_endpoint(agent_id) | ||
endpoint_arn = endpoint_response.get("agentRuntimeEndpointArn") | ||
if endpoint_arn: | ||
# Note: There's no direct delete endpoint method in the current client |
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.
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.
Thanks for merging latest changes. Needs a couple of changes -
- Code build IAM role starting with prefix AmazonBedrockAgentCoreSDKCodeBuild* needs to be deleted if developers uses code-build.
- The delete endpoint needs to special case "DEFAULT" endpoint that can not be explicitly created/deleted.
…oy codebuild role
result: DestroyResult, | ||
dry_run: bool, | ||
) -> None: | ||
"""Remove all CodeBuild IAM roles with prefix AmazonBedrockAgentCoreSDKCodeBuild*""" |
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.
only delete the code build role associated with agent. You can read the config file similar to agent's execution role. The code build role is at "codebuild.execution_role" in the agent's config.
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.
Thanks! left a few comment on config file cleanup that is being left in an invalid state post destroy.
role_name = role_arn.split("/")[-1] | ||
|
||
if dry_run: | ||
result.resources_removed.append(f"DRY RUN: would remove CodeBuild IAM role: {role_name}") |
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.
Inconsistent with other dry logs. should be "CodeBuild IAM role (DRY RUN) "
try: | ||
# Clear the bedrock_agentcore deployment info but keep the agent config | ||
if agent_name in project_config.agents: | ||
agent_config = project_config.agents[agent_name] |
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.
The agent specific entry should be removed and not just the bedrock_agentcore. This causes the subsequent status/configure/launch calls to fail.
"""Remove agent configuration from the config file.""" | ||
try: | ||
# Clear the bedrock_agentcore deployment info but keep the agent config | ||
if agent_name in project_config.agents: |
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.
Default agent name needs to be cleaned up in the config. If there is only one agent and its being destroyed we can remove the config file. Else, we can set the default to next valid agent in the file.
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.
A couple of doc related comments.
README.md
Outdated
```bash | ||
# Deploy with the Starter Toolkit | ||
agentcore configure --entrypoint my_agent.py | ||
agentcore launch # Ready to run on Bedrock AgentCore | ||
agentcore invoke '{"prompt": "tell me a fact"}' | ||
agentcore destroy | ||
``` | ||
|
||
**What you get with the Starter Toolkit:** | ||
|
||
- ✅ **Keep your agent logic** - Works with any SDK-built agent | ||
- ✅ **Zero infrastructure management** - No servers, containers, or scaling concerns | ||
- ✅ **One-command deployment** - From local development to enterprise platform | ||
- ✅ **Production-ready hosting** - Reliable, scalable, compliant Bedrock AgentCore deployment | ||
|
||
## 🛠️ Deployment & Management Tools | ||
|
||
**Simple Configuration** | ||
|
||
```bash | ||
# Configure your agent for deployment | ||
agentcore configure --entrypoint my_agent.py --name my-production-agent | ||
|
||
# Check deployment status | ||
agentcore status | ||
|
||
# Invoke your deployed agent | ||
agentcore invoke '{"prompt": "Hello from Bedrock AgentCore!"}' | ||
``` | ||
|
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.
This has been moved to AgentCore Runtime Quick start and need not be present at top-level documentation. Please update bedrock-agentcore-starter-toolkit/user-guide/runtime/quickstart instead.
README.md
Outdated
## 📚 About Amazon Bedrock AgentCore | ||
|
||
Amazon Bedrock AgentCore enables you to deploy and operate highly effective agents securely, at scale using any framework and model. With AgentCore, developers can accelerate AI agents into production with enterprise-grade scale, reliability, and security. The platform provides: | ||
|
||
- **Composable Services**: Mix and match services to fit your needs | ||
- **Framework Flexibility**: Works with Strands, LangGraph, CrewAI, Strands, and more | ||
- **Any Model Support**: Not locked into specific models | ||
- **Enterprise Security**: Built-in identity, isolation, and access controls |
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.
Please sync content from https://github.com/aws/bedrock-agentcore-starter-toolkit. Ideally there should be no new change to this file for destroy.
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.
@Vivekbhadauria1
Thank you so much for your patience and guidance! I'm really grateful I could help you address the documentation feedback. Your
implementation of the destroy functionality is excellent work.
We're still working through the review process, but I appreciate you taking the time to collaborate on getting everything just right. It's
been a pleasure working with you on this contribution! 🙏
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.
Hey, The tests are failing - https://github.com/aws/bedrock-agentcore-starter-toolkit/actions/runs/17495999286/job/49711013016?pr=100. Please take a look.
The Test coverage gate is failing. Please take a look. |
Description
Brief description of changes
Type of Change
Testing
Checklist
Security Checklist
No hardcoded secrets or credentials
No new security warnings from bandit
Dependencies are from trusted sources
No sensitive data logged
Breaking Changes
N/A - This is an additive feature that doesn't modify existing functionality.
Additional Notes
New Command Usage