JSCODE Logo
블로그후기멘토진
회사명 : JSCODE대표 : 박재성사업자 등록번호 : 244-22-01557통신판매업 : 제 2023-인천미추홀-0381 호
학원 명칭 : 제이에스코드(JSCODE)원격학원학원설립ㆍ운영 등록번호 : 제6063호

서울특별시 구로구 경인로 20가길 11(오류동, 아델리아)

Copyright ⓒ 2025 JSCODE - 최상위 현업 개발자들의 프로그래밍 교육 All rights reserved.

이용약관개인정보처리방침
← 블로그 목록으로 돌아가기

[실습] CodeDeploy 셋팅 / IAM 설정

JSCODE 박재성
JSCODE 박재성
2025-11-30T11:10:00Z
author
JSCODE 박재성
category
CI/CD
createdAt
Nov 30, 2025 11:10 AM
isPublic
series
비전공자도 이해할 수 있는 CI/CD 입문
slug
codedeploy-setup-and-iam-configuration
type
post
updatedAt

✅ 1. CodeDeploy 역할(Role) 생성하기

🧑🏻
Code Deploy가 다른 AWS Resource에 접근하려면 권한이 필요하다. 그 권한을 부여해주는 기능이 IAM의 역할(Role)이다.
notion image
notion image
notion image
notion image
notion image
 
 

✅ 2. CodeDeploy 생성하기

  1. CodeDeploy 애플리케이션 생성
    1. notion image
      notion image
 
  1. CodeDeploy 배포그룹 생성
    1. notion image
      notion image
      notion image
      notion image
 
 

✅ 3. EC2 역할(Role) 생성하기

🧑🏻
EC2가 빌드된 파일을 S3로부터 다운받아야 한다. 이 때, EC2가 S3에 접근하려면 권한이 필요하다. 그 권한을 부여해주는 기능이 IAM의 역할(Role)이다.
  1. 정책 생성
    1. notion image
 
  1. 권한 지정하기
    1. notion image
      { "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:Get*", "s3:List*" ], "Effect": "Allow", "Resource": "*" } ] }
 
  1. 정책 세부 설정
    1. notion image
 
  1. 역할 생성
    1. notion image
      notion image
      notion image
      notion image
 
 
  1. EC2에 생성한 IAM 역할 연결하기
    1. notion image
      • 참고) 혹시나 Code Deploy Agent를 먼저 설치한 뒤에 EC2에 IAM 역할을 부여했다면 EC2에서 아래 명령어로 codedeploy-agent를 재시작시켜주어야 한다.
        • $ sudo systemctl restart codedeploy-agent
          참고
          InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Missing credentials
          I'm trying to deploy a GitHub project to a EC2 Instance using AWS CodeDeploy. After following 2 video tutorials an a bunch of Google answer, I'm still getting the following error: 2017-02-01 12:20...
          InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Missing credentials
          https://stackoverflow.com/questions/41997426/instanceagentpluginscodedeployplugincommandpoller-missing-credentials
          InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Missing credentials
 
 

✅ 4. Code Deploy Agent 설치하기

🧑🏻
Code Deploy Agent가 다른 AWS Resource에 접근하려면 권한이 필요하다. 그 권한을 부여해주는 기능이 IAM의 역할(Role)이다.
Ubuntu Server용 CodeDeploy 에이전트 설치 - AWS CodeDeploy
이 사용 설명서에 따라 Amazon EC2 인스턴스 및 온프레미스에서 실행되는 인스턴스를 포함한 모든 인스턴스에 CodeDeploy를 사용하여 코드 배포를 자동화합니다.
Ubuntu Server용 CodeDeploy 에이전트 설치 - AWS CodeDeploy
https://docs.aws.amazon.com/ko_kr/codedeploy/latest/userguide/codedeploy-agent-operations-install-ubuntu.html
Ubuntu Server용 CodeDeploy 에이전트 설치 - AWS CodeDeploy
 
[Ubuntu 22.04. 기준]
$ sudo apt update && \ sudo apt install -y ruby-full wget && \ cd /home/ubuntu && \ wget https://aws-codedeploy-ap-northeast-2.s3.ap-northeast-2.amazonaws.com/latest/install && \ chmod +x ./install && \ sudo ./install auto
 
[Code Deploy Agent가 정상적으로 실행되고 있는 지 확인]
$ systemctl status codedeploy-agent
 
 

✅ 5. Github Actions가 CodeDeploy, S3에 접근할 수 있게 IAM 발급

  1. IAM 사용자 생성
    1. notion image
  1. 직접 정책 연결 (AWSCodeDeployFullAccess, AmazonS3FullAccess)
    1. notion image
      notion image
       
  1. 보안 자격 증명에 들어가서 액세스 키 만들기
    1. notion image
      notion image
      notion image
       
  1. 액세스 키와 비밀 액세스 키 잘 보관해두기
    1. notion image
 

✅ 6. Github Actions의 Secret Key에 저장해두기

notion image
 

✅ 7. 배포 전에 프로젝트 파일 저장할 S3 만들기

notion image
 
 
author
category
CI/CD
createdAt
Dec 6, 2025 12:45 AM
isPublic
series
비전공자도 이해할 수 있는 CI/CD 입문
slug
type
series-footer
updatedAt
📎
이 글은 비전공자도 이해할 수 있는 CI/CD 입문·실전 강의의 수업 자료 중 일부입니다.