Use DeleteAgentAlias with an AWS SDK or CLI - Amazon Bedrock

Use DeleteAgentAlias with an AWS SDK or CLI

The following code example shows how to use DeleteAgentAlias.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:

Python
SDK for Python (Boto3)
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

Delete an agent alias.

def delete_agent_alias(self, agent_id, agent_alias_id): """ Deletes an alias of an Amazon Bedrock agent. :param agent_id: The unique identifier of the agent that the alias belongs to. :param agent_alias_id: The unique identifier of the alias to delete. :return: The response from Amazon Bedrock Agents if successful, otherwise raises an exception. """ try: response = self.client.delete_agent_alias( agentId=agent_id, agentAliasId=agent_alias_id ) except ClientError as e: logger.error(f"Couldn't delete agent alias. {e}") raise else: return response
  • For API details, see DeleteAgentAlias in AWS SDK for Python (Boto3) API Reference.

For a complete list of AWS SDK developer guides and code examples, see Using Amazon Bedrock with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.