Note:

You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . ecs ]

update-express-gateway-service

Description

Updates an existing Express service configuration. Modifies container settings, resource allocation, auto-scaling configuration, and other service parameters without recreating the service.

Amazon ECS creates a new service revision with updated configuration and performs a rolling deployment to replace existing tasks. The service remains available during updates, ensuring zero-downtime deployments.

Some parameters like the infrastructure role cannot be modified after service creation and require creating a new service.

See also: AWS API Documentation

Synopsis

  update-express-gateway-service
--service-arn <value>
[--execution-role-arn <value>]
[--health-check-path <value>]
[--primary-container <value>]
[--task-role-arn <value>]
[--network-configuration <value>]
[--cpu <value>]
[--memory <value>]
[--scaling-target <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]

Options

--service-arn (string)

The Amazon Resource Name (ARN) of the Express service to update.

--execution-role-arn (string)

The Amazon Resource Name (ARN) of the task execution role for the Express service.

--health-check-path (string)

The path on the container for Application Load Balancer health checks.

--primary-container (structure)

The primary container configuration for the Express service.

image -> (string)

The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest .

For Express services, the image typically contains a web application that listens on the specified container port. The image can be stored in Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.

containerPort -> (integer)

The port number on the container that receives traffic from the load balancer. Default is 80.

awsLogsConfiguration -> (structure)

The log configuration for the container.

logGroup -> (string)

The name of the CloudWatch Logs log group to send container logs to.

logStreamPrefix -> (string)

The prefix for the CloudWatch Logs log stream names. The default for an Express service is ecs .

repositoryCredentials -> (structure)

The configuration for repository credentials for private registry authentication.

credentialsParameter -> (string)

The Amazon Resource Name (ARN) of the secret containing the private repository credentials.

command -> (list)

The command that is passed to the container.

(string)

environment -> (list)

The environment variables to pass to the container.

(structure)

A key-value pair object.

name -> (string)

The name of the key-value pair. For environment variables, this is the name of the environment variable.

value -> (string)

The value of the key-value pair. For environment variables, this is the value of the environment variable.

secrets -> (list)

The secrets to pass to the container.

(structure)

An object representing the secret to expose to your container. Secrets can be exposed to a container in the following ways:

  • To inject sensitive data into your containers as environment variables, use the secrets container definition parameter.
  • To reference sensitive information in the log configuration of a container, use the secretOptions container definition parameter.

For more information, see Specifying sensitive data in the Amazon Elastic Container Service Developer Guide .

name -> (string)

The name of the secret.

valueFrom -> (string)

The secret to expose to the container. The supported values are either the full ARN of the Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store.

For information about the require Identity and Access Management permissions, see Required IAM permissions for Amazon ECS secrets (for Secrets Manager) or Required IAM permissions for Amazon ECS secrets (for Systems Manager Parameter store) in the Amazon Elastic Container Service Developer Guide .

Note

If the SSM Parameter Store parameter exists in the same Region as the task you’re launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.

Shorthand Syntax:

image=string,containerPort=integer,awsLogsConfiguration={logGroup=string,logStreamPrefix=string},repositoryCredentials={credentialsParameter=string},command=string,string,environment=[{name=string,value=string},{name=string,value=string}],secrets=[{name=string,valueFrom=string},{name=string,valueFrom=string}]

JSON Syntax:

{
  "image": "string",
  "containerPort": integer,
  "awsLogsConfiguration": {
    "logGroup": "string",
    "logStreamPrefix": "string"
  },
  "repositoryCredentials": {
    "credentialsParameter": "string"
  },
  "command": ["string", ...],
  "environment": [
    {
      "name": "string",
      "value": "string"
    }
    ...
  ],
  "secrets": [
    {
      "name": "string",
      "valueFrom": "string"
    }
    ...
  ]
}

--task-role-arn (string)

The Amazon Resource Name (ARN) of the IAM role for containers in this task.

--network-configuration (structure)

The network configuration for the Express service tasks. By default, the network configuration for an Express service uses the default VPC.

securityGroups -> (list)

The IDs of the security groups associated with the Express service.

(string)

subnets -> (list)

The IDs of the subnets associated with the Express service.

(string)

Shorthand Syntax:

securityGroups=string,string,subnets=string,string

JSON Syntax:

{
  "securityGroups": ["string", ...],
  "subnets": ["string", ...]
}

--cpu (string)

The number of CPU units used by the task.

--memory (string)

The amount of memory (in MiB) used by the task.

--scaling-target (structure)

The auto-scaling configuration for the Express service.

minTaskCount -> (integer)

The minimum number of tasks to run in the Express service.

maxTaskCount -> (integer)

The maximum number of tasks to run in the Express service.

