View a markdown version of this page

자산 관리 - AWS DevOps 에이전트

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

자산 관리

AWS DevOps Agent는 에이전트 스페이스의 구성 및 참조 자료를 자산, 에이전트가 알고 있는 내용과 동작 방식을 형성하는 고객 관리형 리소스로 저장합니다. Skills, AGENTS.md 파일 및 첨부 파일은 모두 자산이며 Asset API를 통해 프로그래밍 방식으로 생성, 읽기, 업데이트 및 삭제할 수 있습니다.

what AWS DevOps 에이전트가 알고 있는 내용과 작동 방식을 구성하려면 에이전트 스페이스에서 자산을 관리합니다. 이 주제에서는 자산 모델, IAM 권한 및 각 자산 유형에 필요한 메타데이터를 다룹니다. AWS CLI, Python용 AWS SDK(Boto3) 또는 AWS CloudFormation을 사용하여 end-to-end 관리합니다. 기술 자체의 개념적 개요는 섹션을 참조하세요DevOps 에이전트 기술. 직접 생성하지 않은 에이전트 생성 지식은 섹션을 참조하세요학습한 기술.

자산 API를 사용해야 하는 경우

운영자 웹 앱은 단일 스킬을 작성하거나 AGENTS.md 파일을 대화형으로 업로드하는 가장 빠른 방법입니다. Asset API는 프로그래밍 방식으로 동일한 작업을 노출하므로 스크립트와 자동화가 웹 앱을 거치지 않고도 자산을 관리할 수 있습니다. Asset API를 직접 호출하는 일반적인 이유는 다음과 같습니다.

  • 웹 앱 대신 스크립트, 터미널 또는 노트북에서 자산을 작성하거나 업데이트합니다.

  • 스타터 스킬 세트 또는 AGENTS.md 파일을 새 에이전트 스페이스에 대량 로드합니다.

  • 자산의 콘텐츠를 읽어 백업하거나 버전을 비교합니다.

Asset API의 모든 작업은 AWS CLI를 통해 devops-agent 클라이언트로aws devops-agent <operation>, AWS SDKs를 통해 노출됩니다.

자산 API 작업

자산 API는 다음 작업을 노출합니다. 각 행에는 작업을 호출하기 위해 부여해야 하는 IAM 작업과 작업이 적용되는 리소스가 나열됩니다. 를 제외한 모든 작업은 aidevops: 네임스페이스에 있으며 양식의 에이전트 스페이스 리소스에 ListAssetTypes적용됩니다arn:aws:aidevops:<region>:<account-id>:agentspace/<agentSpaceId>. aidevops: 권한에 대한 더 광범위한 배경 정보는 섹션을 참조하세요DevOps 에이전트 IAM 권한.

연산 설명 IAM 작업 Resource
ListAssetTypes AWS DevOps Agent에서 지원하는 자산 유형을 나열합니다. aidevops:ListAssetTypes *
CreateAsset 에이전트 스페이스(스킬, AGENTS.md, 연결, 사용자 지정 에이전트, 메모리 스토어, 메모리, 테스트 프로필 또는 피드백)에서 새 자산을 생성합니다. aidevops:CreateAsset 에이전트 공간
GetAsset 자산의 메타데이터 및 버전 정보를 검색합니다. aidevops:GetAsset 에이전트 공간
UpdateAsset 기존 자산의 메타데이터 또는 콘텐츠를 업데이트합니다. aidevops:UpdateAsset 에이전트 공간
DeleteAsset 에이전트 스페이스에서 자산과 모든 파일을 삭제합니다. aidevops:DeleteAsset 에이전트 공간
ListAssets 자산 유형별 선택적 필터링을 사용하여 에이전트 스페이스의 자산을 나열합니다. aidevops:ListAssets 에이전트 공간
ListAssetVersions 자산의 기록 버전을 나열합니다. aidevops:ListAssetVersions 에이전트 공간
GetAssetContent 자산의 전체 콘텐츠를 zip 번들로 다운로드합니다. aidevops:GetAssetContent 에이전트 공간
CreateAssetFile 기존 자산에 새 파일을 추가합니다. aidevops:CreateAssetFile 에이전트 공간
GetAssetFile 경로별로 자산에서 단일 파일을 검색합니다. aidevops:GetAssetFile 에이전트 공간
UpdateAssetFile 자산에 있는 기존 파일의 콘텐츠 또는 메타데이터를 바꿉니다. aidevops:UpdateAssetFile 에이전트 공간
DeleteAssetFile 자산에서 단일 파일을 제거합니다. aidevops:DeleteAssetFile 에이전트 공간
ListAssetFiles 자산 내의 파일을 나열합니다. aidevops:ListAssetFiles 에이전트 공간

예제 IAM 정책

다음 정책은 단일 에이전트 스페이스의 자산에 대한 전체 관리 액세스 권한을 부여합니다.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "aidevops:CreateAsset", "aidevops:GetAsset", "aidevops:UpdateAsset", "aidevops:DeleteAsset", "aidevops:ListAssets", "aidevops:ListAssetVersions", "aidevops:GetAssetContent", "aidevops:CreateAssetFile", "aidevops:GetAssetFile", "aidevops:UpdateAssetFile", "aidevops:DeleteAssetFile", "aidevops:ListAssetFiles" ], "Resource": "arn:aws:aidevops:us-east-1:111122223333:agentspace/8f6187a7-0388-4926-8217-3a0fe32f757c" }, { "Effect": "Allow", "Action": "aidevops:ListAssetTypes", "Resource": "*" } ] }

