I wrote a medium post explaining my Drone deployment using ECS + EB

I sat and wrote how I did things so others can learn / suggest better ideas
My deployment has a self-deploying Drone (has some pitfalls but overall a great way to update and upgrade)
Drone 0.8 server as an Elastic Beanstalk application with ELB and ASG
Drone 0.8 agents as an ECS service under an ECS random cluster

Would love any kind of feedback

1 Like


I’m new to Drone and fairly new to the AWS Elastic Beanstalk platform. I’m trying to setup drone in EB. I’ve got Drone and an Agent setup in a multicontainer EB environment…but I’d like to be able to scale out Drone if necessary by having Drone server in one environment

Question 1) can Drone server scale out? is it stateless?

and have a pool of agents scale out in an separate environment

Q2) How can I have agents live in a separate environments as health checks fail with nothing listening or sending 200 OK on port 80? My agent only instances always get pulled out of the load balancer because they get marked unhealthy with no port 80 check.


In my post I described how I’m doing it although it can be achieved in many ways.

  1. Drone server sits on EB in my case, yes it is scaleable and stateless (using an external DB), but why would you scale the server?

  2. My agents live on ECS as a service that’s scaleable freely, and health is being checked at /version just to get a 200 response.
    I do remember @bradrydzewski added a DRONE_HEALTHCHECK=true but we’ll need his help to remember.

Great, looks like I got it all working. Health check works and I think that the agent can communicate with the server because the agent container is running. In the past if the DRONE_SECRET didn’t match the container just crashed. Is there any other way to make sure that the communication between the server and the agent is working? I’m not to the point of deploying anything yet.

Hi again Omer,

So I’ve got Drone and Agent setup in EB and I’m trying to deploy an app to EB via Drone and your plugin but I’m having some issues. What’s the best place to look for support?

I don’t know if it’s a problem getting your plugin AWS access key and secret correctly (I used the Drone CLI to add the 3 secrets in the pipeline below into Drone), the permissions those credentials have in AWS or if it’s access to the S3 Bucket that holds my EB environments source bundle.

My pipeline looks like this:
image: peloton/drone-elastic-beanstalk
access_key: {drone_aws_access_key}
secret_key: {drone_aws_secret_key}
application: BeanDroneHello
region: us-east-2
version_label: v5
description: Deployed with DroneCI
auto_create: true
bucket_name: beandronehello
bucket_key: {drone_bucket_key}

The “clone” step works fine:

  • branch master -> FETCH_HEAD
  • [new branch] master -> origin/master
  • git reset --hard -q 958d9a15c5099635b3db74a1ed6470777d811640
  • git submodule update --init --recursive

But the during the “beanstalk” step I’m getting this:

time=“2018-04-26T00:27:22Z” level=info msg=“Attempting to create and update” application-name=BeanDroneHello auto-create=true bucket= bucket-key="{“drone_bucket_key”:null}" description=“Deployed with DroneCI” env-update=false environment= region=us-east-2 versionlabel=v5
time=“2018-04-26T00:27:22Z” level=error msg=“Problem creating application” error=“InvalidClientTokenId: The security token included in the request is invalid.\n\tstatus code: 403, request id: c0983bfd-77ea-4df3-b471-bf41fdf82319”
InvalidClientTokenId: The security token included in the request is invalid.
status code: 403, request id: c0983bfd-77ea-4df3-b471-bf41fdf82319


Hi Bazul99,

First, the EB plugin is not mine (as you can see by the docker repo name) although I used it many times and it’s good.
I assume you’re having bad IAM permissions which block you from performing the task you are trying to.
I suggest you first debug this yourself using the exact same keys from a local host.
Then, set your host on AWS to use IAM roles instead of clear text keys, as it’s dangerous and very bad practice in terms of security.
If you still struggle open a topic relevant to the specific plugin (this thread is about the setting of drone itself), or search for a similar support threads.

Good luck!