Learning Material for IIKG3005
This course allows examination aids, and is not a multiple choice based exam.
What is a primary benefit of defining infrastructure as code? Select one alternative: Why is transparency important in infrastructure as code? Select one alternative Which of the following best describes the core practice of continuously testing and delivering all work in progress? Select one alternative What advantage does building small, simple pieces in infrastructure code offer? Increased system unpredictability. Increased manual intervention in deployment processes. Reduced consistency in environment setups. Ability to quickly create and rebuild multiple instances. Systems built from code are built differently each time. Inconsistent testing and delivery mechanisms. Systems built from code are built the same way every time, ensuring predictable behavior. Systems behave differently each time they are deployed. Delivering work items only at the end of the development cycle. Deploying without testing. Avoiding testing until deployment. Testing and delivering changes as soon as they are ready.IIKG3005 Infrastructure as Code 3 / 9 Select one alternative In infrastructure as code, reusability implies that: Select one alternative Which of the following best describes an Infrastructure Stack? Select one alternative What does Stack Code refer to in the context of Infrastructure as Code? Select one alternative They can be changed independently without affecting the whole system. They require more resources to manage. They are hard to understand and change. They are complex to troubleshoot. You can reuse the code only for that instance after it's deployed. You can create many instances from the defined code. The code becomes obsolete quickly. The code is valid for a single use. A specific configuration of software applications. A set of infrastructure elements defined by code that can be deployed and managed together. A collection of software tools for infrastructure management. A physical stack of server hardware in a data center. The compiled binaries used to run infrastructure tools. Documentation describing the intended infrastructure architecture. The source code that declares what infrastructure elements a stack should include. Any code written in high-level programming languages for infrastructure.IIKG3005 Infrastructure as Code 4 / 9 When using a single stack project to provision more than one stack instance, what is the role of the stack tool? Select one alternative What is a key benefit of using established patterns for building environments in Infrastructure as Code? Select one alternative What is a characteristic of a Multiple-Environment Stack in Infrastructure as Code? Select one alternative What is a primary drawback of the 'Copy-Paste Environments' antipattern? It compiles the stack code into an executable format. It only verifies the existing stack instances without making any changes. It only creates new stack instances and does not modify existing ones. It ensures each stack instance exists and matches the project code, creating or modifying as needed. They offer a standard approach to building and managing environments, improving consistency and efficiency. They increase the complexity of the infrastructure for better security. They restrict the scalability and flexibility of the infrastructure. They are only useful for small-scale infrastructures. It uses different cloud providers for different environments. It requires separate physical servers for each environment. It uses a single stack instance to manage infrastructure for multiple environments like test, staging, and production. It automatically merges code changes across environments.IIKG3005 Infrastructure as Code 5 / 9 Select one alternative What defines a 'Reusable Stack' in Infrastructure as Code? Select one alternative What is one of the trade-off factors to consider when deciding whether to separate projects into different repositories or keep them in a single repository? Select one alternative When is declarative code most useful in the context of defining infrastructure? It can lead to inconsistencies and errors due to manual replication of changes across environments. It enhances automated testing and integration. It reduces the time needed for environment setup. It is only applicable for non-cloud environments. A stack that is tied to a specific cloud provider. A stack that is manually copied for each new environment. An infrastructure code base used to create multiple instances of a stack, enhancing maintainability and scalability. A stack that can only be used once and then discarded. Enhanced version control features Easier maintenance of code boundaries Simplified team collaboration Improved performance for large codebasesIIKG3005 Infrastructure as Code 6 / 9 Select one alternative What is one of the key benefits of integrating Infrastructure as Code (IaC) using Terraform with GitHub repositories for managing cloud infrastructure? Select one alternative When you need to produce different outcomes depending on the situation When you want to write complex logic in YAML or JSON When there is significant variation in the desired infrastructure outcomes When you want to build sharable code for different application servers Enhanced collaboration and version tracking Increased complexity of infrastructure deployments Elimination of the need for Terraform workspaces Reduced need for version control Maximum marks: 30IIKG3005 Infrastructure as Code 7 / 9 2 Improve code-example Improve the given code example. You can write # main.tf and # variables.tf etc. to illustrate where you "create a new fil" in your answer. Copy and paste the parts you want to edit in the answer section. provider "azurerm" { features {} } # Resource Group resource "azurerm_resource_group" "rg" { name = "rg-demo" location = "West Europe" } # Virtual Network resource "azurerm_virtual_network" "vnet" { name = "my-vnet" address_space = ["10.0.0.0/16"] location = "West Europe" resource_group_name = "rg-demo" } # Subnet resource "azurerm_subnet" "subnet" { name = "my-subnet" resource_group_name = "rg-demo" virtual_network_name = "my-vnet" address_prefixes = ["10.0.1.0/24"] } # Virtual Machine resource "azurerm_linux_virtual_machine" "vm" { name = "my-vm" location = "West Europe resource_group_name = "rg-demo" network_interface_ids = [azurerm_network_interface.example.id] size = "Standard_DS1_v2" admin_username = "adminuser" admin_password = "P@ssw0rd!" } # Network Interface resource "azurerm_network_interface" "nic" { name = "my-nic" location = "West Europe resource_group_name = "rg-demo" } # Security Group resource "azurerm_network_security_group" "nsg" { IIKG3005 Infrastructure as Code 8 / 9 name = "my-nsg" location = "West Europe" resource_group_name = "rg-demo" } Fill in your answer here Maximum marks: 20 1IIKG3005 Infrastructure as Code 9 / 9 3 IaC CI/CD - Terraform and Github (50%) You are tasked with implementing an end-to-end Infrastructure as Code (IaC) workflow for managing and deploying cloud infrastructure on Microsoft Azure using Terraform. Your goal is to follow known practices and ensure a smooth, collaborative development process. Please provide a description of each step involved in this workflow, and must contain at least the following: Describe how you would structure your Terraform codebase for this project. Explain the concept of Terraform workspaces and how you would utilize them in this project. Provide examples of when and why you would create different workspaces. Elaborate on how you would use Github for version control and how you would set up branches for future development of different parts of the infrastructure. Describe how you would configure GitHub Actions to perform testing when changes are pushed to different branches. Include examples of the types of tests you would run Outline the process of creating a pull request (PR) when a feature or bug fix is complete. Explain how code review would be conducted and what criteria need to be met before a PR is merged into the main branch. How would you implement a CI/CD pipeline to automate the deployment of infrastructure changes to Azure when changes are merged into the main branch. Include any tools or services you would use for this purpose. Write the answer in the desired language (English/Norwegian) Fill in your answer here Format Σ