다음 정책은 단일 에이전트 스페이스의 자산에 대한 읽기 전용 액세스 권한을 부여합니다.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "aidevops:GetAsset", "aidevops:ListAssets", "aidevops:ListAssetVersions", "aidevops:GetAssetContent", "aidevops:GetAssetFile", "aidevops:ListAssetFiles" ], "Resource": "arn:aws:aidevops:us-east-1:111122223333:agentspace/8f6187a7-0388-4926-8217-3a0fe32f757c" }, { "Effect": "Allow", "Action": "aidevops:ListAssetTypes", "Resource": "*" } ] }

자산 유형

모든 자산에는 어떤 종류의 리소스인지 식별하는 assetType 문자열이 있습니다. 자산 API를 통해 , skill, , , agents_md, attachmentmemory_store, test_profile, custom_agentmemory의 8가지 자산 유형을 생성할 수 있습니다feedback. 다음 섹션에서는 각 유형을 설명합니다. 를 호출ListAssetTypes하여 런타임 시 유형 식별자를 검색할 수도 있습니다.

각 자산에는 리소스를 설명하는 자유 형식 metadata JSON 객체가 있습니다. 내부의 키는 snake_case(예: , agent_typesskill_type)를 metadata 사용합니다. 요청 본문metadata의 최상위 수준에서 외부의 키는 camelCase(예: , agentSpaceId, assetTypeclientToken)를 사용합니다. 필수 및 선택적 metadata 키는 다음 섹션에 설명된 대로 자산 유형에 따라 달라집니다.

UpdateAsset 또는 UpdateAssetFile를 호출하면 서비스는에 PATCH 의미 체계를 적용합니다metadata. 포함시킨 키는 교체되고 생략한 키는 저장된 값을 유지합니다. 자산이 생성된 assetType 후에는 자산을 변경할 수 없습니다.

스킬

skill 자산은 관련될 때 에이전트가 로드하는 지침과 참조 자료를 패키징합니다. 간단한 스킬은 단일 SKILL.md 파일이고, 복잡한 스킬은 SKILL.md 파일과 선택적 references/ 또는 assets/ 디렉터리가 포함된 zip 번들입니다.

필수 metadata 속성:

  • name(문자열) - 스킬의 고유 식별자입니다. 소문자, 숫자 및 하이픈만 해당, 1~64자. 하이픈으로 시작하거나 끝나지 않아야 합니다. 단순 기술에만 필요합니다. zip 업로드의 경우 SKILL.md 프런트미터name에서 읽은 서비스 및 여기에 제공된 모든 값은 무시됩니다.

  • 설명(문자열) - 에이전트가 스킬을 사용해야 하는 시기에 대한 1~1024자의 설명입니다. 단순 기술에만 필요합니다. zip 업로드의 경우 SKILL.md frontmatterdescription에서 읽은 서비스 및 여기에 제공된 모든 값은 무시됩니다.

  • agent_types(문자열 배열) -이 스킬이 적용되는 하나 이상의 에이전트 유형입니다. ["GENERIC"]를 사용하여 모든 에이전트 유형에서 스킬을 사용할 수 있도록 합니다. 다른 값에는 CHAT, INCIDENT_TRIAGE, INCIDENT_RCA, INCIDENT_MITIGATION, PREVENTION, 및 RELEASE_READINESS_REVIEW가 포함됩니다RELEASE_TESTING. GENERIC 값은 다른 값과 결합할 수 없습니다.

선택적 metadata 속성:

  • skill_type(문자열) - 기본값은 입니다USER. 자산 API는 고객이 생성한 스킬만 허용하므로 허용되는 유일한 값은 입니다USER. 서비스는 에이전트 자체에서 생성된 스킬용으로 LEARNED예약된 skill_type로 설정된 요청을 거부합니다.

  • status(문자열) - 스킬의 활성화 상태입니다. 허용되는 값은 ACTIVE 및 입니다INACTIVE(대문자만 해당). 기본값은 ACTIVE입니다. 비활성 스킬은 에이전트 스페이스에 남아 있지만 조사 또는 채팅 중에 에이전트가 로드하지 않습니다. 스킬을 삭제하지 않고 비활성화하거나 다시 활성화metadata.status하려면와 UpdateAsset 함께를 사용합니다. 스킬은 활성화를 지원하는 유일한 자산 유형이며 다른 모든 자산 유형에서는 status 필드가 무시됩니다. 작업 예제는 스킬 활성화 및 비활성화를 참조하세요.

  • enable_tools(문자열 배열) - 에이전트가이 스킬을 로드할 때 호출할 수 있는 도구 식별자 목록입니다.

예제 metadata:

{ "name": "rds-performance-investigation", "description": "Investigation procedures for RDS performance issues including connection exhaustion, slow queries, replication lag, and storage capacity. Use this skill when investigating database latency, connection errors, or read/write performance degradation.", "agent_types": ["GENERIC"] }

제한: Zip 업로드는 6MB를 초과해서는 안 됩니다. 에이전트 공간은 최대 200개의 사용자 생성 스킬을 포함할 수 있습니다.

에이전트_md

agents_md 자산은 특정 에이전트 유형에 대한 대기 에이전트 지침이 포함된 마크다운 파일입니다. 에이전트는 모든 작업이 시작될 때 일치하는 AGENTS.md 로드합니다. 에이전트 지침에 대한 자세한 내용은 섹션을 참조하세요에이전트 지침.

필수 metadata 속성:

  • agent_type(문자열) - AGENTS.md 파일이 적용되는 에이전트 유형입니다. 유효한 값은 GENERIC, CHAT, INCIDENT_TRIAGE, INCIDENT_RCA, INCIDENT_MITIGATION, PREVENTION, 및 RELEASE_READINESS_REVIEW입니다RELEASE_TESTING.

예제 metadata:

{ "agent_type": "INCIDENT_TRIAGE" }

