

# Amazon ECS service revisions
<a name="service-revision"></a>

A service revision contains a record of the workload configuration Amazon ECS is attempting to deploy. Whenever you create or deploy a service, Amazon ECS automatically creates and captures the configuration that you're trying to deploy in the service revision.

 Service revisions are read-only and have unique identifiers. For information about the included properties, see [Properties included in an Amazon ECS service revision](service-revision-property.md).

 Service revisions provide the following benefits:
+ During a service deployment, you can compare the currently deployed service revision (source) with the one being deployed (target).
+ When you use the rollback option for a service deployment, Amazon ECS automatically rolls back the service deployment to the last successfully deployed service revision.
+ Service revisions contain the record of the workload configuration in one resource. 

## Service revision lifecycle
<a name="service-revisions-lifecycle"></a>

Amazon ECS automatically creates a new service revision when you create a service, or update a service property that starts a deployment.

 Amazon ECS doesn't create a new service revision for a rollback operation. Amazon ECS uses the last successful service revision for the rollback. 

A service revision is immutable.

Amazon ECS deletes the service revision when you delete a service.

You can view service revisions created on or after October 25, 2024 by using the console, API, and the CLI.

# Properties included in an Amazon ECS service revision
<a name="service-revision-property"></a>

The following properties are included in a service revision.


| Resource | Description | 
| --- | --- | 
|  Service ARN  |  The ARN that identifies the service.  | 
|  Cluster ARN  |  The ARN for the cluster that hosts the service.  | 
|  Task definition ARN  |  The ARN of the task definition used for the service tasks.  | 
|  Service registries  |  The details for the service registries used for service discovery. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Capacity providers |  The capacity provider strategy details. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Container images |  The details about the container images.  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Networking |  The network configuration for the service. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Launch type | The compute option used for the service. | 
| Fargate-specific properties |  When using Fargate, this is information about the Fargate version. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Amazon EBS volumes that are configured at deployment |  The configuration for a volume specified in the task definition as a volume that is configured at launch time.  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
|  Service Connect |  The Service Connect configuration. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Service load balancers |  The load balancers that route the service traffic. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-revision-property.html)  | 
| Runtime Monitoring | Indicates if Runtime Monitoring is on. | 
| Creation date |  The date the service revision was created.  | 
| VPC Lattice |  The VPC Lattice configuration for the service revision.  | 

# Viewing Amazon ECS service revision details
<a name="view-service-revision"></a>

You can view information about the following service revision types that were created on or after October 25, 2024:
+ Source -The currently deployed workload configuration
+ Target - The workload configuration being deployed

------
#### [ Amazon ECS Console ]

1. Open the console at [https://console.aws.amazon.com/ecs/v2](https://console.aws.amazon.com/ecs/v2).

1. On the **Clusters** page, choose the cluster.

1. On the cluster details page, in the **Services** section, choose the service.

   The service details page displays.

1. On the service details page, choose **Deployments**.

1. Choose the service revision to view.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/view-service-revision.html)

------
#### [ AWS CLI ]

1. Run `describe-service-deployments` to retrieve the service revision ARN. 

   Replace the variables with your values.

   ```
   aws ecs describe-service-deployments --service-deployment-arns arn:aws:ecs:region:account-id:service/cluster-name/service-name/NCWGC2ZR-taawPAYrIaU5
   ```

   Note the `arn` for the `sourceServiceRevisions` or the `targetServiceRevisions`.

   ```
   {
       "serviceDeployments": [
           {
               "serviceDeploymentArn": "arn:aws:ecs:us-west-2:123456789012:service-deployment/example/sd-example/NCWGC2ZR-taawPAYrIaU5",
               "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/example/sd-example",
               "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/example",
               "updatedAt": "2024-09-10T16:49:35.572000+00:00",
               "sourceServiceRevision": {
                   "arn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373578954",
                   "requestedTaskCount": 0,
                   "runningTaskCount": 0,
                   "pendingTaskCount": 0
               },
               "targetServiceRevision": {
                   "arn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373577095",
                   "requestedTaskCount": 0,
                   "runningTaskCount": 0,
                   "pendingTaskCount": 0
               },
               "status": "IN_PROGRESS",
               "deploymentConfiguration": {
                   "deploymentCircuitBreaker": {
                       "enable": false,
                       "rollback": false
                   },
                   "maximumPercent": 200,
                   "minimumHealthyPercent": 100
               }
           }
       ],
       "failures": []
   }
   ```

1. Run `describe-service-revisions`. Use the `arn` that was returned from `describe-service-deployments`.

   Replace the variables with your values.

   ```
   aws ecs describe-service-revisions --service-revision-arns arn:aws:ecs:region:123456789012:service-revision/cluster-name/service-name/4980306466373577095
   ```

------