Which TWO of the following are valid use cases for using Terraform Cloud's Sentinel policies? (Choose two.)
Trap 1: Provide cost estimates for infrastructure changes
Sentinel's primary function is policy enforcement, evaluating resource attributes against defined rules to ensure compliance and security. It is not designed for financial analysis or cost projection. While Terraform Cloud offers integrated cost estimation features that analyze a `terraform plan` to provide projected expenses, this functionality operates as a distinct service, separate from Sentinel's policy evaluation engine, which focuses on governance rather than monetary forecasting.
Trap 2: Enforce that all Terraform code follows a specific formatting style
Sentinel policies are designed to evaluate the *semantic content* and *attributes* of resources within a Terraform plan or state, not the stylistic presentation of the underlying HCL source code. The dedicated tool for enforcing a consistent formatting style across Terraform configuration files is `terraform fmt`. This command automatically rewrites HCL files to a canonical format, ensuring code readability and uniformity, a task distinct from Sentinel's role in enforcing resource-level governance rules.
Trap 3: Automatically rotate database passwords
Sentinel is a policy-as-code framework focused on governance and pre-deployment validation of infrastructure configurations, not on operational security tasks like automated credential management. The rotation of database passwords is a dynamic security operation typically handled by dedicated secret management solutions such as HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault. These tools integrate directly with databases and applications to securely store, access, and automatically rotate sensitive credentials, a function entirely outside Sentinel's scope.
- A
Provide cost estimates for infrastructure changes
Why wrong: Sentinel's primary function is policy enforcement, evaluating resource attributes against defined rules to ensure compliance and security. It is not designed for financial analysis or cost projection. While Terraform Cloud offers integrated cost estimation features that analyze a `terraform plan` to provide projected expenses, this functionality operates as a distinct service, separate from Sentinel's policy evaluation engine, which focuses on governance rather than monetary forecasting.
- B
Enforce that all Terraform code follows a specific formatting style
Why wrong: Sentinel policies are designed to evaluate the *semantic content* and *attributes* of resources within a Terraform plan or state, not the stylistic presentation of the underlying HCL source code. The dedicated tool for enforcing a consistent formatting style across Terraform configuration files is `terraform fmt`. This command automatically rewrites HCL files to a canonical format, ensuring code readability and uniformity, a task distinct from Sentinel's role in enforcing resource-level governance rules.
- C
Enforce that all AWS instances are of a specific type
Sentinel is highly effective for enforcing resource attribute constraints by inspecting the `tfplan` data. A policy can be written to specifically target `aws_instance` resources and validate their `instance_type` attribute against a predefined list of approved values, such as `t3.micro` or `m5.large`. This capability allows organizations to prevent the provisioning of non-compliant or overly expensive instance types, ensuring adherence to cost optimization and performance standards before infrastructure is deployed.
- D
Automatically rotate database passwords
Why wrong: Sentinel is a policy-as-code framework focused on governance and pre-deployment validation of infrastructure configurations, not on operational security tasks like automated credential management. The rotation of database passwords is a dynamic security operation typically handled by dedicated secret management solutions such as HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault. These tools integrate directly with databases and applications to securely store, access, and automatically rotate sensitive credentials, a function entirely outside Sentinel's scope.
- E
Enforce that all resources have required tags
Sentinel policies are an excellent mechanism for enforcing tagging standards across all provisioned resources. By analyzing the `tfplan`, a policy can iterate through every resource slated for creation or modification and verify the presence of specific mandatory tags, such as `Owner`, `Environment`, or `CostCenter`. This ensures that all infrastructure components are properly categorized for cost allocation, operational management, and compliance purposes, preventing the deployment of untagged or improperly tagged resources.