$ aws sts get-caller-identity --query Arn
"arn:aws:iam::123456789012:user/neilguan"
$ aws sts get-caller-identity --query Arn --output text
arn:aws:iam::123456789012:user/neilguan
$ aws sts get-caller-identity --query Account --output text
123456789012
$ aws sts get-caller-identity --query UserId --output text
AIXXXXXXXXXXXXXXXXXXXG
aws eks describe-cluster --name $EKS_CLUSTER_NAME --query cluster.arn --output text
arn:aws:eks:${EKS_EXIST_REGION}:123456789012:cluster/$EKS_CLUSTER_NAME
while true; do aws ecs list-tasks --cluster ${ECS_CLUSTER_NAME} --query taskArns[*] --output text | \
xargs aws ecs describe-tasks --cluster ${ECS_CLUSTER_NAME} --query tasks[*].'capacityProviderName' --tasks && \
sleep 4 ;done
---
[
"FARGATE_SPOT",
"FARGATE_SPOT",
"FARGATE_SPOT",
"FARGATE",
"FARGATE",
"FARGATE_SPOT"
]
$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile PROFILENAME manual --profile
access_key ****************QJNR shared-credentials-file
secret_key ****************N8gh shared-credentials-file
region ap-northeast-1 config-file ~/.aws/config
$ aws configure list-profiles
default
profile1
profile2
# delete all object in bucket.
$ aws s3 rm s3://[bucket-name] --recursive
# delete bucket
$aws s3 rb s3://[bucket-name]
# presignUrl example.
aws s3 presign s3://awsexamplebucket/test2.txt --expires-in 604800
#!/bin/bash
aws ec2 describe-instances --filter "Name=tag:$1,Values=$2"
aws cloudformation describe-stacks --stack-name [stack-name] --output text --query 'Stacks[*].Outputs[?OutputKey=='outputkey...'].OutputValue'