autoScalingMetric -> (string)

The metric used for auto-scaling decisions. The default metric used for an Express service is CPUUtilization .

autoScalingTargetValue -> (integer)

The target value for the auto-scaling metric. The default value for an Express service is 60.

Shorthand Syntax:

minTaskCount=integer,maxTaskCount=integer,autoScalingMetric=string,autoScalingTargetValue=integer

JSON Syntax:

{
  "minTaskCount": integer,
  "maxTaskCount": integer,
  "autoScalingMetric": "AVERAGE_CPU"|"AVERAGE_MEMORY"|"REQUEST_COUNT_PER_TARGET",
  "autoScalingTargetValue": integer
}

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

Output

service -> (structure)

The full description of your express gateway service following the update call.

serviceArn -> (string)

The ARN of the Express service that is being updated.

cluster -> (string)

The cluster associated with the Express service that is being updated.

serviceName -> (string)

The name of the Express service that is being updated.

status -> (structure)

The status of the Express service that is being updated.

statusCode -> (string)

The status of the Express service.

statusReason -> (string)

Information about why the Express service is in the current status.

targetConfiguration -> (structure)

The configuration to which the current Express service is being updated to.

serviceRevisionArn -> (string)

The ARN of the service revision.

executionRoleArn -> (string)

The ARN of the task execution role for the service revision.

taskRoleArn -> (string)

The ARN of the task role for the service revision.

cpu -> (string)

The CPU allocation for tasks in this service revision.

memory -> (string)

The memory allocation for tasks in this service revision.

networkConfiguration -> (structure)

The network configuration for tasks in this service revision.

securityGroups -> (list)

The IDs of the security groups associated with the Express service.

(string)

subnets -> (list)

The IDs of the subnets associated with the Express service.

(string)

healthCheckPath -> (string)

The health check path for this service revision.

primaryContainer -> (structure)

The primary container configuration for this service revision.

image -> (string)

The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest .

For Express services, the image typically contains a web application that listens on the specified container port. The image can be stored in Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.

containerPort -> (integer)

The port number on the container that receives traffic from the load balancer. Default is 80.

awsLogsConfiguration -> (structure)

The log configuration for the container.

logGroup -> (string)

The name of the CloudWatch Logs log group to send container logs to.

logStreamPrefix -> (string)

The prefix for the CloudWatch Logs log stream names. The default for an Express service is ecs .

repositoryCredentials -> (structure)

The configuration for repository credentials for private registry authentication.

credentialsParameter -> (string)

The Amazon Resource Name (ARN) of the secret containing the private repository credentials.

command -> (list)

The command that is passed to the container.

(string)

environment -> (list)

The environment variables to pass to the container.

(structure)

A key-value pair object.

name -> (string)

The name of the key-value pair. For environment variables, this is the name of the environment variable.

value -> (string)

The value of the key-value pair. For environment variables, this is the value of the environment variable.

secrets -> (list)

The secrets to pass to the container.

(structure)

An object representing the secret to expose to your container. Secrets can be exposed to a container in the following ways:

  • To inject sensitive data into your containers as environment variables, use the secrets container definition parameter.
  • To reference sensitive information in the log configuration of a container, use the secretOptions container definition parameter.

For more information, see Specifying sensitive data in the Amazon Elastic Container Service Developer Guide .

name -> (string)

The name of the secret.

valueFrom -> (string)

The secret to expose to the container. The supported values are either the full ARN of the Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store.

For information about the require Identity and Access Management permissions, see Required IAM permissions for Amazon ECS secrets (for Secrets Manager) or Required IAM permissions for Amazon ECS secrets (for Systems Manager Parameter store) in the Amazon Elastic Container Service Developer Guide .

Note

If the SSM Parameter Store parameter exists in the same Region as the task you’re launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.

scalingTarget -> (structure)

The auto-scaling configuration for this service revision.

minTaskCount -> (integer)

The minimum number of tasks to run in the Express service.

maxTaskCount -> (integer)

The maximum number of tasks to run in the Express service.

autoScalingMetric -> (string)

The metric used for auto-scaling decisions. The default metric used for an Express service is CPUUtilization .

autoScalingTargetValue -> (integer)

The target value for the auto-scaling metric. The default value for an Express service is 60.

ingressPaths -> (list)

The entry point into this service revision.

(structure)

The entry point into an Express service.

accessType -> (string)

The type of access to the endpoint for the Express service.

endpoint -> (string)

The endpoint for access to the service.

createdAt -> (timestamp)

The Unix timestamp for when this service revision was created.

createdAt -> (timestamp)

The Unix timestamp for when the Express service that is being updated was created.

updatedAt -> (timestamp)

The Unix timestamp for when the Express service that is being updated was most recently updated.