Created
November 22, 2020 15:10
-
-
Save amacal/4b81d24eb864a7fce157443dcac91333 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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