eb migrate - AWS Elastic Beanstalk

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

eb migrate

설명

인터넷 정보 서비스(IIS) 사이트 및 애플리케이션을 Windows 서버에서 Elastic Beanstalk로 마이그레이션합니다. 이 명령은 애플리케이션을 패키징하고, 구성을 보존하고, 새 Elastic Beanstalk 환경에 배포합니다.

IIS 사이트 및 애플리케이션 마이그레이션에 대한 자세한 내용은 섹션을 참조하세요IIS 애플리케이션을 Elastic Beanstalk로 마이그레이션.

참고

이 명령을 사용하기 전에 시스템이 다음 요구 사항을 충족하는지 확인합니다.

  • IIS(인터넷 정보 서비스) 버전 7.0 이상

  • Web Deploy 3.6 이상 설치됨

  • Windows 서버에 대한 관리 권한

  • AWS 적절한 권한으로 구성된 자격 증명

  • 소스 서버에는 AWS 서비스에 대한 아웃바운드 인터넷 액세스 권한이 있습니다.

다음 단계에서는 마이그레이션 프로세스를 요약합니다.

  1. IIS 사이트 및 해당 구성을 알아봅니다.

  2. 애플리케이션 콘텐츠 및 구성을 패키징합니다.

  3. Elastic Beanstalk 환경 및 애플리케이션을 생성합니다.

  4. 보존된 설정으로 애플리케이션을 배포합니다.

이 명령은 다음 목록과 같이 구조화된 디렉터리에 마이그레이션 아티팩트를 생성합니다.

C:\migration_workspace\ └── .\migrations\latest\ ├── upload_target.zip └── upload_target\ ├── [SiteName].zip # One ZIP per default application of IIS site ├── [SiteName-ApplicationName].zip # One ZIP per additional application ├── aws-windows-deployment-manifest.json └── ebmigrateScripts\ ├── site_installer.ps1 # Site installation scripts ├── permission_handler.ps1 # Permission management └── other helper scripts

eb migrate cleanup를 사용하여 이러한 아티팩트를 관리합니다.

구문

eb migrate [options]

eb migrate explore [options]

eb migrate cleanup [options]

인수 없이 실행하면가 비대화형 모드로 eb migrate 작동합니다. 대화형 모드에서 실행하려면를 실행합니다eb migrate --interactive.

대화형 모드 명령은 다음 정보를 묻는 메시지를 표시합니다.

  • 마이그레이션할 IIS 사이트 선택

  • 환경 및 애플리케이션 이름

  • 플랫폼 버전 선택

  • 인스턴스 유형 및 기타 구성 옵션

하위 명령

explore

eb migrate explore 하위 명령은 IIS 서버를 검사하고 사용 가능한 사이트를 나열합니다.

이 명령을 사용하여 다음 정보를 표시합니다.

  • 서버의 모든 IIS 사이트 보기

  • 를 사용하여 다음을 포함한 세부 구성을 --verbose검사합니다.

    • 사이트 바인딩 및 포트

    • 애플리케이션 풀

    • 가상 디렉터리 및 물리적 경로

    • 인증 설정

PS C:\migrations_workspace > eb migrate explore Default Web Site Site2 site3 router
PS C:\migrations_workspace > eb migrate explore --verbose 1: Default Web Site: - Bindings: - *:8083: - Application '/': - Application Pool: DefaultAppPool - Enabled Protocols: http - Virtual Directories: - /: - Physical Path: C:\inetpub\wwwroot - Logon Method: ClearText - Application '/dotnet-6-0': - Application Pool: DefaultAppPool - Enabled Protocols: http - Virtual Directories: - /: - Physical Path: C:\inetpub\AspNetCoreWebApps\CoreWebApp-6-0 - Logon Method: ClearText - Application '/dotnet-8-0': - Application Pool: DefaultAppPool - Enabled Protocols: http - Virtual Directories: - /: - Physical Path: C:\inetpub\AspNetCoreWebApps\CoreWebApp-8-0 - Logon Method: ClearText 2: Site2: - Bindings: - *:8081: ...

