LCA Cloud Integration & Deployment 2 — Questions and Answers
Question 1: Which AWS CLI command uploads a local file to an S3 bucket?
- aws s3 put-object --bucket mybucket --key file.txt
- aws s3 cp file.txt s3://mybucket/ (Correct answer)
- aws s3 mv file.txt s3://mybucket/
- aws s3 push file.txt s3://mybucket/
Correct answer: aws s3 cp file.txt s3://mybucket/
The 'aws s3 cp' command copies a local file to an S3 bucket using the s3:// URI scheme.
Question 2: What is the purpose of an IAM role attached to an EC2 instance?
- To set the root password for the instance
- To allow the instance to make AWS API calls without embedded credentials (Correct answer)
- To configure VPC routing rules for the instance
- To assign a static IP address to the instance
Correct answer: To allow the instance to make AWS API calls without embedded credentials
An IAM role attached to an EC2 instance provides temporary credentials so the instance can call AWS APIs without storing long-term access keys.
Question 3: Which command initializes a new Terraform working directory and downloads provider plugins?
- terraform plan
- terraform apply
- terraform init (Correct answer)
- terraform validate
Correct answer: terraform init
'terraform init' initializes the working directory, downloads required providers, and sets up the backend.
Question 4: In Kubernetes, what object ensures a specified number of pod replicas are always running?
- DaemonSet
- StatefulSet
- ReplicaSet (Correct answer)
- Job
Correct answer: ReplicaSet
A ReplicaSet maintains a stable set of replica pods running at any given time, restarting pods if they fail.
Question 5: Which Linux tool is commonly used to manage containerized application lifecycles defined in a YAML file with multiple services?
- docker run
- docker-compose (Correct answer)
- kubectl
- podman-play
Correct answer: docker-compose
Docker Compose uses a docker-compose.yml file to define and run multi-container Docker applications with a single command.
Question 6: What does the 'kubectl rollout undo deployment/myapp' command do?
- Deletes the deployment named myapp
- Scales the deployment to zero replicas
- Reverts the deployment to the previous revision (Correct answer)
- Pauses the deployment rollout
Correct answer: Reverts the deployment to the previous revision
'kubectl rollout undo' rolls back a Deployment to its previous revision, restoring the prior pod template.
Question 7: Which file in a Docker image build context specifies instructions for creating the image?
- docker-compose.yml
- Containerfile
- Dockerfile (Correct answer)
- Makefile
Correct answer: Dockerfile
A Dockerfile contains sequential instructions (FROM, RUN, COPY, CMD, etc.) that Docker uses to build an image.
Which AWS CLI command uploads a local file to an S3 bucket?