Infrastructure as Code Flashcards

1
Q

Q: What is Infrastructure as Code (IaC)?

A

A: IaC is the practice of managing and provisioning infrastructure using code instead of manual processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: What are the benefits of IaC?

A

A: Consistency, repeatability, scalability, faster provisioning, version control, and easier collaboration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: What is the difference between declarative and imperative IaC?

A

A: Declarative defines what the infrastructure should look like (e.g., AWS CloudFormation), while imperative specifies how to build it step by step.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: What is AWS CloudFormation?

A

A: A service that allows you to define AWS resources and infrastructure as code using templates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: What is a CloudFormation template?

A

A: A JSON or YAML file that defines resources, configurations, and dependencies for provisioning AWS infrastructure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: What is the AWS Cloud Development Kit (CDK)?

A

A: A framework that allows you to define AWS infrastructure using programming languages like Python, TypeScript, Java, and C#.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: What are constructs in AWS CDK?

A

A: High-level components that represent AWS resources and their configurations, simplifying infrastructure code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: What is Terraform?

A

A: An open-source IaC tool that provisions and manages infrastructure across multiple cloud providers using declarative configuration files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: What is the role of state in Terraform?

A

A: Terraform uses a state file to track the current infrastructure and plan changes, ensuring consistency between configurations and deployed resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: What is Ansible, and how does it relate to IaC?

A

A: Ansible is an open-source tool for configuration management and orchestration, often used alongside IaC tools like Terraform or CloudFormation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q: What is a CloudFormation stack?

A

A: A collection of AWS resources managed as a single unit, created and updated using a CloudFormation template.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q: What are StackSets in CloudFormation?

A

A: A feature that allows you to deploy CloudFormation stacks across multiple AWS accounts and regions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q: What are parameters in CloudFormation templates?

A

A: User-defined inputs that customize stack behavior during creation or updates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q: What are outputs in CloudFormation templates?

A

A: Values returned after a stack is created, such as resource IDs or endpoints, for use in other stacks or scripts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Q: What is a Change Set in CloudFormation?

A

A: A preview of changes that will be made to a stack before updating or deleting it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: What is drift detection in CloudFormation?

A

A: A feature that identifies differences between the actual resource configurations and the configuration defined in the template.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Q: What is AWS OpsWorks?

A

A: A configuration management service that uses Chef and Puppet to automate server configuration, deployment, and management.

18
Q

Q: What are cross-stack references in CloudFormation?

A

A: A way to share resources between CloudFormation stacks using exported output values.

19
Q

Q: What is AWS Service Catalog?

A

A: A service that enables the creation, management, and governance of pre-approved IaC templates for use across an organization.

20
Q

Q: What are AWS-native tools for IaC?

A

A: AWS CloudFormation, AWS CDK, and AWS OpsWorks.

21
Q

Q: What are intrinsic functions in CloudFormation?

A

A: Built-in functions like Fn::GetAtt, Ref, and Fn::Sub used to reference resource attributes, parameters, or strings in templates.

22
Q

Q: What is the difference between Terraform and CloudFormation?

A

A: Terraform is multi-cloud and open-source, while CloudFormation is AWS-specific and tightly integrated with AWS services.

23
Q

Q: What tools are used to test IaC?

A

A: Tools like Terratest, AWS CloudFormation Guard, and Checkov are used for validating and testing IaC templates.

24
Q

Q: Why is version control important for IaC?

A

A: It tracks changes to infrastructure configurations, enables collaboration, and supports rollback in case of issues.

25
Q

Q: Which formats are supported for CloudFormation templates?

A

A: JSON and YAML.

26
Q

Q: What are the lifecycle stages managed by IaC?

A

A: Provisioning, configuration, scaling, updates, and decommissioning.

27
Q

Q: Why are IAM roles important for IaC?

A

A: IAM roles provide secure, fine-grained permissions for provisioning and managing resources programmatically.

28
Q

Q: What are nested stacks in CloudFormation?

A

A: Stacks created as part of another stack to organize and manage resources hierarchically.

29
Q

Q: What is the CloudFormation Registry?

A

A: A repository of AWS and third-party resource types available for use in CloudFormation templates.

30
Q

Q: What are best practices for managing state in IaC?

A

A: Use remote state storage (e.g., S3 for Terraform), enable state locking, and back up state files regularly.

31
Q

Q: How can drift in IaC be prevented?

A

A: Regularly run drift detection, avoid manual changes, and enforce automated deployments via pipelines.

32
Q

Q: How does IaC integrate with CI/CD pipelines?

A

A: By automating deployment and updates of infrastructure alongside application code using tools like CodePipeline or Jenkins.

33
Q

Q: What is immutable infrastructure in IaC?

A

A: An approach where infrastructure changes are made by replacing resources rather than updating them in place.

34
Q

Q: How does IaC enable self-healing infrastructure?

A

A: By defining health checks, auto-scaling, and automated recovery mechanisms in templates.

35
Q

Q: What are best practices for securing IaC?

A

A: Use IAM roles, encrypt sensitive data, validate templates, and scan for misconfigurations with tools like Checkov.

36
Q

Q: How can IaC help with cost management?

A

A: By automating resource provisioning and decommissioning, tagging resources, and enforcing cost optimization policies.

37
Q

Q: What is infrastructure drift?

A

A: A condition where the actual infrastructure differs from the IaC definition due to manual changes.

38
Q

Q: What are best practices for declarative IaC?

A

A: Keep templates modular, use parameters, avoid hardcoding values, and version-control everything.

39
Q

Q: Why is documentation important for IaC?

A

A: It ensures understanding, maintainability, and proper usage of IaC templates across teams.

40
Q

Q: What are stack policies in CloudFormation?

A

A: Policies that restrict updates to stack resources to protect critical resources from accidental changes.