정리

eb migrate cleanup 하위 명령은 다음 작업을 통해 마이그레이션 아티팩트를 관리합니다.

  • 에서 가장 최근에 성공한 마이그레이션 보존 ./migrations/latest

  • 이전 마이그레이션 디렉터리 제거

  • 중요한 구성 파일 유지 관리

PS C:\migrations_workspace > eb migrate cleanup Are you sure you would like to cleanup older artifacts within `./migrations/`? (y/N):

--force를 사용하여 정리 중에 확인 프롬프트를 건너뜁니다.

PS C:\migrations_workspace > eb migrate cleanup --force

옵션

이러한 옵션이 필요하지 않습니다. 옵션 eb migrate 없이를 실행하면 EB CLI가 비대화형 모드에서 실행됩니다. eb migrate --interactive를 사용하면 EB CLI에 필수 설정 값을 입력하거나 선택하라는 메시지가 표시됩니다.

명칭

설명

-a application-name

or

--application-name application-name

새 Elastic Beanstalk 애플리케이션의 이름입니다.

유형: 문자열

기본값: EBMigratedApp

--archive directory-or-zip

이전에에서 생성한 소스 코드가 포함된 디렉터리 또는 ZIP 파일입니다eb migrate --archive-only.

이전에 생성한 마이그레이션 패키지를 배포하려면이 옵션을 사용합니다.

예: --archive .\migrations\latest\upload_target 또는 --archive .\migrations\latest\upload_target.zip

-ao

or

--archive-only

배포 없이 대상 아카이브 디렉터리만 생성합니다.

결과 디렉터리는 또는 archive 옵션과 eb migrate 함께를 사용하여 수동으로 배포할 수 있습니다eb deploy.

-c subdomain-name

또는

--cname subdomain-name

마이그레이션된 애플리케이션의 CNAME DNS 항목에 접두사를 붙일 하위 도메인 이름입니다.

유형: 문자열

기본값: 환경 이름

-cf

or

--copy-firewall-config

활성 바인딩이 있는 모든 HTTP 포트의 대상에 소스 서버 방화벽 구성을 복사합니다.

에서 해당 보안 그룹 규칙을 생성합니다 AWS.

-es snapshot-id [snapshot-id ...]

or

--ebs-snapshots snapshot-id [snapshot-id ...]

환경과 연결할 Amazon EBS 스냅샷 IDs의 쉼표로 구분된 목록입니다.

예시: --ebs-snapshots snap-1234567890abcdef0, snap-0987654321fedcba1

--encrypt-ebs-volumes

모든 새 Amazon EBS 볼륨에 암호화를 적용합니다.

중요

이는 향후 모든 Amazon EBS 볼륨 생성에 영향을 미치는 계정 전체 설정입니다.

-e environment-name

or

--environment-name environment-name

새 Elastic Beanstalk 환경의 이름입니다.

유형: 문자열

기본값: EBMigratedEnv

제약 조건: 길이가 4~40자여야 합니다. 문자, 숫자 및 하이픈만 포함할 수 있습니다. 하이픈으로 시작되거나 끝날 수 없습니다.

--force

작업 중에 확인 프롬프트를 건너뜁니다.

cleanup 하위 명령과 함께 사용할 경우는 확인 없이 마이그레이션 아티팩트를 제거합니다.

-ip profile-name

or

--instance-profile profile-name

환경의 Amazon EC2 인스턴스와 연결할 인스턴스 프로파일입니다.

지정하지 않으면는 Elastic Beanstalk 리소스에 액세스할 수 있는 권한이 있는 기본 인스턴스 프로파일을 생성합니다. 자세한 내용은 Elastic Beanstalk 인스턴스 프로파일 단원을 참조하십시오.

-i 인스턴스 유형

or

--instance-type 인스턴스 유형

Elastic Beanstalk 환경의 Amazon EC2 인스턴스 유형입니다.

유형: 문자열

기본값: c5.2xlarge

사용 가능한 인스턴스 유형은 Amazon EC2 사용 설명서의 Amazon EC2 인스턴스 유형을 참조하세요. Amazon EC2

