AWS Developer 2 - API, SDK, and CLI Flashcards

1
Q
  1. 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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. 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

A. aws ec2 create-key-pair –key-name ‘my key pair’

is the correct AWS CLI command to create the EC2 key pair

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. 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

A

B. aws ec2 describe-instances

This AWS CLI command lists all our instances and lets your view information about those EC2 instances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. 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

A

D. PS C:> Get-S3Bucket -BucketNames my-s3-files

This AWS PowerShell command lsits your S3 bucket named my-s3-files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. 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

A. PS C:\ > Remove-S3Bucket - BucketName my-old-files

This is the right AWS PowerShell command to create the EC2 key pair.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. 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

A

D. PS C:> Get-IAMUserList

This is the correct AWS PowerShell command that lists collections of users in the current AWS account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. 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
  1. A. PS C:>Remove-IAMUser -UserName Mike

This AWS PowerShell command deletes the IAM suer named Mike from your AWS account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. 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

A

C. AWS SAM Local CLI tool is used for the local development and testing of Serverless applications (i.e., AWS Lambda functions).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. 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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. 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

A. True. This AWS command attaches that volume to that instance ad /dev/xvdh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. 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

A. True. This is the right AWS CLI command to copy the specified AMI from us-west-2 region to us-east-1-region

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. 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

A. Your development team can use this AWS CLI command to create an image of an existing EC2 instance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. 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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. 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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. 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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. Your Audit and Compliance team recommends using Least Privilege for IAM users. How to you achieve it?

A. By granting only the permissions required to perform a task.
B. By granting everyone root access to perform a task.
C. By revoking all the access from IAM Users.
D. By deleting the User from the IAM console.

A

A. By granting only the permissions required to perform a task, so you need to find out what users need to do, and then create access policies for them that let users perform only those tasks.

17
Q
  1. You want to remove the complexity out of Java coding by using ___________ for AWs services including Amazon S3, Amazon ECS, DynamoDB, and AWS Lambda.

A. AWS SDK
B. AWS CLI
C. AWS PowerShell
D. AWS SAM Local

A

AWS SDK will remove the complexity out of Java coding for AWS services, including Amazon S3, Amazon ECs, DynamoDB, and AWS Lambda.

18
Q
  1. The ________________ is an open source plug-in for the Eclipse Java integrated development environment (IDE) and it makes it easier for developer to develop, debug, and deploy Java applications that use AWS.

A. AWS CodeCommit
B. AWS CodePipeline
C. AWS CodeBuild
D. AWS Toolkit for Eclipse

A

D. AWS Toolkit for Eclipse is the plug-in for the Eclipse Java IDE.

19
Q
  1. The ____________ is a plug-in for the Visual Studio integrated development environment (IDE), and it makes it easier for developers to develop, debug, and deploy .NET applications that use AWS.

A. AWS Toolkit for Visual Studio
B. AWS CodeCommit
C. AWS CodePipeline
D. AWS CodeBuild

A

A. AWS Toolkit for visual Studio is the plug-in for the Visual Studio IDE.

20
Q
  1. ____________ contains tasks you can use in build and release definitions in VSTS to interact with AWS services, and it is available through the Visual Studio Marketplace.

A. AWS CLI
B. AWS SDK
C. AWS PowerShell
D. AWS Tools for Visual Studio Team Services (VSTS)

A

D. AWs Tools for Visual Studio Team Services contains tasks you can use in build and release definitions in VSTS to interact with AWS services.