IaC Documentation Language — Writing About Infrastructure Code
Practice the vocabulary for documenting Terraform modules, Ansible roles, and IaC design decisions.
0 / 15 completed
1 / 15
You are writing a README for a Terraform module. What should the Inputs section describe?
Terraform module README Inputs sections document each variable: name, type, description, default, and required/optional status.
2 / 15
A colleague asks you to document the module's outputs. What should this section contain?
Module outputs are values other configurations can reference — e.g., a VPC module outputs the VPC ID so other modules can use it.
3 / 15
What should a good IaC pull request description include?
IaC PRs should explain what infrastructure changes, why, include a plan summary, and flag any destructive changes or dependencies.
4 / 15
You need to write a comment explaining why a resource has a specific configuration. Which comment is most useful?
Useful IaC comments explain the WHY (compliance requirement, architectural decision) not the WHAT (which is already visible in the code).
5 / 15
A team is discussing whether to use count or for_each to create multiple EC2 instances. Which statement best explains the difference?
for_each is preferred when instances have distinct identities (e.g., by environment or region) because it avoids index-shift issues when items are removed.
6 / 15
Sarah is reviewing a Terraform configuration that uses the for_each meta-argument to create multiple S3 buckets. In her code review comment, she wants to highlight why this approach was chosen over using a loop within the Terraform code. Which of the following comments would be most effective?
The correct answer focuses on the technical reason for using for_each – avoiding variable scope issues. The other options either state an opinion (readability), introduce a potentially misleading 'best practice' claim, or offer a superficial explanation. It's important to explain *why* a decision was made, not just *that* it was made.
7 / 15
Mark is drafting the description for a pull request that introduces changes to an Ansible playbook. The core change involves setting specific network security group rules. Which sentence best encapsulates the purpose of this section?
A pull request description should clearly state *what* change was made. Option 2 accurately describes the impact of modifying network security group rules – enforcing stricter firewall policies. Options 1 and 3 are too broad; option 4 minimizes the importance of the change. Precise language is crucial for effective communication.
8 / 15
During a standup meeting, David explains that his team is using Pulumi to deploy infrastructure as code. Another developer asks him: 'What's the difference between defining resources directly in your Pulumi program versus using a configuration file?' Which of the following responses best answers this question?
The correct answer highlights the key advantage of defining resources directly in code – enabling complex logic and dynamic configurations. Configuration files are primarily suited for simpler, static infrastructure setups. While direct definition offers more flexibility, it can also increase complexity; a good explanation acknowledges this trade-off.
9 / 15
You're reviewing a CloudFormation template that uses the Condition property within an IAM role. The condition is based on the source IP address of the user attempting to access a specific AWS service. What's the primary purpose of this approach?
The correct answer accurately describes using an IP address condition—restricting access based on user location. This is a common security practice. The other options relate to different aspects of IAM roles (key rotation, shared roles, simplified permissions) but are not the function of the Condition property.
10 / 15
Elena is documenting a CI/CD pipeline that uses AWS CloudFormation to deploy infrastructure. She needs to explain why she includes the Outputs section in her CloudFormation template. Which statement best explains its purpose?
The Outputs section is crucial for exposing key values—like S3 bucket names or EC2 instance IDs—from deployed resources. These outputs can then be used by other services (e.g., a web application) to dynamically configure themselves. It's not about the entire deployment process; rather, it's about sharing specific resource details.
11 / 15
Sarah is reviewing a Terraform configuration that uses the for_each meta-argument to create multiple S3 buckets. In her code review comment, she wants to highlight why this approach was chosen over using a loop within the Terraform code. Which of the following comments would be most effective?
The correct answer focuses on the technical reason for using for_each – avoiding variable scope issues. The other options either state an opinion (readability), introduce a potentially misleading 'best practice' claim, or offer a superficial explanation. It's important to explain *why* a decision was made, not just *that* it was made.
12 / 15
Mark is drafting the description for a pull request that introduces changes to an Ansible playbook. The core change involves setting specific network security group rules. Which sentence best encapsulates the purpose of this section?
A pull request description should clearly state *what* change was made. Option 2 accurately describes the impact of modifying network security group rules – enforcing stricter firewall policies. Options 1 and 3 are too broad; option 4 minimizes the importance of the change. Precise language is crucial for effective communication.
13 / 15
During a standup meeting, David explains that his team is using Pulumi to deploy infrastructure as code. Another developer asks him: 'What's the difference between defining resources directly in your Pulumi program versus using a configuration file?' Which of the following responses best answers this question?
The correct answer highlights the key advantage of defining resources directly in code – enabling complex logic and dynamic configurations. Configuration files are primarily suited for simpler, static infrastructure setups. While direct definition offers more flexibility, it can also increase complexity; a good explanation acknowledges this trade-off.
14 / 15
You're reviewing a CloudFormation template that uses the Condition property within an IAM role. The condition is based on the source IP address of the user attempting to access a specific AWS service. What's the primary purpose of this approach?
The correct answer accurately describes using an IP address condition—restricting access based on user location. This is a common security practice. The other options relate to different aspects of IAM roles (key rotation, shared roles, simplified permissions) but are not the function of the Condition property.
15 / 15
Elena is documenting a CI/CD pipeline that uses AWS CloudFormation to deploy infrastructure. She needs to explain why she includes the Outputs section in her CloudFormation template. Which statement best explains its purpose?
The Outputs section is crucial for exposing key values—like S3 bucket names or EC2 instance IDs—from deployed resources. These outputs can then be used by other services (e.g., a web application) to dynamically configure themselves. It's not about the entire deployment process; rather, it's about sharing specific resource details.
What will I practise in "IaC Documentation Language — Writing About Infrastructure Code"?
Practice the vocabulary for documenting Terraform modules, Ansible roles, and IaC design decisions.
How many exercises are in this module?
This module has 15 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the vocabulary and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more Infrastructure as Code (IaC) exercises?
Browse the full Infrastructure as Code (IaC) hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain vocabulary and concepts in prose; this exercise tests and reinforces that vocabulary through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.