워크로드 ID 생성 및 관리
워크플로 및 통합 요구 사항에 따라 AWS CLI 및 AgentCore SDK를 비롯한 여러 방법을 사용하여 에이전트 자격 증명을 생성할 수 있습니다. AgentCore Identity는 자동화 및 스크립팅을 위한 명령줄 도구와 기존 시스템과의 통합을 위한 프로그래밍 방식 APIs를 포함하여 자격 증명 생성을 위한 여러 인터페이스를 제공합니다. 각 생성 방법은 다양한 사용 사례 및 사용자 기본 설정에 적합한 인터페이스를 제공하면서 모든 범위의 자격 증명 속성을 지원합니다.
AWS CLI를 사용하여 자격 증명 관리
AWS CLI는 에이전트 자격 증명을 생성하고 삭제하는 간단한 방법을 제공합니다.
자격 증명 생성
다음 명령은 my-agent라는 워크로드 자격 증명을 생성합니다.
aws bedrock-agentcore-control create-workload-identity \ --name "my-agent"
모든 자격 증명 나열
다음 명령은 계정의 모든 워크로드 자격 증명을 나열합니다.
aws bedrock-agentcore-control list-workload-identities
자격 증명 삭제
다음 명령은 my-agent라는 워크로드 자격 증명을 삭제합니다.
aws bedrock-agentcore-control delete-workload-identity \ --name "my-agent"
AgentCore SDK를 사용하여 자격 증명 생성
AgentCore SDK는 Python에서 워크로드 ID를 생성할 수 있도록 지원합니다.
Python 예제
다음 Python 코드는 AgentCore SDK를 사용하여 워크로드 자격 증명을 생성합니다.
from bedrock_agentcore.services.identity import IdentityClient # Initialize the client identity_client = IdentityClient("us-east-1") # Create a new workload identity for agent response = identity_client.create_workload_identity(name='my-python-agent') agentArn = response['workloadIdentityArn'] print(f"Created agent identity with ARN: {agentArn}")