0
0
Terraformcloud~5 mins

Remote state data source for cross-project in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a remote state data source in Terraform?
A remote state data source lets Terraform read the saved state of infrastructure from another project or workspace. This helps share information between projects safely.
Click to reveal answer
beginner
Why use remote state data source for cross-project references?
It allows one Terraform project to access outputs or resources from another project without duplicating resources or manual syncing.
Click to reveal answer
intermediate
Which backend is commonly used for storing remote state in Terraform for cross-project access?
Backends like AWS S3, Google Cloud Storage, or Terraform Cloud are commonly used to store remote state securely and allow cross-project access.
Click to reveal answer
intermediate
What is the key block to define a remote state data source in Terraform?
The key block is `data "terraform_remote_state"` which specifies the backend and configuration to read the remote state.
Click to reveal answer
advanced
How do you ensure security when accessing remote state across projects?
Use proper access controls on the backend storage, encrypt state files, and limit permissions to only what is needed for reading state.
Click to reveal answer
What Terraform block is used to access remote state from another project?
Aoutput "remote_state"
Bdata "terraform_remote_state"
Cresource "remote_state"
Dmodule "remote_state"
Which of these is NOT a common backend for storing Terraform remote state?
ALocal file system
BAWS S3
CTerraform Cloud
DGoogle Cloud Storage
Why is remote state important for cross-project Terraform setups?
ATo store logs
BTo speed up Terraform runs
CTo share resource outputs between projects
DTo avoid writing Terraform code
What must you configure in the remote state data source to access a specific project’s state?
AOutput variables
BTerraform version
CResource tags
DBackend type and configuration details
How can you protect sensitive data in remote state files?
AEncrypt the state file and restrict access permissions
BStore state files locally
CUse plain text files
DShare state files publicly
Explain how to configure a Terraform remote state data source to read state from another project.
Think about the backend and how Terraform reads remote state.
You got /4 concepts.
    Describe best practices for securely sharing Terraform remote state across projects.
    Focus on security and access control.
    You got /4 concepts.