XK0-006 practice question 13 of 15
A Linux administrator wants to use AI to deploy infrastructure as code. Which of the following is a best practice regarding the use of AI for this task?
Full set: 149 questionsWhen using Artificial Intelligence (AI) to generate Infrastructure as Code (IaC), the output must be treated as code written by a junior developer—it requires rigorous validation. Linting is an automated process that checks code for programmatic and stylistic errors, adherence to conventions, and potential bugs. Applying a linter to AI-generated IaC is a crucial best practice. It ensures the code meets quality standards, is syntactically correct, and follows established patterns before it is committed to a repository or used in a deployment pipeline, thereby reducing the risk of errors and security vulnerabilities.
A. Using copy and paste is generally discouraged as it leads to code duplication and maintenance challenges, regardless of the code's origin.
B. Generating monolithic code is an anti-pattern. Best practices for IaC, as with most software, favor modular, reusable, and maintainable components.
D. Merging CI/CD pipelines is not a practice related to code generation. Integrating IaC into a CI/CD pipeline is a goal, not a method for ensuring code quality.
1. Forsgren
N.
Humble
J.
& Kim
G. (2018). Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations. IT Revolution Press. Chapter 4 discusses the importance of automated testing and code quality checks as foundational DevOps practices
which apply directly to IaC.
2. Google Cloud. (2023). DevOps tech: Infrastructure as code. Google Cloud Architecture Center. This document emphasizes that IaC should be versioned
tested
and validated
practices which include linting.
3. Amershi
S.
et al. (2019). Software Engineering for Machine Learning: A Case Study. In Proceedings of the 41st International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP '19). IEEE Press
291–300. https://doi.org/10.1109/ICSE-SEIP.2019.00042. This paper highlights the need for rigorous software engineering practices
including code quality checks
when dealing with AI/ML systems and their outputs.
Keep practicing
Take the free XK0-006 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other XK0-006 practice questions
- Question 1A DevOps engineer needs to create a local Git repository. Which of the following commands…
- Question 2Which of the following is the main reason for setting up password expiry policies?
- Question 3A Linux administrator needs to securely erase the contents of a hard disk. Which of the f…
- Question 4Which of the following best describes the role of initrd?
- Question 5Which of the following is a characteristic of Python 3?
- Question 6A Linux user runs the following command: nohup ping comptia.com & Which of the following …
