Search

개념

AWS CLI (Command Line Interface)
AWS CLI는 AWS 서비스와 상호 작용할 수 있는 오픈 소스 도구이다. AWS CLI를 사용하면 Powershell 이나 터미널에서도 AWS에서 제공하는 명령어 기능을 실행 할 수 있다.
# 버전 확인 > aws --version aws-cli/2.13.1 Python/3.11.4 Darwin/23.6.0 exe/x86_64 prompt/off # 사용자 등록 > aws configure AWS Access Key ID [****************MSMW]: AWS Secret Access Key [****************XzDd]: Default region name [ap-northeast-2]: Default output format [json]: # 현재 계정의 S3 버킷 목록을 보여주는 명령어 > aws s3 ls 2024-08-26 02:12:16 school-meal-images 2024-08-20 14:15:30 school-meal-website 2024-09-01 23:41:18 skills-test-buckets 2024-06-18 19:29:16 tf-backend-wlstmd 2024-08-02 23:46:27 wlstmd-eks-tfstate 2024-05-15 00:52:55 wlstmd-terminal # s3에 있는 skills-test-buckets 라는 버킷에 있는 파일들을 가져올 수 있다 > aws s3 sync s3://<버킷이름> <디렉터리> download: s3://skills-test-buckets/cluster.yaml to ./cluster.yaml # S3에 cli명령어를 통해서 업로드 > aws s3 cp <파일명> s3://<버킷이름> # 임시 자격 발급 aws sts get-session-token --duration-seconds 3600
Markdown
복사

기본 속성

filter
AWS에서 데이터를 걸러서 필요한 것만 가져올때 사용한다.

기본 문법

aws <서비스> <명령어> --filters "Name=<속성 이름>,Values=<값1>,<값2>,..."
Shell
복사
query
가져온 데이터를 내 컴퓨터에서 원하는 형태로 정리하거나 필요한 부분만 뽑아낸다.

기본 문법

aws <서비스> <명령어> --query '<JMESPath 표현식>'
Shell
복사