-in

or

--interactive

마이그레이션 프로세스를 위한 강제 대화형 모드입니다.

기본값을 사용할 수 있는 경우에도 구성 값을 묻는 메시지가 표시됩니다.

-k 키 이름

or

--keyname key-name

환경 인스턴스에 대한 RDP 액세스를 활성화하는 Amazon EC2 키 페어입니다.

로그에 표시되지 않는 인스턴스 수준 문제를 조사하는 데 유용합니다.

유효한 값: Amazon EC2에 등록된 기존 키 페어 이름

-p platform-version

또는

--platform platform-version

환경을 위한 Elastic Beanstalk 플랫폼 런타임입니다. 지정하지 않으면 호스트 Windows Server 버전에서 자동으로 감지됩니다.

예시: "64bit Windows Server 2016 v2.16.2 running IIS 10.0"

사용 가능한 플랫폼 버전 목록은 eb 플랫폼 목록을 사용합니다.

--remote

원격 모드에서 마이그레이션을 실행함을 나타냅니다. 이 옵션을 사용하면 Elastic Beanstalk로 마이그레이션할 애플리케이션 및 구성이 포함된 대상 서버에 연결되는 접속 호스트에서 실행할 수 있습니다. 접속 서버에서 실행하여 구성을 eb migrate 검색하고 접속 호스트에서 마이그레이션 로직을 스테이징한 다음 애플리케이션을 새 Elastic Beanstalk 환경에 배포합니다.

이 옵션을 사용하면 마이그레이션해야 하는 Windows 서버에 EB CLI 및 Python을 설치할 필요가 없습니다. 대신 Bastion Host에 Python 및 EB CLI를 설치하여 --remote 옵션으로 eb migrate 명령을 실행합니다. --target-ip 옵션을 사용하여 마이그레이션할 IIS 구성이 있는 호스트를 지정합니다.

--target-ip, --username및와 함께 사용해야 합니다--password.

--target-ip IP 주소

마이그레이션할 IIS 서버가 포함된 원격 Windows 시스템의 퍼블릭 IP 주소입니다.

를 사용할 때 필요합니다--remote. 를 사용할 때만 지정할 수 있습니다--remote.

--username username

마이그레이션할 IIS 서버가 포함된 원격 Windows 시스템에 액세스하기 위한 사용자 프로필의 사용자 이름입니다.

를 사용할 때 필요합니다--remote. 를 사용할 때만 지정할 수 있습니다--remote.

--password 암호

마이그레이션할 IIS 서버가 포함된 원격 Windows 시스템에 액세스하기 위한 사용자 프로필의 암호입니다.

를 사용할 때 필요합니다--remote. 를 사용할 때만 지정할 수 있습니다--remote.

-sr role-name

or

--service-role role-name

관련 서비스를 관리하기 위한 Elastic Beanstalk의 IAM AWS 서비스 역할입니다.

지정하지 않으면는 필요한 권한이 있는 기본 서비스 역할을 생성합니다. 자세한 내용은 Elastic Beanstalk 서비스 역할 단원을 참조하십시오.

참고

전체 ARN이 아닌 역할 이름만 지정합니다. Elastic Beanstalk는 자동으로 전체 ARN을 생성합니다.

-s site-names

or

--sites site-names

마이그레이션할 IIS 사이트의 쉼표로 구분된 목록입니다. 지정하지 않으면는 서버에서 사용 가능한 모든 사이트를 마이그레이션합니다.

예시: --sites "Default Web Site,Intranet,API"

--ssl-certificates certificate-arn[,certificate-arn ...]

Application Load Balancer와 연결할 ACM SSL 인증서 ARNs의 쉼표로 구분된 목록입니다.

HTTPS 바인딩으로 사이트를 마이그레이션할 때 필요합니다.

예시: --ssl-certificates arn:aws:acm:region:account:certificate/certificate-id

-t key1=value1[,key2=value2 ...]

or

--tags key1=value1[,key2=value2 ...]

환경의 새 리소스에 태그를 지정하기 위한 쉼표로 구분된 key=value 페어 목록: 환경, Elastic Beanstalk 애플리케이션, 애플리케이션 버전.

자세한 내용은 환경에 태그 지정 단원을 참조하십시오.

--verbose

마이그레이션 프로세스 중에 자세한 정보를 표시합니다.

explore 하위 명령과 함께 사용할 경우는 포괄적인 사이트 구성 세부 정보를 표시합니다.

-vpc config-file-or-string

or

--vpc-config config-file-or-string

환경에 대한 VPC 구성으로, JSON 파일 경로 또는 JSON 문자열로 지정됩니다.

구성에는 다음이 포함되어야 합니다.

{ "id": "vpc-1234567890abcdef0", "publicip": "true|false", "elbscheme": "public|private", "ec2subnets": ["subnet-a1b2c3d4", "subnet-e5f6g7h8"], "securitygroups": "sg-123456,sg-789012", "elbsubnets": ["subnet-a1b2c3d4", "subnet-e5f6g7h8"] }
  • id: (필수) VPC 식별자

  • publicip: 인스턴스에 퍼블릭 IPs 할당할지 여부

  • elbscheme: 로드 밸런서 체계(퍼블릭 또는 프라이빗)

  • ec2subnets: EC2 인스턴스의 서브넷 IDs 목록

  • securitygroups: 쉼표로 구분된 보안 그룹 IDs

  • elbsubnets: 로드 밸런서의 서브넷 IDs 목록

중요

마이그레이션은 파라미터를 지정할 때 소스 환경의 기존 VPC 설정을 무시합니다--vpc-config. 이 파라미터를 사용하면 마이그레이션은 전달하려는 구성 파일에 지정된 VPC 설정만 사용합니다. 이 파라미터를 사용하면 소스 인스턴스의 VPC 구성을 검색하거나 기본 VPC를 사용하는 기본 동작이 재정의됩니다.

일반 옵션

출력

명령은 마이그레이션 프로세스 전반에 걸쳐 상태 업데이트를 제공합니다.

  1. VPC 구성 감지(EC2 인스턴스에서 실행되는 경우)

  2. 각 사이트에 대한 소스 번들 생성 진행 상황

  3. 환경 생성 상태

  4. 배포 진행 중

성공하면는 다음을 포함한 새 환경의 세부 정보를 표시합니다.

  • 환경 이름 및 ID

  • 애플리케이션 이름

  • 리전

  • 플랫폼 버전

  • 환경 CNAME

마이그레이션 중 발생하는 문제의 경우 eb eventseb health 명령을 사용하여 자세한 정보를 가져옵니다.

예시

기본 사용법

대화형 모드의 기본 마이그레이션:

PS C:\migrations_workspace > eb migrate Identifying VPC configuration of this EC2 instance (i-0123456789abcdef0): id: vpc-1234567890abcdef0 publicip: true elbscheme: public ec2subnets: subnet-123,subnet-456,subnet-789 securitygroups: sg-123,sg-456 elbsubnets: subnet-123,subnet-456,subnet-789 Using .\migrations\latest to contain artifacts for this migration run. Generating source bundle for sites, applications, and virtual directories... Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip Creating application version Creating environment Environment details for: EBMigratedEnv Application name: EBMigratedApp Region: us-west-2 Deployed Version: app-230320_153045 Environment ID: e-abcdef1234 Platform: 64bit Windows Server 2019 v2.7.0 running IIS 10.0 Tier: WebServer-Standard-1.0 CNAME: ebmigratedenv.us-west-2.elasticbeanstalk.com Updated: 2023-03-20 15:30:45

사용자 지정 구성으로 특정 사이트 마이그레이션:

PS C:\migrations_workspace > eb migrate ` --sites "Default Web Site,InternalAPI" ` --application-name "CorporateApp" ` --environment-name "Production" ` --instance-type "c5.xlarge" ` --tags "Environment=Production,Team=WebOps" ` --copy-firewall-config

배포 없이 마이그레이션 아카이브 생성:

