ANS-C01 Question 327
Select 4An organization uses an Infrastructure as Code (IaC) template to provision networking resources in AWS. The template includes hardcoded IP addresses for subnets and security group rules. What potential issues could arise from this approach?
- A
The solution becomes less portable and reusable across different environments.
- B
Hardcoded IP addresses may conflict with existing or future network configurations.
- C
The template will automatically adapt to changes in CIDR ranges without modification.
- D
Scaling or modifying the infrastructure becomes more complex and prone to errors.
- E
Hardcoded values increase the risk of exposing sensitive data in version-controlled repositories.
Show answer and explanation
Correct answers: A, B, D, E
Explanation
Hardcoding values like IP addresses in IaC templates introduces multiple challenges, including reduced portability, increased risk of conflicts, and difficulty in scaling or modifying infrastructure. It also poses security risks if sensitive information is hardcoded and shared unintentionally. A better approach is to use parameterized templates, which enhance flexibility, scalability, and security.
- A. Correct.
Correct. Hardcoding IP addresses ties the template to a specific environment, making it difficult to reuse in other environments with different configurations.
- B. Correct.
Correct. Hardcoded IP addresses can result in IP conflicts, especially if multiple environments or teams are provisioning resources without coordination.
- C. Incorrect.
Incorrect. Hardcoded IP addresses do not adapt to changes automatically. Any updates to CIDR ranges or network configurations would require manual changes to the template.
- D. Correct.
Correct. Hardcoding makes it harder to scale or update infrastructure since any changes require manual effort and carry a higher risk of misconfiguration.
- E. Correct.
Correct. Hardcoded values, such as IP addresses or ports, can inadvertently expose sensitive information when stored in version control systems, leading to potential security risks.