명령 문서와 비교하여 명령 인수를 확인하여 Amazon Bedrock의 대규모 언어 모델에서 흔히 발생하는 실수와 함정을 방지하는 데 도움이 되는 AWS CLI 래퍼입니다.
AWS 사용자로서 때때로 온라인에서 발견되거나 Stack Overflow와 같은 소스에서 복사된 CLI 명령을 맹목적으로 실행하면 의도하지 않은 결과, 데이터 손실, 재정적 손실 또는 보안 위험이 발생할 수 있습니다.
safeaws-cli
Amazon Bedrock의 AI 언어 모델을 활용하여 CLI 명령을 분석하고, 도움말 텍스트를 가져오고, 실행 전에 잠재적인 문제나 우려 사항을 식별함으로써 AWS 명령을 자신 있게 실행할 수 있도록 지원합니다. safeaws-cli
함정을 완화하는 안전망을 제공함으로써 사용자가 AWS를 안전하게 탐색할 수 있도록 하여 CLI 작업에 대한 보다 정보에 입각한 접근 방식을 조성합니다.
그러나 물론 GenAI 모델을 실행하려면 비용이 발생합니다. 사용하기 전에 평가해 보세요!
python3 -m pip install boto3
SAFEAWS_BEDROCK_MODEL_ID
를 참조하세요. 변하기 쉬운 | 설명 | 기본 |
---|---|---|
SAFEAWS_AWS_PROFILE | 사용할 AWS 프로필 | None |
SAFEAWS_AWS_REGION | Bedrock 모델에 사용할 AWS 리전 | us-east-1 |
SAFEAWS_BEDROCK_MODEL_ID | AI 확인에 사용할 Bedrock 모델 ID | anthropic.claude-3-haiku-20240307-v1:0 |
SAFEAWS_ANTHROPIC_VERSION | 인류학 API 버전 | bedrock-2023-05-31 |
SAFEAWS_MODEL_MAX_TOKENS | 생성할 최대 토큰 | 1024 |
SAFEAWS_TEMPERATURE | LLM의 온도 | 0.5 |
Amazon Bedrock에 대한 인증을 위해 권장되지는 않지만 환경 변수 AWS_ACCESS_KEY_ID
및 AWS_SECRET_ACCESS_KEY
에서 AWS 액세스 키와 비밀 키를 설정할 수도 있습니다.
보안을 위해 sso-session
설정하고 AWS_PROFILE
환경 변수를 사용하여 인증하는 것이 좋습니다.
#! /bin/bash
sudo curl https://raw.githubusercontent.com/gabrielkoo/safeaws-cli/main/safeaws.py
-o /usr/local/bin/safeaws &&
sudo chmod +x /usr/local/bin/safeaws
safeaws-cli
사용하려면 AWS CLI 명령에 safeaws
접두어를 붙이면 됩니다.
safeaws <aws-cli-command>
예를 들어:
> safeaws s3 cp file.txt s3://my-bucket/path/
The provided command appears to be correct and complete. However, here are a few points to consider:
1. Ensure that the file 'file.txt' exists in the local directory from where the command is being executed.
2. Verify that the S3 bucket 'my-bucket' and the 'path/' prefix exist, and that you have the necessary permissions to upload the file to that location.
3. Consider adding the '--acl' parameter to set the appropriate access control list (ACL) for the uploaded object, if required.
4. Evaluate whether any additional metadata, such as content-type or cache-control, should be set for the uploaded object using the respective parameters.
5. Assess if the default storage class ('STANDARD') is appropriate for your use case, and consider using a different storage class if necessary.
Do you want to execute the command? (y/N) y
<Execution results shown here>
스크립트는 제공된 AWS CLI 명령에 대한 도움말 텍스트를 가져와 명령 인수와 함께 지정된 Bedrock 모델로 보내고 AI가 식별한 잠재적인 문제나 우려 사항을 표시합니다. 그러면 명령을 실행할지 여부를 확인하는 메시지가 표시됩니다.