atmos terraform login
Use this command to authenticate with Terraform Cloud or Terraform Enterprise for an Atmos component in a stack.
This command is specific to Terraform and is not available in OpenTofu. OpenTofu removed Terraform Cloud integration features.
Usage
Execute the terraform login command like this:
atmos terraform login <component> [hostname] -s <stack> [options]
This command retrieves an API token from Terraform Cloud or Terraform Enterprise and saves it locally for use with other commands that require authentication.
This is a pure passthrough command. Atmos does not perform automatic initialization or workspace management for terraform login. The command is executed directly to manage Terraform Cloud credentials.
Examples
Login to Terraform Cloud
# Login to app.terraform.io (default)
atmos terraform login vpc -s dev
Login to Terraform Enterprise
# Login to a specific host
atmos terraform login vpc -s dev terraform.company.com
Arguments
component(required)Atmos component name.
hostname(optional)Optional hostname of Terraform Cloud or Terraform Enterprise (e.g.,
terraform.company.com). If not provided, defaults toapp.terraform.io.
Flags
--stack/-s(required)Atmos stack name where the component is defined.
--skip-init(optional)Skip running
terraform initbefore executing the command.atmos terraform login vpc -s dev --skip-init--dry-run(optional)Show what would be executed without actually running the command.
atmos terraform login vpc -s dev --dry-run
Native Terraform Flags
This command supports native terraform login flags, such as an optional hostname argument. The token is saved in the credentials file.
Related Commands
atmos terraform plan- Generate execution planatmos terraform apply- Apply changesatmos terraform init- Initialize working directory