제한: 각 에이전트 공간은 당 최대 1개의 AGENTS.md 포함할 수 있습니다agent_type. 파일 콘텐츠는 마크다운(text/markdown)이어야 하며 25KB를 초과해서는 안 됩니다.

연결

attachment 자산은 예를 들어 아키텍처 다이어그램, 실행서 PDF 또는 샘플 로그 파일과 같이 에이전트가 조사 중에 참조할 수 있는 바이너리 또는 텍스트 파일을 저장합니다.

필수 metadata 속성:

  • 파일 이름(문자열) - 기본 이름 및 확장명(예: )을 포함한 원래 파일 이름입니다topology.png.

  • extension(문자열) - 선행 점이 없는 파일 확장명입니다(예: , pngpdf, csv).

  • size(숫자) - 바이트 단위의 파일 크기입니다.

예제 metadata:

{ "filename": "topology.png", "extension": "png", "size": 184320 }

제한: 에이전트 스페이스에 있는 모든 연결의 총 크기는 10GB를 초과할 수 없습니다.

사용자 지정_에이전트

custom_agent 자산은 선별된 도구 및 기술을 사용하여 특수 에이전트 구성을 정의합니다. 사용자 지정 에이전트를 사용하여 에이전트의 범위를 특정 워크플로 또는 기능 세트로 지정합니다.

필수 metadata 속성:

  • name(문자열) - 사용자 지정 에이전트의 고유 식별자입니다. 소문자, 숫자 및 하이픈만 해당, 1~64자. 하이픈으로 시작하거나 끝나지 않아야 합니다.

선택적 metadata 속성:

  • 도구(문자열 배열) - 사용자 지정 에이전트가 사용할 수 있는 도구 식별자입니다. 생략할 경우 기본값은 빈 목록입니다.

  • 스킬(문자열 배열) - 사용자 지정 에이전트가 로드하는 스킬 식별자입니다. 생략할 경우 기본값은 빈 목록입니다.

예제 metadata:

{ "name": "rds-firefighter", "tools": ["cloudwatch:GetMetricData", "rds:DescribeDBInstances"], "skills": ["rds-performance-investigation"] }

memory_store

memory_store 자산은 관련 메모리 파일을 그룹화하는 컨테이너입니다. 에이전트는 저장소의 이름과 설명을 읽고 저장소를 열고 내부에 메모리를 나열할지 여부를 결정합니다. 메모리 및 메모리 스토어는 에이전트 메모리를 지원합니다. 메모리에 대한 자세한 내용은 섹션을 참조하세요DevOps 에이전트 메모리.

두 단계로 메모리를 생성합니다. 먼저 memory_store를 생성합니다. 그런 다음 메모리에 설명된 대로 memory 내부에 각각을 생성합니다.

필수 metadata 속성:

  • name(문자열) - 메모리 스토어의 고유 식별자입니다. 소문자, 숫자 및 하이픈만 해당, 1~128자. 하이픈으로 시작하거나 끝나지 않아야 합니다.

  • 설명(문자열) - 스토어에 있는 항목에 대한 1~1024자의 설명입니다. 에이전트는 이를 사용하여 스토어를 열지 여부를 결정합니다.

선택적 metadata 속성:

  • agent_types(문자열 배열) - 스토어를 볼 수 있는 리드 에이전트 유형입니다. ["GENERIC"]를 사용하여 스토어를 모든 에이전트 유형에 표시합니다.

예제 metadata:

{ "name": "incident-runbooks", "description": "Operational memories about past incidents and their resolutions.", "agent_types": ["GENERIC"] }

메모리

memory 자산은 메모리 스토어에 속하는 개별 메모리 파일입니다. 에이전트는 메모리의 이름과 설명을 읽고 전체 파일을 읽을지 여부를 결정합니다. memory_store 먼저 상위를 생성한 다음 메모리memory_store_id에를 스토어의 자산 ID로 설정합니다.

필수 metadata 속성:

  • name(문자열) /- 소문자 kebab-case 세그먼트의 구분된 경로로 작성된 메모리 식별자로, 1~255자(예: )입니다databases/rds-failover.

  • 설명(문자열) - 메모리에 포함된 항목에 대한 1~1024자의 설명입니다.

  • memory_store_id(문자열) -이 메모리가 속한 메모리 스토어의 자산 ID입니다.

선택적 metadata 속성:

  • expires_at(숫자) - epoch 초 단위의 보존 기한입니다. 설정된 경우 서비스는 기한이 경과한 후(일반적으로 48시간 이내) 메모리를 자동으로 삭제합니다. 메모리를 삭제할 때까지 유지하려면이 속성을 생략합니다.

예제 metadata:

{ "name": "databases/rds-failover", "description": "Steps that resolved the RDS failover incident in June.", "memory_store_id": "a1b2c3d4-5678-90ab-cdef-example11111" }

test_profile

test_profile 자산은 수행할 테스트 유형과 대상 엔드포인트를 포함하여 릴리스 테스트 실행을 위한 재사용 가능한 구성을 저장합니다.

필수 metadata 속성:

  • test_agent_type(문자열) -이 프로파일이 수행하는 테스트 유형입니다. 유효 값은 releaseUiTestingreleaseApiTesting입니다.

  • target_url(문자열) - 테스트 실행 대상의 URL입니다.

선택적 metadata 속성:

  • name(문자열) - 테스트 프로필의 사람이 읽을 수 있는 식별자입니다. 소문자, 숫자 및 하이픈만 해당, 1~128자. 하이픈으로 시작하거나 끝나지 않아야 합니다.

  • 설명(문자열) - 테스트 프로필에 포함되는 내용에 대한 1~1024자의 설명입니다.

  • test_personas(문자열 배열) - 테스트 실행 중에 연습할 페르소나입니다. 유효 값은 guestauthenticated입니다.

  • api_spec(문자열) - 테스트 실행을 위한 API 사양입니다. 와 관련이 있습니다releaseApiTesting.

  • credentials_secret_arn(문자열) - 테스트 실행에 대한 자격 증명을 보유한 AWS Secrets Manager 보안 암호의 ARN입니다.

예제 metadata:

{ "name": "checkout-api-tests", "description": "Release API tests for the checkout service.", "test_agent_type": "releaseApiTesting", "target_url": "https://api.example.com", "test_personas": ["guest", "authenticated"], "api_spec": "openapi: 3.0.0", "credentials_secret_arn": "arn:aws:secretsmanager:us-east-1:111122223333:secret:checkout-creds" }

의견

feedback 자산은 단일 에이전트 실행에 대해 고객이 제공한 피드백을 기록합니다. 피드백 자산을 사용하여 다운스트림 평가 파이프라인이 집계할 수 있는 결정과 메모를 캡처합니다.

필수 metadata 속성:

  • agent_types(문자열 배열) - 실행을 생성한 에이전트 유형입니다. 하나 이상의 값을 포함해야 합니다(예: INCIDENT_TRIAGE).

선택적 metadata 속성:

  • execution_id(문자열) -이 피드백이 연결된 실행입니다. 에서이 CreateAsset값을 설정합니다. 에서는 변경할 수 없습니다UpdateAsset.

예제 metadata:

{ "execution_id": "b2c3d4e5-6789-01ab-cdef-example22222", "agent_types": ["INCIDENT_TRIAGE"] }

자산 콘텐츠: 파일 또는 zip

모든 CreateAsset 요청에는 자산 저장소의 바이트를 포함하는 content 객체가 포함됩니다. 의 모양은 단일 파일을 업로드하는지 아니면 zip 번들을 업로드하는지에 content 따라 달라집니다.

  • 단일 텍스트 파일 - 최대 1.5MB의 UTF-8 텍스트를 content.file.body.text 포함합니다. 간단한 기술 및 AGENTS.md 파일에 사용합니다.

json { "content": { "file": { "path": "SKILL.md", "body": { "text": "# Skill\n\nInstructions go here." } } } }

  • 단일 바이너리 파일 - 최대 6MB의 base64 인코딩 바이너리 콘텐츠를 content.file.body.bytes 제공합니다. 이미지 또는 PDFs와 같은 첨부 파일에 사용합니다. Blob은 content 조합 내에 중첩되므로 미리 파일을 base64로 인코딩하고 로 요청을 제출합니다--cli-input-json(작업 예제는 이진 파일에서 스킬 생성 참조).

json { "content": { "file": { "path": "topology.png", "body": { "bytes": "<base64-encoded bytes>" } } } }

  • Zip 번들 - 최대 6MB의 base64 인코딩 zip 아카이브를 content.zip.zipFile 포함합니다. references/ 또는 assets/ 디렉터리에 SKILL.md 추가 파일이 포함된 스킬에 사용합니다.

json { "content": { "zip": { "zipFile": "<base64-encoded zip bytes>" } } }

전체 번들을 다시 업로드하지 않고 기존 자산 내에서 개별 파일을 추가, 교체 또는 삭제하려면 CreateAssetFile, UpdateAssetFile및를 사용합니다DeleteAssetFile.

스킬 end-to-end 관리

다음 연습에서는 세 가지 방법(단일 텍스트 파일, 바이너리 파일, zip 번들)으로 스킬을 생성한 다음 읽기, 업데이트 및 삭제 작업을 수행합니다. 를 에이전트 스페이스 ID8f6187a7-0388-4926-8217-3a0fe32f757c로 바꿉니다.

단일 텍스트 파일에서 스킬 생성

가장 간단한 경로는 인라인으로 업로드된 단일 SKILL.md 파일입니다. 업로드에는 정확히 하나의 텍스트 파일이 포함되어 있으므로 description에서 name 및를 제공해야 합니다metadata.

AWS CLI:

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type skill \ --metadata '{ "name": "rds-performance-investigation", "description": "Investigation procedures for RDS performance issues. Use when investigating database latency, connection errors, or query timeouts.", "agent_types": ["GENERIC"] }' \ --content '{ "file": { "path": "SKILL.md", "body": { "text": "# RDS Performance Investigation\n\nUse this skill when customers report database latency, connection errors, query timeouts, or read/write performance degradation." } } }'

Python(Boto3):

import boto3 client = boto3.client("devops-agent") response = client.create_asset( agentSpaceId="8f6187a7-0388-4926-8217-3a0fe32f757c", assetType="skill", metadata={ "name": "rds-performance-investigation", "description": ( "Investigation procedures for RDS performance issues. " "Use when investigating database latency, connection errors, " "or query timeouts." ), "agent_types": ["GENERIC"], }, content={ "file": { "path": "SKILL.md", "body": { "text": ( "# RDS Performance Investigation\n\n" "Use this skill when customers report database latency, " "connection errors, query timeouts, or read/write " "performance degradation." ) }, } }, ) asset_id = response["asset"]["assetId"]

바이너리 파일에서 스킬 생성

스킬 콘텐츠가 UTF-8 텍스트가 아닌 경우 이진 업로드를 사용합니다. 아래 예제에서는 미리 렌더링된 PDF를 스킬 본문으로 업로드합니다. 요청 본문에는 content 조합 내에 중첩된 base64 인코딩 BLOB이 포함되어 있으므로 JSON 파일의 요청을 --cli-input-json 로 제공하고 base64 인코딩 BLOB을 미리 제공합니다.

