Skip to content

Instantly share code, notes, and snippets.

@amacal
Created November 22, 2020 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amacal/4b81d24eb864a7fce157443dcac91333 to your computer and use it in GitHub Desktop.
Save amacal/4b81d24eb864a7fce157443dcac91333 to your computer and use it in GitHub Desktop.
def start(self, token):
response = self.ecs.run_task(
cluster=self.cluster,
taskDefinition=self.task,
platformVersion='1.4.0',
networkConfiguration={
'awsvpcConfiguration': {
'assignPublicIp': 'ENABLED',
'securityGroups': [self.securityGroup],
'subnets': [self.vpcSubnet]
}
},
overrides={
'containerOverrides': [{
'name': self.task.replace('/', ':').split(':')[-2],
'environment': self.environment(token)
}]
}
)
return response["tasks"][0]["taskArn"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment