0
0
Terraformcloud~10 mins

Terraform Cloud/Enterprise features - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Terraform Cloud workspace name.

Terraform
terraform {
  cloud {
    organization = "my-org"
    workspaces {
      name = "[1]"
    }
  }
}
Drag options to blanks, or click blank then click option'
Amy-workspace
Bworkspace_id
Cdefault
Dterraform-cloud
Attempts:
3 left
💡 Hint
Common Mistakes
Using workspace_id instead of the workspace name string.
Leaving the name field empty.
Using an invalid workspace name.
2fill in blank
medium

Complete the code to enable remote state storage in Terraform Cloud.

Terraform
terraform {
  backend "remote" {
    organization = "my-org"
    workspaces {
      name = "my-workspace"
    }
    [1] = true
  }
}
Drag options to blanks, or click blank then click option'
Askip_remote_apply
Bremote_state_enabled
Cskip_credentials_validation
Dauto_init
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing option names related to remote state.
Using options that do not exist in the backend block.
3fill in blank
hard

Fix the error in the policy set block to attach a policy to a workspace.

Terraform
resource "tfe_policy_set" "example" {
  name         = "example-policy-set"
  organization = "my-org"
  [1] = [tfe_workspace.example.id]
}
Drag options to blanks, or click blank then click option'
Aworkspace_id
Bworkspace_ids
Cworkspaces
Dworkspace
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular attribute names instead of plural.
Passing a single ID instead of a list.
4fill in blank
hard

Fill both blanks to configure a VCS repository for Terraform Cloud workspace.

Terraform
resource "tfe_workspace" "example" {
  name         = "example-workspace"
  organization = "my-org"
  vcs_repo {
    identifier     = "[1]"
    branch         = "[2]"
  }
}
Drag options to blanks, or click blank then click option'
Amy-org/my-repo
Bmain
Cdevelop
Dmy-repo
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the repo name without organization in identifier.
Using an invalid branch name.
5fill in blank
hard

Fill all three blanks to define a Sentinel policy resource with enforcement level and source.

Terraform
resource "tfe_policy" "example" {
  name             = "example-policy"
  organization     = "my-org"
  enforcement_level = "[1]"
  policy           = "[2]"
  description      = "[3]"
}
Drag options to blanks, or click blank then click option'
Ahard-mandatory
Bsoft-mandatory
Csentinel/policy.sentinel
DPolicy to enforce security rules
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid enforcement levels.
Incorrect policy code format.
Leaving description empty.