아래 -w 0 플래그는 GNUbase64에 인코딩된 블롭을 한 줄로 내보내도록 지시합니다.이 플래그가 없으면 기본 76자 줄 바꿈은 블롭이 헤리독으로 보간될 때 잘못된 JSON을 생성하는 줄 바꿈을 삽입합니다. macOS에서는 base64 -i ops-runbook.pdf (BSDbase64는 기본적으로 래핑되지 않음)를 사용합니다.

요청 본문을 빌드합니다.

base64 -w 0 ops-runbook.pdf > ops-runbook.b64 cat > create-skill.json <<EOF { "agentSpaceId": "8f6187a7-0388-4926-8217-3a0fe32f757c", "assetType": "skill", "metadata": { "name": "ops-runbook", "description": "Operations runbook covering on-call escalation paths.", "agent_types": ["GENERIC"] }, "content": { "file": { "path": "SKILL.pdf", "body": { "bytes": "$(cat ops-runbook.b64)" } } } } EOF

AWS CLI:

aws devops-agent create-asset --cli-input-json file://create-skill.json

Python(Boto3):

with open("ops-runbook.pdf", "rb") as f: body_bytes = f.read() response = client.create_asset( agentSpaceId="8f6187a7-0388-4926-8217-3a0fe32f757c", assetType="skill", metadata={ "name": "ops-runbook", "description": "Operations runbook covering on-call escalation paths.", "agent_types": ["GENERIC"], }, content={ "file": { "path": "SKILL.pdf", "body": {"bytes": body_bytes}, } }, )

zip 번들에서 스킬 생성

스킬에 SKILL.md 더하기 참조 자료 및 자산과 같이 둘 이상의 파일이 포함된 경우 zip 업로드를 사용합니다. zip 업로드의 경우 서비스 읽기 nameSKILL.md 프런트미터description에서를 업로드하므로에 포함하지 마십시오metadata.

zip 레이아웃은 다음과 같습니다.

rds-performance-investigation.zip ├── SKILL.md ├── references/ │ └── rds-metrics-reference.md └── assets/ └── rds-investigation-flowchart.png

SKILL.md 서비스에서 이름과 설명을 추출할 수 있도록 에는 frontmatter가 포함되어야 합니다.

--- name: rds-performance-investigation description: Investigation procedures for RDS performance issues including connection exhaustion, slow queries, replication lag, and storage capacity. Use this skill when investigating database latency, connection errors, or read/write performance degradation. --- # RDS Performance Investigation ...

요청 본문을 빌드합니다.

base64 -w 0 rds-performance-investigation.zip > skill.zip.b64 cat > create-skill.json <<EOF { "agentSpaceId": "8f6187a7-0388-4926-8217-3a0fe32f757c", "assetType": "skill", "metadata": { "agent_types": ["GENERIC"] }, "content": { "zip": { "zipFile": "$(cat skill.zip.b64)" } } } EOF

AWS CLI:

aws devops-agent create-asset --cli-input-json file://create-skill.json

Python(Boto3):

with open("rds-performance-investigation.zip", "rb") as f: zip_bytes = f.read() response = client.create_asset( agentSpaceId="8f6187a7-0388-4926-8217-3a0fe32f757c", assetType="skill", metadata={"agent_types": ["GENERIC"]}, content={"zip": {"zipFile": zip_bytes}}, )

리포지토리에서 스킬 가져오기

GitHub 리포지토리 디렉터리에서 직접 스킬을 가져와 스킬을 생성할 수 있습니다. AWS DevOps Agent는 스킬 콘텐츠를 가져오고, SKILL.md 프런트미터에서 이름과 설명을 추출하고, 에이전트 스페이스에서 스킬을 생성합니다. 이를 통해 버전 관리 기술을 관리하고 프로그래밍 방식으로 가져오거나 동기화할 수 있습니다.

사전 조건:

  • 에이전트 스페이스에는 GitHub 계정이 연결되어 있어야 합니다. GitHub 연결을(를) 참조하세요.

  • 리포지토리 디렉터리에는 frontmatter가 있는 유효한 SKILL.md 파일이 포함되어야 합니다.

AWS CLI:

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type skill \ --metadata '{ "agent_types": ["GENERIC"] }' \ --content '{"sourceUrl": {"url": "https://github.com/my-org/my-repo/tree/main/skills/rds-investigation"}}'

Python(Boto3):

response = client.create_asset( agentSpaceId="8f6187a7-0388-4926-8217-3a0fe32f757c", assetType="skill", metadata={"agent_types": ["GENERIC"]}, content={ "sourceUrl": { "url": "https://github.com/my-org/my-repo/tree/main/skills/rds-investigation" } }, ) asset_id = response["asset"]["assetId"]

서비스는 디렉터리 콘텐츠를 가져오고, name 및에 대한 SKILL.md frontmatter를 읽고description, 모든 파일을 가져옵니다. descriptionname 또는 metadata를 포함하지 마십시오. 프런트미터에서 자동으로 추출됩니다.

가져온 스킬 동기화:

리포지토리에서 최신 변경 사항을 가져오려면 UpdateAsset를 사용하여를 호출합니다content.sourceUrl.

aws devops-agent update-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId> \ --content '{"sourceUrl": {"url": "https://github.com/my-org/my-repo/tree/main/skills/rds-investigation"}}'
response = client.update_asset( agentSpaceId="8f6187a7-0388-4926-8217-3a0fe32f757c", assetId="<assetId>", content={ "sourceUrl": { "url": "https://github.com/my-org/my-repo/tree/main/skills/rds-investigation" } }, )

동기화는 스킬 콘텐츠를 리포지토리 디렉터리의 현재 상태로 완전히 바꿉니다. 편집 가능한 필드(상태, 에이전트 유형)는 보존됩니다.

