Knowledge Check - Infrastructure as Code

Test your understanding of the key concepts from Module 2. Select the best answer for each question, then submit to see your results. You need to score at least 60% to pass.

1.

A developer adds a package to the cloud-config file that TaskBoard's API server reads through user_data = base64encode(file("cloud-init/api.yaml")) in its inline volume. After terraform apply, the running server still does not have the package. What is the correct way to get the new configuration onto the server?

2.

TaskBoard's worker sits only in the private app LAN. The developer creates this NAT gateway and an SNAT rule with source_subnet = "10.10.1.0/24" and protocol = "ALL". From the worker, curl https://example.com still times out.

resource "ionoscloud_natgateway" "egress" {
  datacenter_id = ionoscloud_datacenter.taskboard.id
  name          = "taskboard-nat"
  public_ips    = [ionoscloud_ipblock.nat.ips[0]]
  lans {
    id          = ionoscloud_lan.app.id
    gateway_ips = ["10.10.1.4"]
  }
}

What is missing?

3.

A developer attaches a new Network Security Group with no rules to the app-tier NIC of the API server. The NIC sits in the ALB's target LAN, and the ALB uses lb_private_ips = ["10.10.1.6/24"]. Immediately, the ALB health checks fail. Which change restores traffic from the load balancer while keeping the tier closed to other clients?

4.

A CI pipeline runs terraform apply for TaskBoard's storage tier. It sets only IONOS_TOKEN. The plan contains this resource, and the apply fails with an authentication error for the bucket:

resource "ionoscloud_s3_bucket" "uploads" {
  name   = "taskboard-uploads-dev-7f3a"
  region = "eu-central-3"
}

Which change fixes the pipeline?

5.

TaskBoard's PostgreSQL cluster is defined with ionoscloud_pg_cluster_v2, and the password comes from var.pg_password. After a security review, the developer stores a new password in the secret store and runs terraform plan. The plan shows no changes. What should the developer do?

credentials = {
  username         = "taskboard"
  password         = var.pg_password
  password_version = "1"
  database         = "taskboard"
}