Skip to content

Integrating AWS ECS with Spinnaker

What you'll learn:

  • In this document we are going to explore the steps to enable ECS on Spinnaker.


Step by Step Instructions to Setup AWS ECS with Spinnaker:

  • Edit the Role that is created as Assumerole for AWS EC2(spinnakerManaged) and update the ‘Trust relationships’ with the below JSON content.
       "Version": "2012-10-17",
       "Statement": [
           "Effect": "Allow",
           "Principal": {
             "Service": [
           "Action": "sts:AssumeRole"

Optional: Auto Scaling

  • User can also configure Amazon ECS services to use Service Auto Scaling. Service Auto Scaling policies adjust your Amazon ECS service’s desired count up or down in response to Cloud-watch alarms (e.g. tracking the CPU utilization of an Amazon ECS service, or tracking a custom metric) or on a schedule (e.g. scale up on Monday, scale down on Friday).
  • Configure scaling policies on your Amazon ECS services using the Application Auto Scaling APIs or in the Amazon ECS console, outside of Spinnaker. When deploying a new server group in Spinnaker, you can copy these scaling policies from the previous service group by enabling the “copy the previous server group’s auto-scaling policies” option.

Add ECS Account and Enable ECS Provider

  • Execute the below command allows user to add ECS account to Spinnaker.
hal config provider ecs account add ecs-account-name --aws-account aws-account-name


From the above Command ‘ecs-account-name is the AWS ECS Account Name and the ‘aws-account-name’ is the AWS EC2 Account Name

  • Execute the below command to enable ECS account to Spinnaker.
hal config provider ecs enable


Ensure to have AWS account enabled before enabling ECS on Spinnaker.

  • After executing the above the steps, restart spinnaker by executing the below command.
hal deploy apply

Step by Step Instructions to Create Pipeline with ECS Stage

  • This pipeline includes 3 stages, Build(Jenkins), Bake(AWS EC2) and Deploy(ECS).
  • Create an Application and Click on Pipelines to create a Pipeline.


  • Click on ‘Configure a new pipeline’ and fill the Pipeline Name.


  • Click on ‘Add Stage’ Select ‘Jenkins’ and add your Jenkins Job as required and Click on ‘Save Changes’.


  • Now, Click on ‘Add Stage’ and select ‘Bake’. Fill up all the mandatory as done on AWS EC2 Bake Stage.


  • Finally, Click on ‘Add Stage’ and select ‘Deploy’ then Click on ‘Add Server Group’ under ‘Deploy Configuration’.


  • Select ‘ECS’ as Cloudprovider and Click on ‘Next’.


  • Now, start filling up all the mandatory fields like,

    1. ECS Account
    2. Region
    3. Cluster Name
    4. Enter Stack & Detail(Optional)
    5. Strategy – In this scenario i have user Red/Black(Disables all previous server groups in the Cluster as soon as new servergroup passes health check).
    6. Network Mode – awsvpc – As this document refers with ‘Fargate’ it is mandatory to have networking mode as awsvpc.
    7. Target Group
    8. Target Container Port
    9. Container Image, CPU & Memory for the Image
    10. Launch Type, Desired Capacity – Min & Max
    11. IAM Instance Profile, Health Check Grace Period and other fields as required.
  • Once, done with filling up all the fields in ‘Deploy’ Click on ‘Done’ and ‘Save Changes’ With this, you are all set to execute your AWS ECS with AWS Fargate Pipeline on Spinnaker.