How do I configure ECS service for a CODE_DEPLOY deployment controller?

0

When I try to create a deployment group, it gives this error: Deployment group's ECS service must be configured for a CODE_DEPLOY deployment controller.

When I go to the ECS service , there is no way to specify deployment controller.

Daveed
asked 10 months ago2187 views
1 Answer
-1

The error you're seeing is because the ECS Service must be configured to use CODE_DEPLOY as the deployment controller. This configuration is not done in the ECS Service console, but rather when you're creating or updating an ECS Service via AWS CLI or SDK.

Here are the steps you can follow:

  1. Update the ECS Service to use CodeDeploy as the deployment controller:

You can do this through the AWS CLI. The command to update the ECS service would look like this:

aws ecs update-service --service my-service --cluster my-cluster --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" --deployment-controller type=CODE_DEPLOY

In this command:

  • Replace my-service with the name of your service.
  • Replace my-cluster with the name of your cluster.

This command will switch the deployment controller to CodeDeploy for your specified service.

  1. Create a CodeDeploy Application:

You would need to create a CodeDeploy application that is configured to use the ECS compute platform.

  1. Create a Deployment Group:

Within the CodeDeploy application, you create a deployment group. You'll need to specify the service and cluster name of your ECS service and the load balancer or target group if any.

  1. Create a AppSpec file:

For ECS deployments, the AppSpec file is used to specify the updated task definition and container to use in the deployment.

  1. Create a Deployment:

You can then create a deployment that references your AppSpec file.

Remember to have the necessary IAM roles and permissions set up for CodeDeploy to access ECS and any other necessary resources.

Please accept it as the correct answer if you find it helpful.

profile picture
answered 10 months ago
  • Hi there

    I got this when I tried #1:

    daveed@daveeds-air Downloads % aws ecs update-service --service meta-ordinals --cluster Meta-ordinals --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" --deployment-controller type=CODE_DEPLOY

    usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run:

    aws help aws <command> help aws <command> <subcommand> help

    Unknown options: --deployment-controller, type=CODE_DEPLOY

  • @Daveed , did you fix it ?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions