Exam DOP-C02 All QuestionsBrowse all questions from this exam
Question 263

A company deploys an application to Amazon EC2 instances. The application runs Amazon Linux 2 and uses AWS CodeDeploy. The application has the following file structure for its code repository:

The appspec.yml file has the following contents in the files section:

What will the result be for the deployment of the config.txt file?

    Correct Answer: B

    The appspec.yml file specifies two file copy operations for deployment. The first operation copies the specific file config/config.txt to /usr/local/src/config.txt. The second operation copies the entire repository (denoted by source: /) to /var/www/html, which includes config/config.txt. Therefore, the config.txt file will be deployed to both /usr/local/src/config.txt and /var/www/html/config/config.txt.

Discussion
MoumitaOption: B

First Entry: source: config/config.txt destination: /usr/local/src/config.txt This rule specifically copies the config/config.txt file from the source repository to /usr/local/src/config.txt on the EC2 instance. Second Entry: source: / destination: /var/www/html This rule copies the entire contents of the root directory of the repository to /var/www/html on the EC2 instance. This includes the config/config.txt file, so it will be copied to /var/www/html/config/config.txt. Given these two rules: The config/config.txt file will be copied to /usr/local/src/config.txt by the first rule. The same file will also be copied to /var/www/html/config/config.txt due to the second rule. So, the correct answer is indeed B. The config.txt file will be deployed to /usr/local/src/config.txt and to /var/www/html/config/config.txt.

tgvOption: B

---> B