amazon-ecs

How can I get Public IP of my FARGATE ECS task with metadata endpoint or java sdk?

喜欢而已 提交于 2019-12-01 06:04:22
I want to get public IP of my fargate ECS task after container started. I get IPv4Addresses when requested http://169.254.170.2/v2/metadata/ but I don't get public IP of task. When I use runTask(request) method of RunTaskResult, again I don't get public IP from RunTaskResult. Is there a way to get public IP of my fargate task something like http://169.254.169.254/latest/meta-data/public-hostname (for EC2)? I solved my problem with DescribeNetworkInterfacesRequest.I get private IP of my container with curl http://169.254.170.2/v2/metadata/ then run this code. AmazonEC2 ec2AsyncClient=

Trouble deploying docker on AWS with ecs-cli

≯℡__Kan透↙ 提交于 2019-12-01 03:43:26
I have a repo on ECS, have created a cluster using ecs-cli ecs-cli configure --region=us-west-2 --profile=<MY PROFILE> --cluster=cluster-1 ecs-cli up --capability-iam --keypair=<MY KEYPAIR> but then the next step to execute the compose file is when it fails ecs-cli compose --file docker-compose.yml --project-name drafter-project service up Here's my docker-compose.yml file: version: '2' services: rabbit: image: rabbitmq hostname: rabbit1 ports: - 5672:5672 - 15672:15672 drafter: build: . depends_on: - rabbit the errors i get here are: Error registering task definition error=ClientException:

How can I get Public IP of my FARGATE ECS task with metadata endpoint or java sdk?

风格不统一 提交于 2019-12-01 03:19:11
问题 I want to get public IP of my fargate ECS task after container started. I get IPv4Addresses when requested http://169.254.170.2/v2/metadata/ but I don't get public IP of task. When I use runTask(request) method of RunTaskResult, again I don't get public IP from RunTaskResult. Is there a way to get public IP of my fargate task something like http://169.254.169.254/latest/meta-data/public-hostname (for EC2)? 回答1: I solved my problem with DescribeNetworkInterfacesRequest.I get private IP of my

How to create a new docker image from a running container on Amazon?

断了今生、忘了曾经 提交于 2019-11-29 10:31:02
Here is my problem : I have a task running a docker image on amazon ECS but i would like to make a new docker image from the running instance of the container. I see the id of the instance on Amazon Ecs , i have made an AMI but i would like to make a new docker image that i can pull from amazon. Any ideas ? Regards and thanks Apart from the answer provided by @Ben Whaley, I personally suggest you to make use of Docker APIs. To use Docker APIs you need to configure the docker daemon port and the procedure is explained here configuring docker daemon port Lets run a container using an base Ubuntu

Creating an ALB Target Group in CloudFormation

Deadly 提交于 2019-11-29 06:41:12
问题 I'm trying to create an Application Load Balancer in CloudFormation, with a target group that forwards traffic to EC2 instances. Here is the relevant snippet, where ELBSubnets, ECSCluster, taskdefinition, and VpcId are passed in as parameters: "EcsElasticLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancingV2::LoadBalancer", "Properties" : { "Subnets" : { "Ref" : "ELBSubnets" }, "SecurityGroups": [ { "Ref": "ELBAccessSecurityGroup" } ] } }, "LoadBalancerListener": { "Type": "AWS:

Why can't my ECS service register available EC2 instances with my ELB?

风流意气都作罢 提交于 2019-11-29 03:33:31
I've got an EC2 launch configuration that builds the ECS optimized AMI. I've got an auto scaling group that ensures that I've got at least two available instances at all times. Finally, I've got a load balancer. I'm trying to create an ECS service that distributes my tasks across the instances in the load balancer. After reading the documentation for ECS load balancing, it's my understanding that my ASG should not automatically register my EC2 instances with the ELB, because ECS takes care of that. So, my ASG does not specify an ELB. Likewise, my ELB does not have any registered EC2 instances.

terraform-ecs. Registered container instance is showing 0

狂风中的少年 提交于 2019-11-28 12:56:49
On running terraform apply it is creating a cluster, service, ec2 instance. But Registered container instances is 0, running tasks count is 0. I tried changing ecs.amazonaws.com to ec2.amazonaws.com but it is throwing an error: aws_ecs_service.nginx: InvalidParameterException: Unable to assume role and validate the listeners configured on your load balancer. Please verify that the ECS service role being passed has the proper permissions. provider "aws" { region = "us-east-1" } resource "aws_ecs_cluster" "demo" { name = "demo" } resource "aws_iam_role" "ecs_elb" { name = "ecs-elb" assume_role

Linking containers between task definitions in AWS ECS?

試著忘記壹切 提交于 2019-11-28 05:40:27
I'm trying to setup a basic web application, which has an associated database, in AWS ECS. Locally I have these setup in different containers, and on ECS, I'd like to have separate task definitions so that I may scale the two separately. I registered my first task definition as david_mongodb successfully in ECS. It has a container named david_mongodb in it. Then I attempted to register my second task definition as david_web , which has a container named david_web that links the database via david_mongodb:db . When I click 'Create', it returns an error: Unable to create Task Definition Linked

docker login unknown shorthand flag: 'e'

隐身守侯 提交于 2019-11-28 05:09:24
I just updated my docker version and found out that command aws ecr get-login is not working anymore. Got error: unknown shorthand flag: 'e' in -e`. Seems that docker doesn't support -e flag anymore. Is there a way to fix this? Installed versions: aws-cli/1.11.111 Python/2.7.10 Darwin/16.6.0 botocore/1.5.74 Docker version 17.06.0-ce-rc5, build b7e4173 add this to your call --no-include-email here is the new valid syntax : aws ecr get-login ${normal_params_here} --no-include-email aws ecr get-login --region us-east-1 --no-include-email # for example This new option is available in AWS CLI as of

How to create a new docker image from a running container on Amazon?

柔情痞子 提交于 2019-11-28 03:24:57
问题 Here is my problem : I have a task running a docker image on amazon ECS but i would like to make a new docker image from the running instance of the container. I see the id of the instance on Amazon Ecs , i have made an AMI but i would like to make a new docker image that i can pull from amazon. Any ideas ? Regards and thanks 回答1: Apart from the answer provided by @Ben Whaley, I personally suggest you to make use of Docker APIs. To use Docker APIs you need to configure the docker daemon port