in Education by
I'm trying to deploy a Docker container image to AWS using ECS, but the EC2 instance is not being created. I have scoured the internet looking for an explanation as to why I'm receiving the following error: "A client error (InvalidParameterException) occurred when calling the RunTask operation: No Container Instances were found in your cluster." Here are my steps: 1. Pushed a docker image FROM Ubuntu to my Amazon ECS repo. 2. Registered an ECS Task Definition: aws ecs register-task-definition --cli-input-json file://path/to/my-task.json 3. Ran the task: aws ecs run-task --task-definition my-task Yet, it fails. Here is my task: { "family": "my-task", "containerDefinitions": [ "environment": [], "name": "my-container", "image": "my-namespace/my-image", "cpu": 10, "memory": 500, "portMappings": [ "containerPort": 8080, "hostPort": 80 ], "entryPoint": [ "java", "-jar", "my-jar.jar" ], "essential": true } I have also tried using the management console to configure a cluster and services, yet I get the same error. How do I configure the cluster to have ec2 instances, and what kind of container instances do I need to use? I thought this whole process was to create the EC2 instances, to begin with!! Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
There are two ways, First and the simpler way is to create an internet gateway and connect it to the VPC used by the cluster. So, to solve this you have to update your VPC’s route table: 0.0.0.0/0 igw-name If the simple way didn’t work, you can follow this procedure: In the EC2 dashboard, first click on launch instance Now, check for ecs-optimized in the Community AMIs, select whichever AMIs type fits for your project. So, select one and click next. In Configure Instance Details, click on the create new IAM role link and create a role called ecsInstanceRole. AmazonEC2ContainerServiceforEC2Role - Attach this policy to that role Finally, finish configuring you ECS instance. If it is a web server make sure to provide access to port 80 in your security group.

Related questions

0 votes
    I am trying to use aws container service as per the documentation in http://docs.aws.amazon.com/AmazonECS/latest/ ... in a console? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I want to migrate my webapp from Amazon EC2 to ECS. I ECS I have to allocate memory and vCPU for the ... needed for the process? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    I'm trying to set up an Amazon Linux AMI(ami-f0091d91) and have a script that runs a copy command to copy ... what is going on? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Every time I want to config something with AWS I get the following error : "The config profile (myname) ... encrypt my credentials. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I tried to follow this tutorial. This is what I did in the console: pip3 install --user --upgrade awscli after ... 's the problem here? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I want to list the public IP addresses of my EC2 instances using Bash, separated by a delimiter (space or ... something else entirely? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I've got two different apps that I am hosting (well the second one is about to go up) on Amazon EC2. ... path ; ec2-describe-instances Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I am trying out a simple example suggested by AWS documentation to create a role using a policy json file http:// ... botocore/1.3.9 Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am using the aws cli to list the files in an s3 bucket using the following command (documentation): aws s3 ... only the file list? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I created a new Access Key and configured that in the AWS CLI with aws configure. It created the .ini file in ~/ ... . How to fix this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Is it possible to get the ARN of an S3 bucket via the AWS command line? I have looked through the documentation ... way to do this. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm having trouble using * in the AWS CLI to select a subset of files from a certain bucket. Adding * to the ... s3://data/2016-08*. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am going to create a new distribution at CloudFront. Already I have uploaded my SSL certificate at AWS IAM ... for this distribution? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm starting a bash script which will take a path in S3 (as specified to the ls command) and dump the ... finding which does it? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Looking for a quick way to pull my account number, I had originally thought of using aws iam get-account- ... cross-account origins? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
...