Use DeleteAgentAlias with an AWS SDK - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DeleteAgentAlias with an AWS SDK

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.