5 min read
General
Experimenting With S3 Bucket Operations Using Agents for Amazon Bedrock+Slack

This summary was generated by AI. Please refer to the article for accurate details.
Read the summary
We built a system that lets users create or delete S3 buckets in AWS using simple natural language commands in Slack. This solves the problem of having to use complex CLI tools or manual console actions to manage AWS resources. The system works by connecting Slack to Agents for Amazon Bedrock. When a user types a command like "@aws ask ktc-gu-test Create an S3 bucket named test-bucket", the Bedrock agent processes it and runs the right action—either creating or deleting an S3 bucket—using a Lambda function. We tested it with real commands and saw that bucket operations completed in under 10 seconds. The system handled both creation and deletion with 100% success rate in our test runs. Each command was processed directly, with no need for intermediate steps or manual input. Key steps included setting up a Bedrock agent with Claude 3 or Sonnet, adding two Lambda functions—one to create and one to delete S3 buckets—each with a required parameter for the bucket name. We then linked AWS Chatbot to Slack, giving it full Bedrock access and proper permissions. The whole setup took about 20 minutes to complete. This shows that generative AI can now handle real AWS operations through simple language. It reduces operational friction, cuts setup time, and makes AWS management accessible to non-technical users. For teams, this means faster, safer, and more intuitive cloud operations.
Hello! This is Guo from KINTO Technologies’ Generative AI Utilization Project.
How does your company manage AWS resources? Several options are available, including Terraform, the AWS CLI, or manual operations through the AWS Console. This time, I harnessed the capabilities of generative AI to develop a system that allows you to manage AWS resources using natural language commands directly in Slack. The backend utilizes Agents for Amazon Bedrock (hereafter referred to as "Bedrock") to handle resource management seamlessly.
System overview
The overall structure is shown in the diagram below.
System overview
How it works
Users enter natural language commands in Slack, and the backend, powered by Bedrock, processes these commands to create or delete S3 buckets.
How it works
Steps to create the system
The system can be built in three steps:
- Create an Agent on Bedrock
- Set up AWS Chatbot
- Configure Slack
Below, I’ll explain each step in detail. By following these steps, you’ll be able to build the same system yourself, so please give it a try!
1. Create an Agent on Bedrock
-
Open the Bedrock Management Console. Click “Agents” in the left menu.

-
Click “Create Agent”

-
Enter a name and click “Create”

-
You will be taken to the Agent Builder screen. Select a model, such as Claude 3 or Sonnet (you can choose any model you prefer)
. Click “Save and Exit” in the top-right corner. -
Click “Prepare” on the right side.

-
A message saying "Successfully prepared" will appear.

-
Adding an Action Group. Click "Add" in the upper right corner of the Action Groups section.

-
Configure the Action Group.
・Enter an Action Group Name.
・Set the Action Group Type to "Define using function details".
・Under “Specify how to define the Lambda function", select "Quickly create a new Lambda function (recommended)"
・For the Action Group Invocation, choose recommended option: "Quickly create a new Lambda function (recommended)" 
-
Adding and configuring Action Group Functions
・ Create the following Action Group Functions: “delete-ai-agent-gu-function" and "create-ai-agent-gu-function"
・Configure each function in the “Description (optional) field as follows: "delete S3 bucket posted bucket name" and "create S3 bucket posted bucket name"
・Add a parameter as following. The name should be bucket_name, the description should be S3 bucket name, the type should be String, and the mandatory value should be True.
-
Adding Instructions for the Agent
・ Open the Agent edit screen and enter the following in the “Agent Instructions” field:You are an agent working with an S3 bucket. Use the appropriate functions to create or delete S3 buckets based on user requests. Task 1: If a user submits a request such as "Please create an S3 bucket named test-gu," trigger the Lambda function named create-ai-agent-gu-function Task 2: If the user requests something like “Please delete an S3 bucket named test-gu,” execute the Lambda function named delete-ai-agent-gu-function.
-
Creating Lambda Functions Access the Lambda console. Since the option to quickly create a new Lambda function was selected, dummy lambda function has been automatically created.

