ANS-C01 Question 330
Select 3An organization uses an AWS CloudFormation template to provision VPCs and associated networking resources. However, the template contains hardcoded values for IP addresses, subnet CIDRs, and resource names. What potential issues could arise from using such hardcoded instructions in the template?
- A
The template becomes less reusable for different environments or regions.
- B
It increases the risk of IP address conflicts when provisioning multiple VPCs.
- C
Hardcoded instructions improve deployment speed and reduce human error.
- D
Scaling infrastructure dynamically becomes more challenging.
- E
The template is better protected from accidental misconfigurations.
Show answer and explanation
Correct answers: A, B, D
Explanation
Using hardcoded instructions in Infrastructure as Code (IaC) templates, such as AWS CloudFormation, introduces multiple challenges. It reduces the flexibility and reusability of the templates, increases the risk of IP address conflicts, and makes it harder to scale dynamically. To address these issues, parameters or mappings should be used instead of hardcoded values, enabling the template to adapt to different environments and use cases seamlessly.
- A. Correct.
Hardcoding values like IP addresses or resource names makes the template less reusable across different environments (e.g., dev, staging, production) or AWS regions, as adjustments would need to be made manually.
- B. Correct.
Hardcoded IP addresses or CIDRs can lead to conflicts when provisioning multiple VPCs, as there is no mechanism to dynamically allocate unique ranges.
- C. Incorrect.
This is incorrect. Hardcoded instructions do not necessarily improve deployment speed or reduce human error. Instead, they increase the likelihood of issues when changes are required or when scaling is needed.
- D. Correct.
Hardcoding values makes it more difficult to adapt the infrastructure dynamically, as the predefined values cannot easily accommodate scaling without manual intervention.
- E. Incorrect.
This is incorrect. Hardcoded values do not inherently protect the template from misconfigurations. Instead, they can lead to errors when reused in different contexts.