exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 182 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 182
Topic #: 1
[All AWS Certified Developer Associate Questions]

A developer is creating a command line script to launch an Amazon EC2 instance at a preset time with a cron job. The developer will provide a user data script to start a task and then terminate the instance. The task cannot be interrupted and must run to completion.

How should the developer launch the EC2 instance?

  • A. Use the ec2 start-instances command.
  • B. Use the ec2 request-spot-instances command.
  • C. Use the ec2 run-instances command.
  • D. Use the ec2 purchase-scheduled-instances command.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MMaquis
Highly Voted 2 years, 2 months ago
Selected Answer: C
The correct answer is C. Use the ec2 run-instances command. The ec2 run-instances command is used to launch a new EC2 instance. It allows you to specify the Amazon Machine Image (AMI) to use, instance type, security group, and user data script. In this case, the developer can specify the user data script that starts the task and terminates the instance after the task is completed. The ec2 start-instances command is used to start a stopped instance, not to launch a new one. The ec2 request-spot-instances command is used to request EC2 instances at a lower price than the on-demand price. This is not relevant to this scenario as there is no mention of needing to save costs. The ec2 purchase-scheduled-instances command is used to purchase EC2 instances that are scheduled to launch in the future. This is also not relevant to this scenario as the instance needs to be launched at a preset time with a cron job.
upvoted 6 times
...
rcaliandro
Most Recent 1 year, 10 months ago
Selected Answer: C
C is correct. The developer should create an AMI with the specified configurations and with the user data script inside, in order to have the possibility to launch that script as soon as we call the cli command to run instances. The rigth answer is C because to run instances we can use "aws ec2 run-instances --image-id XXXXXXXX --count Y" and so on.. with the parameters (for more info here the AWS guide: https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html)
upvoted 2 times
...
Krt5894
2 years, 2 months ago
Selected Answer: C
https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html - Option C
upvoted 1 times
...
fabriciollf
2 years, 4 months ago
Selected Answer: C
https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html
upvoted 1 times
...
michaldavid
2 years, 5 months ago
Selected Answer: C
ccccccc
upvoted 2 times
...
kapil206001
2 years, 5 months ago
C https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago