DEV Community

Jinseok
Jinseok

Posted on • Updated on

Elastic Beanstalk에서 플랫폼과 버전 동시에 업데이트

엘라스틱 빈즈토크는 이용할 때 아쉬운 점이 있었다. 바로 플랫폼 업데이트나 어플리케이션 버전 업데이트가 동시에 안되는 것이다.

환경 URL 교체라는 기능이 있지만 스테이지stage버전과 프로덕션production의 데이터베이스를 다르게 사용하는데, 이 부분을 어떻게 처리해야할지 고민하다 이직하면서 잊혀졌다.

그래서 플랫폼과 앱 버전을 동시에 업데이트 하는 방법을 설명하면

1. AWS CLI 설치


2. 명령어 입력

aws elasticbeanstalk update-environment --environment-id [환경 식별자] --version-label [버전명] --solution-stack-name [플랫폼]

예를들면 다음과 같다.

$ aws elasticbeanstalk update-environment --environment-id e-abcdefghij --version-label "20210828-2" --solution-stack-name "64bit Amazon Linux 2 v3.3.4 running Ruby 2.7"
Enter fullscreen mode Exit fullscreen mode


env.yaml

어떤 플랫폼을 사용할지 지정할 수 있다. 루트에 env.yaml파일을 생성하고 설정할 수 있다.
다음처럼 만들 수 있다.

AWSConfigurationTemplateVersion: 1.1.0.0
SolutionStack: 64bit Amazon Linux 2 v3.4.2 running Ruby 3.0
Enter fullscreen mode Exit fullscreen mode

번외. 애플리케이션 버전 추가하기

https://aws.amazon.com/blogs/devops/creating-deployable-app-archives-for-elastic-beanstalk/

$ git archive --format=zip HEAD > myapp.zip
Enter fullscreen mode Exit fullscreen mode

Top comments (0)