I am creating new fargate task by using the following python script.
import boto3
import json
def handler():
client = boto3.client('ecs')
response = client.run_task(
cluster='fargate-learning', # name of the cluster
launchType = 'FARGATE',
taskDefinition='fargate-learning:1', # replace with your task definition name and revision
count = 1,
platformVersion='LATEST',
networkConfiguration={
'awsvpcConfiguration': {
'subnets': [
'subnet-0a024d8ac87668b64', # replace with your public subnet or a private with NAT
],
'assignPublicIp': 'ENABLED'
}
})
print(response)
return str(response)
if __name__ == '__main__':
handler()
And here is the response I am getting from boto3.
https://jsonblob.com/5faf3ae6-bc31-11ea-8cae-53bd90c38587
I can not see the public ip address in response although the script is assigning the public ip address and I can see it on website.
So, how can I get this public ip address by using boto3?
Thanks