AWS Developer 2 - API, SDK, and CLI Flashcards
- What parameters do you need to set up an AWS CLI? (Choose all that apply.)
A. AWS Access Key ID
B. AWS Secret Access Key
C. Default region name
D. Default output format
A, B, C, D You need the AWS Access Key ID, AWs Secret Access Key, Default region name, and Default output format parameters to set up AWS CLI.
- What is the command to create an EC2 key pair using an AWS CLI?
A. aws ec2 create-key-pair –key-name ‘my key pair’
B. aws ec2 modify-key-pair –key-name ‘my key pair’
C. aws ec2 delete-key-pair –key-name ‘my key pair’
D. aws ec2 stop-key-pair –key-name ‘my key pair’
A. aws ec2 create-key-pair –key-name ‘my key pair’
is the correct AWS CLI command to create the EC2 key pair
- Which of the following AWS CLI commands list all your instances and view information about those EC2 instances?
A. aws ec2 display-instances
B. aws ec2 describe-instances
C. aws ec2 discover-instances
D aws ec2 show-instances
B. aws ec2 describe-instances
This AWS CLI command lists all our instances and lets your view information about those EC2 instances.
- which of the following AWS PowerShell commands can be used to list your S3 buekt named m-s3-files?
A. PS C:> Read-S3Object -BucketNames my-s3-files
B. PS C:> Get-S3BucketPolicy -BucketNames my-s3-files
C. PS C:> Copy-S3Object -BucketNames my-s3-files
D. PS C:> Get-S3Bucket -BucketNames my-s3-files
D. PS C:> Get-S3Bucket -BucketNames my-s3-files
This AWS PowerShell command lsits your S3 bucket named my-s3-files.
- You want to delete an S# bucket named my-old-files. Which of the following AWs PowerShell commands can be sued to delete it?
A. PS C:\ > Remove-S3Bucket - BucketName my-old-files
B. PS C:\ > Delete-S3Bucket - BucketName my-old-files
C. PS C:\ > Purge-S3Bucket - BucketName my-old-files
D. PS C:\ > Drop-S3Bucket - BucketName my-old-files
A. PS C:\ > Remove-S3Bucket - BucketName my-old-files
This is the right AWS PowerShell command to create the EC2 key pair.
- Which of the AWS PowerShell commands retrieves a collection of users int he current AWS account?
A. PS C:> Retrieve-IAMUserList
B. PS C:> Pull-IAMUserList
C. PS C:> Show-IAMUserList
D. PS C:> Get-IAMUserList
D. PS C:> Get-IAMUserList
This is the correct AWS PowerShell command that lists collections of users in the current AWS account.
- Mike left your team, so you need to delete the IAM user named Mike using AWS PowerShell. Which of the following command achieves this goal?
A. PS C:>Remove-IAMUser -UserName Mike
B. PS C:>Delete-IAMUser -UserName Mike
C. PS C:>Drop-IAMUser -UserName Mike
D. PS C:>Purge-IAMUser -UserName Mike
- A. PS C:>Remove-IAMUser -UserName Mike
This AWS PowerShell command deletes the IAM suer named Mike from your AWS account.
- Which of the following is a CLI tool for local development and testing of Serverless applications?
A. AWS PowerShell
B. AWS CLI
C. AWS SAM Local
D. AWS SDK
C. AWS SAM Local CLI tool is used for the local development and testing of Serverless applications (i.e., AWS Lambda functions).
- Your networking team provided 192.172.0.0/22 CIDR block for creating AWS VPC. Which of the following AWS CLIs creates the VPC for you using the correct CIDR block?
A. aws ec2 initiate-vpc –cidr-block 192.172.0.0/22
B. aws ec2 generate-vpc –cidr-block 192.172.0.0/22
C. aws ec2 write-vpc –cidr-block 192.172.0.0/22
D. aws ec2 create-vpc –cidr-block 192.172.0.0/22
D. aws ec2 create-vpc –cidr-block 192.172.0.0/22
This command creates a custom VPC using 192.172.0.0/22 CIDR block.
- The following AWS CLI command attaches a volume (vol-9876543210fedcba0) to an instance (i-54321ab789c19876) as /dev/xvdh,
aws ec2 attach-volume –volume-id vol-9876543210fedcba0 –instance-id i-54321ab789c19876 –device /dev/xvdh
A. True
B. False
A. True. This AWS command attaches that volume to that instance ad /dev/xvdh
- As part of your disaster recovery strategy, you need to copy the specified AMI from us-west-2 region to us-east-1 revion using dry run option. The following AWS CLI command copies the AWS AMI from us-east1 to us-west2
aws ec2 copy-image –dry-run –source-region us-west-2 –region us-east-1 –source-image-id ami-6842234d –name “west server”
A. True
B. False
A. True. This is the right AWS CLI command to copy the specified AMI from us-west-2 region to us-east-1-region
- Your development team wants you to create an image of an existing EC2 instance. Which AWS CLI command will achieve the image creation?
A. aws ec2 create-image –instance i -9876543210feccba0
B. aws ec2 generate-image –instance i -9876543210feccba0
C. aws ec2 copy-image –instance i -9876543210feccba0
D. aws ec2 build-image –instance i -9876543210feccba0
A. Your development team can use this AWS CLI command to create an image of an existing EC2 instance.
- As per best practice, you would like to add Tags to your AWS AMI to identify the environment. Which of the following AWS CLi commands creates a Tag for AMI?
A. aws ec2 generate-tags –resources ami-67v431221 –tags KEY=ENV, Value=DEV
B. aws ec2 dopy-tags –resources ami-67v431221 –tags KEY=ENV, Value=DEV
C. aws ec2 create-tags –resources ami-67v431221 –tags KEY=ENV, Value=DEV
D. aws ec2 build-tags –resources ami-67v431221 –tags KEY=ENV, Value=DEV
C. aws ec2 create-tags –resources ami-67v431221 –tags KEY=ENV, Value=DEV
This is the correct AWS CLI command to add Tags to you r AWS AMI to identify the environment.
- You have created a custom VPC-b12217d3 and want to create a route table for the VPC. Which of the following AWS CLI commands creates the route table?
A. aws ec2 build-route-table –vpc-id vpc-b12217d3
B. aws ec2 generate-route-table –vpc-id vpc-b12217d3
C. aws ec2 copy-route-table –vpc-id vpc-b12217d3
D. aws ec2 create-route-table –vpc-id vpc-b12217d3
D. aws ec2 create-route-table –vpc-id vpc-b12217d3
This is the AWS Cli command to create a route table for your custom VPI.
- You created an EC2 instance with IP 55.166.46.122 using MyEC2KeyPair, pem key-pair, and you want to connect to it using an SSH client from a Linux machine. Which of the following commands helps you to successfully connect to your EC2 instance?
A. ssh -connect “MyEC2KeyPair.pem” ec2-user@55.166.46.122
B. ssh -attach “MyEC2KeyPair.pem” ec2-user@55.166.46.122
C. ssh -i “MyEC2KeyPair.pem” ec2-user@55.166.46.122
D. ssh -link “MyEC2KeyPair.pem” ec2-user@55.166.46.122
C. ssh -i “MyEC2KeyPair.pem” ec2-user@55.166.46.122
This is the correct way to connect EC2 instance with IP 55.166.46.122 using MyEC2KeyPair using an SSJ client from a linux machine.