PS C:\migrations_workspace > eb migrate --archive-only Using .\migrations\latest to contain artifacts for this migration run. Generating source bundle for sites, applications, and virtual directories... Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip Generated destination archive directory at .\migrations\latest\upload_target You can execute `eb init` and `eb create` from this directory to deploy to EB.

고급 구성 예제

JSON 파일을 사용한 사용자 지정 VPC 구성으로 마이그레이션:

PS C:\migrations_workspace > cat vpc-config.json { "id": "vpc-1234567890abcdef0", "publicip": "false", "elbscheme": "internal", "ec2subnets": [ "subnet-private1", "subnet-private2" ], "securitygroups": [ "sg-app", "sg-database", "sg-monitoring" ], "elbsubnets": [ "subnet-private1", "subnet-private2" ] } PS C:\migrations_workspace eb migrate ` --sites "InternalAPI" ` --vpc-config vpc-config.json ` --instance-type "r5.xlarge" ` --tags "Environment=Internal,Security=High"

SSL 인증서 및 호스트 헤더를 사용하여 사이트 마이그레이션:

PS C:\migrations_workspace > eb migrate ` --sites "SecurePortal" ` --ssl-certificates "arn:aws:acm:region:account:certificate/cert1,arn:aws:acm:region:account:certificate/cert2" ` --verbose INFO: Detected HTTPS bindings: - www.example.com:443 - api.example.com:443 INFO: Configuring Application Load Balancer with SSL certificates INFO: Creating host-based routing rules: - www.example.com -> target group 1 - api.example.com -> target group 2

EBS 스냅샷 구성을 사용한 마이그레이션:fo

PS C:\migrations_workspace > eb migrate ` --sites "Default Web Site" ` --ebs-snapshots "snap-1234567890abcdef0" "snap-0987654321fedcba1" ` --encrypt-ebs-volumes Using .\migrations\latest to contain artifacts for this migration run. INFO: Enabling EBS encryption for all new volumes in us-west-2 INFO: Configuring environment with specified EBS snapshots

보안 구성 예제

복잡한 방화벽 규칙이 있는 사이트 처리:

PS C:\migrations_workspace > eb migrate ` --sites "Default Web Site,ReportingService" ` --copy-firewall-config ` --verbose INFO: Detected the following Windows Firewall rules: - Allow Web Traffic (TCP 80, 443) - Allow Reporting Traffic (TCP 8081) INFO: Creating corresponding security group rules

사용자 지정 IAM 역할을 사용한 마이그레이션:

PS C:\migrations_workspace > eb migrate ` --sites "SecureApp" ` --instance-profile "CustomInstanceProfile" ` --service-role "CustomServiceRole"

원격 실행 예제

원격 Windows 서버에서 IIS 애플리케이션 마이그레이션:

PS C:\migrations_workspace > eb migrate ` --remote ` --target-ip "192.0.2.10" ` --username "administrator" ` --password "YourPassword123" ` --application-name "RemoteApp" ` --environment-name "RemoteEnv" INFO: Establishing SSH connection to remote host 192.0.2.10... INFO: Connection established INFO: Discovering IIS sites on remote host... INFO: Found 2 sites: Default Web Site, API INFO: Extracting site configurations... INFO: Generating source bundle for sites, applications, and virtual directories... Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip API/ -> .\migrations\latest\upload_target\API.zip Creating application version Creating environment Environment details for: RemoteEnv Application name: RemoteAppstage mi Region: us-west-2 Deployed Version: app-230320_153045 Environment ID: e-abcdef1234 Platform: 64bit Windows Server 2019 v2.7.0 running IIS 10.0 Tier: WebServer-Standard-1.0 CNAME: remoteenv.us-west-2.elasticbeanstalk.com Updated: 2023-03-20 15:30:45

특정 사이트 선택이 포함된 원격 마이그레이션:

PS C:\migrations_workspace > eb migrate ` --remote ` --target-ip "192.0.2.10" ` --username "administrator" ` --password "YourPassword123" ` --sites "API" ` --instance-type "c5.large"