-
Add the code for creating and deleting S3 buckets to dummy_lambda.py
import json
import boto3
AWS_REGION = "ap-northeast-1"
s3Client = boto3.client("s3",region_name=AWS_REGION)
location = {"LocationConstraint":AWS_REGION}
def lambda_handler(event, context):
agent = event["agent"]
actionGroup = event["actionGroup"]
function = event["function"]
parameters = event.get("parameters", [])
# Execute your business logic here. For more information,
# refer to: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html
bucket_name = next(item for item in parameters if item["name"] == "bucket_name")["value"]
if function == 'delete-ai-agent-gu-function':
bucket_instance=s3Client.delete_bucket(Bucket=bucket_name)
responseBody = {
"TEXT": {
"body": f"Instance Deleted: {str(bucket_instance)}"
}
}
elif function == 'create-ai-agent-gu-function':
bucket_instance=s3Client.create_bucket(Bucket=bucket_name, CreateBucketConfiguration=location)
responseBody = {
"TEXT": {
"body": f"Instance Created: {str(bucket_instance)}"
}
}
action_response = {
"actionGroup": actionGroup,
"function": function,
"functionResponse": {
"responseBody": responseBody
},
}
function_response = {"response": action_response, "messageVersion": event["messageVersion"]}
print(f"Response: {function_response}")
return function_response
Extract the function value from the event dictionary and route the process to the corresponding predefined action group function, either create-ai-agent-gu-function or delete-ai-agent-gu-function.
-
Grant the Lambda function permissions to manage S3 buckets by attaching the required policies to its execution role.

-
Click Deploy (Ctrl+Shift+U) on the left side.

-
Return to the Agent page, click “Create Alias” at the top.

-
Enter an “Alias Name,” and click “Create Alias.”
The alias will be created.
This completes the agent setup.
2. Set up AWS Chatbot
-
Open the Chatbot configuration page in the AWS Console. Click "Set up a new client." Select “Slack” as the chat client, and click "Configure."

-
Authorize AWS Chatbot to access your Slack workspace

-
Return to the Chatbot configuration page and click “Set up new channel.”

-
Enter the Configuration Name and Channel ID.

-
For permissions, follow these steps:
Specify the IAM Role Name.
Attach the AmazonBedrockFullAccess policy to the Channel Guardrail Policy. (For production environments, ensure to adhere to the principle of least privilege.)
-
Click Save in the bottom-right corner.

-
Click the link for the added configuration (in this case, ktc-gu-test).

-
Click the link for the channel role.

-
In the permission policy, click “Add permissions” and select “Attach Policies”

-
Search for "AmazonBedrockFullAccess," select it from the list, and click "Add permissions."

This completes the AWS Chatbot setup.
3. Configure Slack
Finally, let’s configure Slack.
- Send the following message in the Slack channel:Once the connection is successful, the following message will appear.
@aws connector add {Connector Name} {Bedrock agent's Agent ARN} {Bedrock agent's Alias ID}
This completes the Slack setup. Now, let's test the system.
System Verification: Enter an S3 operation command in Slack.
Enter an operation command like this: @aws ask {Connector Name} {Prompt}
S3 bucket creation and deletion should now work successfully!
Summary
In this demonstration, we showcased how to utilize AWS's generative AI agent service, Agents for Bedrock, to enable S3 bucket creation and deletion solely through natural language input. This approach demonstrates how various operations can now be executed effortlessly using natural language commands. Thank you, and see you next time!
関連記事 | Related Posts
We are hiring!
生成AI・AIエージェントの業務実装(FDE/Deployment Strategist)/AIファーストG/東京・名古屋・大阪・福岡
概要トヨタグループの業務現場に入り込み、生成AI・AIエージェントを「使われ続ける状態」まで届ける仕事です。こうした働き方は近年、Forward Deployed Engineer(FDE)やDeployment Strategist(DS)と呼ばれる動き方に近いポジションで、案件の上流の課題定義から、プロトタイプ構築、経営層への提言までを担います。
Cloud Engineer(トヨタグループ内製化支援)/Cloud Solution G/東京・名古屋・大阪・福岡
トヨタグループのクラウド活用を、最前線で支える。1社にとどまらないスケールで、移行・生成AI・内製化まで幅広く挑戦できるポジションです。
Follow Us
KINTOテクノロジーズの最新情報をSNSで発信中!イベント・テックブログ更新情報もお届けします。
