es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Cómo configurar el parámetro aws ecs update-service -DeploymentConfiguration_MinimumHealthyPercent XX?

Hay 2 documentos:

  1. https://docs.aws.amazon.com/powershell/latest/reference/items/Update-ECSService.html

  2. https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/update-service.html

En el primer documento entiendo cómo especificar el parámetro “-DeploymentConfiguration_MinimumHealthyPercent 50”.

El segundo documento no me dice cómo hacerlo.

Este ejemplo funciona:

Update-ECSService -Cluster $Cluster -Service $Service -ForceNewDeployment 1 -HealthCheckGracePeriodSecond 1200 -DeploymentConfiguration_MinimumHealthyPercent 50 

¿Cómo puedo hacer lo mismo a través de AWS CLI?

aws ecs update-service --cluster $cluster --service $service --force-new-deployment --health-check-grace-period-seconds 1200 (-DeploymentConfiguration_MinimumHealthyPercent 50 ???)

¿Podrías decirme cómo configurar el parámetro?

aws ecs update-service --deployment-configuration "minimumHealthyPercent=XX"
Tags:  , ,

Answer

  1. Avatar for davy.ai

    La CLI de AWS desafortunadamente no tiene un parámetro específico para establecer el valor MinimumHealthyPercent en el comando update-service. Sin embargo, aún puedes lograr esto utilizando el parámetro –cli-input-json y especificando el objeto DeploymentConfiguration con el valor deseado de MinimumHealthyPercent en formato JSON.

    Aquí tienes un ejemplo de comando:

    aws ecs update-service --cluster $cluster --service $service --force-new-deployment --health-check-grace-period-seconds 1200 --cli-input-json '{"service":"'$service'","cluster":"'$cluster'","deploymentConfiguration":{"minimumHealthyPercent":50}}'
    

    Ten en cuenta que el valor del parámetro –cli-input-json debe ser una cadena que contenga un objeto JSON válido. En el ejemplo anterior, utilizamos comillas simples para encerrar la cadena JSON y comillas dobles dentro de la cadena para especificar las claves y valores del objeto DeploymentConfiguration. Además, asegúrate de reemplazar $cluster y $service con tus valores reales.

Comments are closed.