Advise on Creating a Custom AMI from an Existing Beanstalk-Managed EC2 Instance

0

Hello,

I have an IIS application based on a Windows Server 2019 image. It is a single EC2 instance managed by Elastic Beanstalk. I'm looking to create a custom AMI based on this existing EC2 instance to provide the ability to auto-scale our Beanstalk environment as needed in the future.

Constraints:

  • This is a production environment so I'm trying to minimize downtime - a few minutes is fine but I definitely can't have a prolonged outage
  • Need to be able to retrieve passwords for the individual instances for RDP in the event that I need to view logs

I'm looking for advice on the procedures/best practices I should follow for safely doing this. For example, should I run Sysprep? The AWS docs say not to, for a production system, but I've had issues in the past with being unable retrieve passwords for custom AMIs, and was told that it may have been due to not running Sysprep.

Thanks!

已提問 2 年前檢視次數 578 次
1 個回答
0

As you are currently running a single instance, beanstalk performs an in-place update when you update your application versions, and as such your application might become unavailable for a short period of time. To avoid this considered switching deployment strategies to better support future needs. For example, with a blue/green approach all you would need to do is swap the CNAMEs of the two environments to redirect to the new version instantly.

There are some caveats in that the your environment must run independently of any beanstalk provisioned database.

Refer to Blue/Green deployments with Elastic Beanstalk

The following table compares deployment method properties.

MethodImpact of failed deploymentDeploy timeZero downtimeNo DNS changeRollback processCode deployed to
All at onceDowntime*NoYesManual redeployExisting instances
RollingSingle batch out of service; any successful batches before failure running new application version**YesYesManual redeployExisting instances
Rolling with an additional batchMinimal if first batch fails; otherwise, similar to Rolling***YesYesManual redeployNew and existing instances
ImmutableMinimal****YesYesTerminate new instancesNew instances
Traffic splittingPercentage of client traffic routed to new version temporarily impacted****YesYesReroute traffic and terminate new instancesNew instances
Blue/greenMinimal****YesNoSwap URLNew instances
RoB
已回答 2 年前
  • Thanks for the response - this is good info. Basically our goal is to move towards the rolling deployment strategy to minimize downtime and allow scalability in the future. At this point my question is primarily about how to go about creating an AMI that will be appropriate for this configuration (eg the AMI creation process).

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南