AWS IAM 보안 인증 - VS 코드용 AWS 도구 키트

AWS IAM 보안 인증

AWS IAM 보안 인증은 AWS 계정으로 로컬에 저장된 액세스 키를 통해 인증됩니다.

다음 섹션에서는 AWS Toolkit for Visual Studio Code에서 AWS 계정 인증을 받기 위해 IAM 보안 인증을 구성하는 방법을 설명합니다.

중요

AWS 계정 인증을 위한 IAM 보안 인증을 설정하기 전에 다음 사항에 유의하세요.

  • 다른 AWS 서비스(예: AWS CLI)를 통해 IAM 보안 인증을 설정한 경우 AWS Toolkit for Visual Studio Code는 자동으로 해당 보안 인증을 감지하므로 VS Code를 사용할 수 있습니다.

  • AWS는 IAM Identity Center 인증 사용을 권장합니다. AWS IAM 모범 사례에 대한 추가 정보는 AWS Identity and Access Management 사용 설명서의 Security best practice in IAM(IAM 보안 모범 사례) 섹션을 참조하세요.

  • 보안 사고를 방지하려면 특수 목적 소프트웨어 개발 또는 실제 데이터로 작업할 때 IAM 사용자로 인증하지 마세요. 대신 AWS IAM Identity Center 사용 설명서What is IAM Identity Center?와 같은 ID 제공자의 페더레이션을 사용합니다.

IAM 사용자 생성

AWS 계정으로 AWS Toolkit for Visual Studio Code를 인증하도록 설정하려면 1단계: IAM 사용자를 생성하고, 2단계: 액세스 키AWS SDKs and Tools Reference GuideAuthenticate using long-term credentials에서 가져와야 합니다.

참고

3단계: AWS SDKs and Tools Reference Guide에서 공유 보안 인증 파일 업데이트하는 것은 선택 사항입니다.

3단계를 완료하면 아래 위치에 있는AWS Toolkit for Visual Studio Code에서 공유 보안 인증 파일 생성에서 AWS Toolkit for Visual Studio Code는 보안 인증을 검색합니다.

3단계를 완료하지 않으면 AWS Toolkit for Visual Studio Code은 아래 AWS Toolkit for Visual Studio Code에서 공유 보안 인증 파일 생성에서 설명한대로 credentials file 생성 과정을 안내합니다.

AWS Toolkit for Visual Studio Code에서 공유 보안 인증 파일 생성

AWS 계정 구성 및 보안 인증 정보는 공유 구성 파일공유 보안 인증 파일에 저장됩니다. 공유 구성 및 보안 인증에 대한 자세한 내용은 AWS Command Line Interface 사용 설명서Where are configuration settings stored?(구성 설정은 어디에 저장됩니까?) 섹션을 참조하세요.

AWS Toolkit for Visual Studio Code에서 공유 보안 인증 파일 생성
  1. VS Code에서 Shift+Command+P (Ctrl+Shift+P Windows)를 눌러 command pallet를 열고 검색 필드에 AWS: Add a New Connection을 입력하면 Connect to AWS new connection User interface (UI)가 실행됩니다.

  2. Connect to AWS new connection UI에서 AWS 탐색기: 보기, 수정, AWS 리소스 배포를 선택합니다.

  3. AWS 탐색기: 보기, 수정, AWS 리소스 배포 보기에서 IAM 사용자 자격 증명을 확장하거나 추가합니다.

  4. IAM 자격 증명 양식에서 Profile Name, Access Key, and Secret Key를 입력한 다음 Add profile을 선택하여 credentials 파일에 정보를 추가합니다.

  5. 도구 키트가 AWS 계정에 연결되면 Visual Studio Code Explorer가 AWS 계정 리소스에 업데이트됩니다.

참고

이것은 [Profile_Name]의 구문 오류로 인해 인증이 실패한 예시입니다.

[Profile_Name] xaws_access_key_id= AKIAI44QH8DHBEXAMPLE xaws_secret_access_key= wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

다음은 인증 오류로 생성된 로그 메시지의 예입니다.

2022-11-02 22:01:54 [ERROR]: Profile [Profile_Name] is not a valid Credential Profile: not supported by the Toolkit 2022-11-02 22:01:54 [WARN]: Shared Credentials Profile [Profile_Name] is not valid. It will not be used by the toolkit.

자격 증명 프로필 추가

구성 파일에 여러 자격 증명을 추가할 수 있습니다. 추가 하려면 Command Palette를 열고 AWS Toolkit Create Credentials Profile을 선택하세요. 그러면 자격 증명 파일이 열립니다. 다음 예와 같이 이 페이지에서 첫 번째 프로필 아래에 새 프로필을 추가할 수 있습니다.

# Amazon Web Services Credentials File used by AWS CLI, SDKs, and tools # This file was created by the AWS Toolkit for Visual Studio Code extension. # # Your AWS credentials are represented by access keys associated with IAM users. # For information about how to create and manage AWS access keys for a user, see: # https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html # # This credential file can store multiple access keys by placing each one in a # named "profile". For information about how to change the access keys in a # profile or to add a new profile with a different access key, see: # https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html # [Profile1_Name] # The access key and secret key pair identify your account and grant access to AWS. aws_access_key_id = AKIAIOSFODNN7EXAMPLE # Treat your secret key like a password. Never share your secret key with anyone. Do # not post it in online forums, or store it in a source control system. If your secret # key is ever disclosed, immediately use IAM to delete the access key and secret key # and create a new key pair. Then, update this file with the replacement key details. aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY [Profile2_Name] aws_access_key_id = AKIAI44QH8DHBEXAMPLE aws_secret_access_key = je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY