1. How can users access AWS ?
- To access AWS, you have three options:
• AWS Management Console (protected by password + MFA)
• AWS Command Line Interface (CLI): protected by access keys
• AWS Software Developer Kit (SDK) - for code: protected by access keys
- Access Keys are generated through the AWS Console
- Users manage their own access keys
- Access Keys are secret, just like a password. Don’t share them
- Access Key ID ~= username
- Secret Access Key ~= password
2. How to get Access Keys for CLI
- AWS Management Console > Access keys > Create asccess key
• Access Key ID ~= username
• Secret Access Key ~= password
3. What's AWS CLI
- AWS CLI is a tool that enables you to interact with AWS services using commands your command-line shell.
- Direct access to the public APIs of AWS services
- You can develop scripts to manage your resources
- where to get its open-source https://github.com/aws/aws-cli
- all the command lines starts aws
- Alternative to using AWS Management Console
4. What's AWS SDK?
- AWS Software Development Kit (AWS SDK)
- Programming Language-specific APIs (set of libraries)
- Enable you to access and manage AWS services programmatically
- Embedded within your application
- is in your application
- Supports Many different languages
• SDKs (JS, Python, PHP, .NET, Ruby, Java, Go, Node.js, C++)
• Mobile SDKs (Android, iOS, ...)
5. ์๋์ฐ์ ๋งฅ์์ AWS CLI ์ค์นํ๊ธฐ
AWS CLI version 2 ์ค์น
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-version.html
์๋์ฐ ๊ธฐ์ค > Windows > .msi ๋ค์ด๋ก๋
๋งฅ ๊ธฐ์ค > macOS > .pkg ๋ค์ด๋ก๋
Setup ํ์ผ ํด๋ฆญํด์ ๋ค์ด๋ก๋
์ค์น์๋ฃํ์ผ๋ฉด cmd ์ด๊ณ ์๋ ๋ช ๋ น์ด๋ก AWS CLI ๊ฐ ์ ์ค์น๋์๋์ง ํ์ธ
์ ์ค์น๋์์ผ๋ฉด ๋ฒ์ ์ ๋ณด๊ฐ ๋ฌ๋ค.
aws --version
๋ฒ์ ์ ๊ทธ๋ ์ด๋ ๋ฐฉ๋ฒ
- ๋ค์ msi / pkg ๋ค์ด๋ก๋ ๋งํฌ ๋๋ฌ์ ์ฌ์ค์น ํ๋ฉด ์๋์ผ๋ก ์ ๊ทธ๋ ์ด๋ ๋จ.
6. ๋ฆฌ๋ ์ค์์ AWS-CLI ์ค์นํ๋ ๋ฒ
์๋ ์ธ ๊ฐ์ง ๋ช ๋ น์ด๋ฅผ ์์ฐจ์ ์ผ๋ก ์ ๋ ฅํด์ ๋ค์ด ๋ฐ๊ธฐ
์์ถํ์ผ ๋ค์ด ๋ฐ๊ณ ์์ถํ์ผ ํ๊ณ , ๊ด๋ฆฌ์๊ถํ์ผ๋ก AWS ๋ค์ด
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
๋ฒ์ ์ ๊ทธ๋ ์ด๋ ๋ฐฉ๋ฒ
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
7. ์ค์ต
How to get AWS CLI Access key
IAM ์ ์ ๋ก ๋ก๊ทธ์ธ > IAM DashBoard > Users > Click your name > Security credentials > Create access key >
Use case - Command Line Interface(CLI) ์ ํ
Alternatives recommended ์ฐฝ์ด ๋จ์ง๋ง ์ด๊ฑธ๋ก ๋ง๋ค๋ฉด ๋ณต์กํ๋ฏ๋ก ๊ทธ๋ฅ CLI ์ฉ์ผ๋ก ์์ฑํด์ฃผ๋๋ก ํ๊ฒ ์
description tag ๋ ์ ํ์ฌํญ์ด๋ฏ๋ก Skip > Create access key
Download .csv file > Done
๋ช
๋ น ํ๋กฌํํธ๋ก ์ด๋
aws configure
AWS Access Key ID ์ ๋ ฅ
AWS Secret Access Key ์ ๋ ฅ
Default region name ์ ๋ ฅ
Default output format ์ ์ ๋ ฅ ์ ํด๋ ๋จ
์๋ ๋ช ๋ น์ด ์ ๋ ฅํ๋ฉด JSON ํ์์ผ๋ก ์ ์ ์ ๋ณด ์ถ๋ ฅ๋จ
์ด ๊ถํ์ AWS ๊ด๋ฆฌ ์ฝ์์์ ์ฃผ์ด์ง ๊ถํ๊ณผ ๊ฐ๋ค.
aws iam list-users
{
"Users": [
{
"Path": "/",
"UserName": "AdminUser",
"UserId": "AIDAEXAMPLE12345",
"Arn": "arn:aws:iam::123456789012:user/AdminUser",
"CreateDate": "2023-01-15T08:45:23Z"
},
{
"Path": "/",
"UserName": "DeveloperUser",
"UserId": "AIDAEXAMPLE67890",
"Arn": "arn:aws:iam::123456789012:user/DeveloperUser",
"CreateDate": "2023-03-22T10:12:34Z"
}
]
}
์ด ๋ช ๋ น์ด๋ฅผ ์คํํ๋ ค๋ฉด IAM ์ฌ์ฉ์ ๋๋ ์ญํ ์ iam:ListUsers ๊ถํ์ด ์์ด์ผ ํ๋ค.
๊ทธ๋ ์ง ์์ผ๋ฉด "Access Denied" ์ค๋ฅ๊ฐ ๋ฐ์ํจ
8. CLI ๋์ ์ฌ์ฉ๊ฐ๋ฅํ Cloud Shell
AWS CloudShell์ AWS ๊ด๋ฆฌ ์ฝ์์์ ๋ฐ๋ก ์ฌ์ฉํ ์ ์๋ ๋ธ๋ผ์ฐ์ ๊ธฐ๋ฐ ์ ธ ํ๊ฒฝ(=ํฐ๋ฏธ๋)์ด๋ค.
AWS ๋ฆฌ์์ค๋ฅผ ์ง์ ๊ด๋ฆฌํ๋ ๋ฐ ํ์ํ CLI(Command Line Interface) ๋๊ตฌ๋ค์ด ์ด๋ฏธ ์ค์น๋์ด ์์ด์
๋ณ๋์ ์ค์น ์์ด ์ฆ์ ์ฌ์ฉํ ์ ์๋ค.
๋จ, ๋ชจ๋ ์ง์ญ ์์ ์ฌ์ฉํ ์ ์๋ ๊ฒ์ ์๋
์ง์๋๋ Region ๋ชฉ๋ก์ ์๋ ํ์ด์ง์์ ํ์ธ ๊ฐ๋ฅ
https://docs.aws.amazon.com/cloudshell/latest/userguide/supported-aws-regions.html
๐ฅณ ํ๊ตญ์์๋ ์ฌ์ฉ ๊ฐ๋ฅ
AWS ๊ด๋ฆฌ ์ฝ์์ ๋ก๊ทธ์ธ
์ฝ์ ํ๋ฉด ์ฐ์ธก ์๋จ์ ์๋ CloudShell ์์ด์ฝ (์์ ์
ธ ๋ชจ์ ์์ด์ฝ)์ ํด๋ฆญ
8-1. Preferences ์ค์
์ฐ์ธก ์๋จ ์ค์ (ํฑ๋๋ฐํด ์์ด์ฝ)์์ ๊ฐ๋ฅํ ๊ฒ - Preferences ์ค์
- ํฐํธ ์ฌ์ด์ฆ
- ๋คํฌ/๋ผ์ดํธ ๋ชจ๋
- ์์ ํ๊ฒ ๋ถ์ฌ๋ฃ๊ธฐ
8-2. Download file ์ค์
Actions > Upload file, Download file ๊ฐ๋ฅ
ํ์ผ๋ค์ด๋ก๋ ๋ฐฉ๋ฒ
pwd ๋ก ํ์ฌ ์์ ๊ฒฝ๋ก ์ถ๋ ฅ ํ ๋ณต์ฌ
Action > Download file > ๊ฒฝ๋ก ๋ถ์ฌ๋ฃ๊ธฐ > ํ์ผ๋ช > Download
8-3. ํ ํ๋ฉด์ ํฐ๋ฏธ๋ ๋ถ๋ฆฌํด์ ๋ ๊ฐ ๋์ฐ๊ธฐ
Actions > New tab > Split into columns
'Coding > AWS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[AWS] ์ค์ต6์ผ์ฐจ - AWS ์์ฐ ๊ด๋ฆฌ Billing and Cost Managetment (setting Budget) (9) | 2025.01.22 |
---|---|
[AWS] ์ค์ต5์ผ์ฐจ - IAM & IAM CLI ๋ฌธ์ / ์ ๋ฆฌ (21) | 2025.01.21 |
[AWS] ์ค์ต4์ผ์ฐจ - AWS IAM ROLE, IAM ๋ณด์๋๊ตฌ ๋ฑ (14) | 2025.01.20 |
[AWS] ์ค์ต2์ผ์ฐจ - IAM: JSON ๊ตฌ์กฐ & IAM MFA (๋ค์ค์ธ์ฆ) (4) | 2025.01.16 |
[AWS] ์ค์ต1์ผ์ฐจ - IAM: Users & Groups (4) | 2025.01.15 |