가져오기 소스 보기:

GetAsset는 리포지토리 가져오기 기술을 metadata.source 위해에서 소스 정보를 반환합니다.

{ "metadata": { "name": "rds-performance-investigation", "description": "Investigation procedures for RDS performance issues...", "source": { "url": "https://github.com/my-org/my-repo/tree/main/skills/rds-investigation", "lastSyncedAt": 1718467200 }, "agent_types": ["GENERIC"], "skill_type": "USER", "status": "ACTIVE" } }

제약 조건:

  • GitHub URLs만 허용됩니다. 참조 파일을 포함하여 전체 디렉터리를 가져오는 SKILL.md(예: https://github.com/org/repo/tree/main/skills/my-skill)이 포함된 디렉터리를 가리킬 수 있습니다. SKILL.md 리포지토리의 루트에 있는 경우 SKILL.md만 가져오는 파일(예: https://github.com/org/repo/blob/main/SKILL.md)에 직접 연결할 수도 있습니다.

  • 디렉터리에는 유효한 프론트미터가 있는 SKILL.md 포함되어야 합니다.

  • 총 디렉터리 크기는 6MB를 초과할 수 없으며 최대 100개의 파일을 초과할 수 없습니다.

  • content.sourceUrlcontent.file 및와 상호 배타적입니다. 동일한 요청에서 결합할 수 content.zip없습니다.

  • 메타데이터 전용 업데이트( 제외content)는 기존 가져오기 소스를 보존하며 리포지토리에서 다시 가져오지 않습니다.

가져오기, 나열, 업데이트 및 삭제

GetAsset를 사용하여 ID별로 단일 자산을 검색합니다.

aws devops-agent get-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId>

ListAssets를 사용하여 에이전트 스페이스의 모든 자산을 페이징합니다.

aws devops-agent list-assets \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --max-results 50 aws devops-agent list-assets \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --max-results 50 \ --next-token <token>

콘텐츠를 다시 업로드하지 않고 하나 이상의 metadata 필드를 변경하는 UpdateAsset 데 사용합니다. 생략한 키는 기존 값을 유지합니다.

aws devops-agent update-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId> \ --metadata '{ "agent_types": ["INCIDENT_TRIAGE", "INCIDENT_RCA"] }'

ListAssetVersions를 사용하여 자산의 버전 기록을 검사합니다. 성공UpdateAsset하거나 UpdateAssetFile 호출할 때마다 자산의 버전 번호가 발전합니다.

aws devops-agent list-asset-versions \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId>

DeleteAsset를 사용하여 자산과 모든 파일을 제거합니다.

aws devops-agent delete-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId>

기존 스킬에 단일 파일 추가

zip 번들에서 스킬을 이미 생성하고 새 참조 파일을 하나 추가하려면 전체 번들을 다시 업로드할 필요가 없습니다. CreateAssetFile을 사용합니다.

aws devops-agent create-asset-file \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId> \ --path references/troubleshooting.md \ --content '{ "text": "# Troubleshooting\n\nAdditional notes." }'

파일을 바꾸려면를 동일한 인수update-asset-file와 함께 사용합니다. 제거하려면를 사용합니다delete-asset-file.

기술 활성화 및 비활성화

스킬은에서 활성화 상태를 유지합니다metadata.status. 새 스킬은 ACTIVE 기본적으로 조사 및 채팅 중에 에이전트가 로드합니다. 예를 들어 예기치 않은 결과를 생성하는 이유를 조사하고 나중에 다시 활성화하는 동안 스킬을 비활성화하여 스킬을 삭제하지 않고 교체에서 제외할 수 있습니다.

CreateAsset 요청에 를 포함하여 생성 시 초기 상태를 설정합니다metadata.status.

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type skill \ --metadata '{ "name": "rds-performance-investigation", "description": "Investigation procedures for RDS performance issues.", "agent_types": ["GENERIC"], "status": "INACTIVE" }' \ --content '{ "file": { "path": "SKILL.md", "body": { "text": "# RDS Performance Investigation" } } }'

를 사용하여 기존 스킬을 비활성화합니다UpdateAsset. metadata는 부분 업데이트로 적용되므로 전송 시 다른 모든 필드는 그대로 status 유지됩니다.

aws devops-agent update-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId> \ --metadata '{ "status": "INACTIVE" }'

를 사용하여 동일한 방식으로 다시 활성화합니다"status": "ACTIVE".

aws devops-agent update-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-id <assetId> \ --metadata '{ "status": "ACTIVE" }'

GetAsset 및는 ListAssets 항상 스킬 자산의 metadata status에 현재를 포함하므로 언제든지 실시간 활성화 상태를 읽을 수 있습니다.

status 필드는 대/소문자를 구분합니다. ACTIVEINACTIVE (대문자)만 허용됩니다. 다른 모든 값은에서 실패합니다ValidationException. 활성화는 스킬에만 적용됩니다. 다른 자산 유형에 metadata.status 대한 설정은 영향을 주지 않으며 필드는 응답에서 삭제됩니다.

AWS CloudFormation을 사용하여 자산 관리

대화형 또는 스크립트 기반 변경 사항에 Asset API를 사용합니다. 자산을 선언적으로 관리하려면 AWS CloudFormation에서 자산을 AWS::DevOpsAgent::Asset 리소스로 모델링합니다. 이 접근 방식을 사용하면 자산을 다른 인프라와 함께 버전 제어하고, 파이프라인을 통해 배포하고, 에이전트 스페이스에서 복제할 수 있습니다. CloudFormation은 상위 에이전트 스페이스의 하위 자산으로 각 자산을 생성하므로 템플릿에서 정의한 자산은 CreateAsset 호출이 생성하는 것과 정확히 동일한 리소스에 매핑됩니다.

동일한 AWS::DevOpsAgent::Asset 리소스를 통해 모든 자산 유형을 관리합니다. 지원되는 유형은 skill, , agents_md, attachment, custom_agent, memory_storememory, 및 test_profile입니다feedback. AssetType, Metadata및 콘텐츠만 유형마다 다릅니다. 다음 예제에서는 스킬과 사용자 지정 에이전트를 생성합니다. 다른 유형은 자산 유형에 설명된 메타데이터를 사용하여 동일한 형태를 따릅니다.

AWS::DevOpsAgent::Asset 리소스

리소스 속성은이 주제의 앞부분에서 설명한 CreateAsset 요청 필드에 직접 매핑됩니다.

CloudFormation 속성 유형 매핑 참고
AgentSpaceId 문자열 agentSpaceId 필수입니다. 생성 전용 - 변경하면 자산이 대체됩니다.
AssetType 문자열 assetType 필수입니다. 생성 전용. 자산 유형 식별자 - 예: skill 또는 custom_agent. 자산 유형의 모든 유형이 유효합니다.
Metadata JSON metadata API와 동일한 메타데이터 문서(기술의 경우: name, agent_types, description및 선택적으로 status). 업데이트되었습니다.
Files List content.file 각각 PathContentText 또는가 있는 인라인 파일ContentBytes과 선택적 파일별 Metadata. Zip와는 함께 사용할 수 없습니다.
Zip 문자열 content.zip.zipFile Base64-encoded zip 번들입니다. Files와는 함께 사용할 수 없습니다.
AssetId 문자열 asset.assetId 읽기 전용. 를 사용하여 검색합니다Fn::GetAtt.
Arn 문자열 asset.arn 읽기 전용. 상위 에이전트 공간 아래에 중첩된 자산 ARN입니다.
Version Integer asset.version 읽기 전용. 업데이트가 성공할 때마다 범프합니다.
CreatedAt / UpdatedAt 문자열 asset.createdAt / updatedAt 읽기 전용 타임스탬프입니다.

템플릿을 작성하기 전에 다음 두 가지 동작을 호출할 가치가 있습니다.

  • AgentSpaceIdAssetType는 생성 전용입니다. 둘 중 하나를 변경하면 자산이 대체됩니다. CloudFormation은 새 AssetId 및를 사용하여 새 자산을 생성한 Arn다음 이전 자산을 삭제합니다. 콘텐츠 및 메타데이터 변경 사항은 기존 자산을 업데이트합니다.

  • CloudFormation은 메타데이터와 전체 파일 세트 등 자산을 전체적으로 관리합니다. 스킬을 변경하려면 템플릿을 편집하고 스택을 업데이트합니다. 자산의 일부에서 작동하는 작업은 리소스의 일부가 아니며 API 전용으로 유지됩니다. 여기에는 파일별 편집(CreateAssetFile, UpdateAssetFile, DeleteAssetFile) 및 버전 기록()이 포함됩니다ListAssetVersions. 또한 콘텐츠 다운로드(GetAssetContent) 및 리포지토리 가져오기 및 동기화(sourceUrl콘텐츠 유형)도 포함됩니다. 이러한 경우이 주제의 앞부분에 표시된 대로 AWS CLI 또는 SDK를 사용합니다.

스킬 생성

다음 템플릿은 AWS CLI 연습에 사용되는 단일 파일 rds-performance-investigation 스킬을 생성합니다. 상위 에이전트 공간 ID를 파라미터로 사용하고 새 자산의 ID와 ARN을 내보냅니다.

AWSTemplateFormatVersion: '2010-09-09' Description: A DevOps Agent skill managed as an AWS::DevOpsAgent::Asset resource. Parameters: AgentSpaceId: Type: String Description: The ID of the Agent Space that owns the skill. Resources: RdsPerformanceSkill: Type: AWS::DevOpsAgent::Asset Properties: AgentSpaceId: !Ref AgentSpaceId AssetType: skill Metadata: name: rds-performance-investigation description: Investigation procedures for RDS performance issues. agent_types: - GENERIC Files: - Path: SKILL.md ContentText: | # RDS Performance Investigation Use this skill when customers report database latency, connection errors, query timeouts, or read/write performance degradation. Outputs: SkillAssetId: Value: !GetAtt RdsPerformanceSkill.AssetId SkillArn: Value: !GetAtt RdsPerformanceSkill.Arn

AWS CLI를 사용하여 배포하고 에이전트 스페이스 ID를 전달합니다.

aws cloudformation deploy \ --template-file skill.yaml \ --stack-name DevOpsAgentSkillStack \ --parameter-overrides AgentSpaceId=8f6187a7-0388-4926-8217-3a0fe32f757c \ --region <REGION>

SKILL.md 더하기 참조 문서와 같이 둘 이상의 파일을 제공하는 스킬은 Files에 더 많은 항목을 추가합니다.

Files: - Path: SKILL.md ContentText: | # RDS Performance Investigation Investigation entry point. - Path: references/rds-metrics-reference.md ContentText: | # RDS metrics reference Key CloudWatch metrics to check.

스킬을 비활성화하거나 나중에 비활성화하려면 status에서를 설정하고Metadata(기술 활성화 및 비활성화 참조) 스택을 업데이트합니다.

Metadata: name: rds-performance-investigation description: Investigation procedures for RDS performance issues. agent_types: - GENERIC status: INACTIVE

사용자 지정 에이전트 생성

사용자 지정 에이전트는 AssetType, Metadata및 콘텐츠가 다른 동일한 리소스입니다. 다음 리소스는 일련의 도구와 기술을 큐레이션하는 custom_agent 자산을 생성합니다. 이 skills 목록은 name 메타데이터별로 스킬을 참조하므로 이전에 생성한 스킬을 참조할 수 있습니다.

RdsFirefighter: Type: AWS::DevOpsAgent::Asset Properties: AgentSpaceId: !Ref AgentSpaceId AssetType: custom_agent Metadata: name: rds-firefighter tools: - cloudwatch:GetMetricData - rds:DescribeDBInstances skills: - rds-performance-investigation Files: - Path: AGENT.md ContentText: | # RDS Firefighter Custom agent for RDS incidents.

다른 자산 유형은 동일한 방식으로 작동합니다. 즉, 유형에 필요한 Metadata 키를 설정하고 AssetType 제공합니다(자산 유형 참조). 예를 들어 agents_md 자산은 agent_type: INCIDENT_TRIAGEAGENTS.md 파일을 Metadata 포함하는 AssetType: agents_md를 설정합니다.

트리거를 사용하여 사용자 지정 에이전트 예약

사용자 지정 에이전트를 자동으로 실행하려면 AWS::DevOpsAgent::Trigger 리소스를 추가합니다. 트리거는 에이전트 공간의 하위 항목입니다. 작업은 자산 ID별로 실행할 사용자 지정 에이전트를 형식으로 참조합니다custom:<assetId>. CloudFormation이 두 리소스를 함께 연결하고 생성을 주문AssetId하도록 사용자 지정 에이전트의를 전달하는 Fn::GetAtt 데 사용합니다.

다음 트리거는 사용자 rds-firefighter 지정 에이전트를 하루에 한 번 실행합니다.

DailyRdsCheck: Type: AWS::DevOpsAgent::Trigger Properties: AgentSpaceId: !Ref AgentSpaceId Type: TIME_BASED Condition: Schedule: Expression: rate(1 day) Action: actionType: create:task task: agent: !Sub - custom:${AssetId} - AssetId: !GetAtt RdsFirefighter.AssetId Status: Active

AgentSpaceId, TypeCondition, 및 Action 속성은 생성 전용입니다. 둘 중 하나를 변경하면 트리거가 대체됩니다. Status 속성은 Active 또는를 허용Inactive하며 제자리에서 업데이트할 수 있습니다. 트리거를 삭제하지 않고 일시 중지Inactive하려면 로 설정합니다. 일정 표현식 구문에 대한 자세한 내용은 섹션을 참조하세요사용자 지정 에이전트 실행.

AWS::DevOpsAgent::AssetAWS::DevOpsAgent::Trigger는 AWS DevOps 에이전트가 제공되는 AWS 리전에서 사용할 수 있습니다. 지원되는 AWS 리전에 대한 자세한 내용은 섹션을 참조하세요지원되는 리전:. 상위 에이전트 공간, IAM 역할 및 운영자 앱을 코드형 인프라로 배포하려면 섹션을 참조하세요AWS CloudFormation을 사용하여 AWS DevOps 에이전트 시작하기.

다른 자산 유형의 예

위의 스킬 연습은 다른 모든 자산 유형에 적용됩니다. 유일한 차이점은 metadata 블록과 첨부 파일의 경우 바이너리 콘텐츠 선택입니다. 아래 최소 CreateAsset 호출은 각 유형을 보여줍니다.

메모리 스토어와 메모리는 동일한 CreateAsset 작업을 사용합니다. 먼저 스토어를 생성한 다음 메모리를 생성합니다. 메타데이터에 대한 자세한 내용은 memory_storememory를 참조하세요.

AGENTS.md 생성:

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type agents_md \ --metadata '{ "agent_type": "INCIDENT_TRIAGE" }' \ --content '{ "file": { "path": "AGENTS.md", "body": { "text": "# Triage Instructions\n\nFollow these steps for new incidents." } } }'

첨부 파일 생성(이진 콘텐츠, 이진 파일에서 스킬 생성에 표시된 대로 JSON 파일에서 요청 빌드):

base64 -w 0 topology.png > topology.png.b64 cat > create-attachment.json <<EOF { "agentSpaceId": "8f6187a7-0388-4926-8217-3a0fe32f757c", "assetType": "attachment", "metadata": { "filename": "topology.png", "extension": "png", "size": 184320 }, "content": { "file": { "path": "topology.png", "body": { "bytes": "$(cat topology.png.b64)" } } } } EOF aws devops-agent create-asset --cli-input-json file://create-attachment.json

사용자 지정 에이전트 생성:

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type custom_agent \ --metadata '{ "name": "rds-firefighter", "tools": ["cloudwatch:GetMetricData", "rds:DescribeDBInstances"], "skills": ["rds-performance-investigation"] }' \ --content '{ "file": { "path": "AGENT.md", "body": { "text": "# RDS Firefighter\n\nCustom agent for RDS incidents." } } }'

테스트 프로필 생성:

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type test_profile \ --metadata '{ "name": "checkout-api-tests", "test_agent_type": "releaseApiTesting", "target_url": "https://api.example.com", "test_personas": ["guest", "authenticated"] }' \ --content '{ "file": { "path": "PROFILE.md", "body": { "text": "# Checkout API test profile" } } }'

피드백 자산 생성:

aws devops-agent create-asset \ --agent-space-id 8f6187a7-0388-4926-8217-3a0fe32f757c \ --asset-type feedback \ --metadata '{ "execution_id": "b2c3d4e5-6789-01ab-cdef-example22222", "agent_types": ["INCIDENT_TRIAGE"] }' \ --content '{ "file": { "path": "FEEDBACK.md", "body": { "text": "{\"verdict\":\"correct\"}" } } }'

지원되는 자산 유형을 나열합니다.

aws devops-agent list-asset-types