LinuxCommandLibrary

pulumi-login

Authenticate Pulumi CLI with a backend

TLDR

Log in to the managed Pulumi Cloud backend, defaults to app.pulumi.cloud

$ pulumi login
copy

Log in to a self-hosted Pulumi Cloud backend on a specified URL
$ pulumi login [url]
copy

Use Pulumi locally, independent of a Pulumi Cloud
$ pulumi login [[-l|--local]]
copy

SYNOPSIS

pulumi login [flags] [URL]

PARAMETERS

--cloud-url URL
    The URL to the Pulumi Cloud or a self-hosted Pulumi backend.

--local
    Login to a local file system backend.

--access-token string
    The access token to use for authentication with the Pulumi Cloud. This can also be provided by the PULUMI_ACCESS_TOKEN environment variable. Used mainly for automating login.

--help
    Show help for login command

DESCRIPTION

The `pulumi-login` command authenticates the Pulumi CLI with a Pulumi backend. This backend is where Pulumi stores your stack's state, history, and other metadata. By default, it will log you into the Pulumi Cloud, which is managed by Pulumi, Inc. Alternatively, it can be used to log into a self-hosted Pulumi backend, such as a local file system or a cloud storage bucket. The command prompts for an access token if logging into Pulumi Cloud. For other backends, it might prompt for configuration details such as the URL of the backend endpoint or the path to the storage location. It will store login information in the pulumi home directory.

CAVEATS

The Pulumi CLI stores the authentication token in a plain text file in the Pulumi home directory (~/.pulumi). Ensure that this directory is properly protected and its contents are not exposed to unauthorized users. Always remember to securely manage your access tokens.
Using `--local` stores the Pulumi state on the local filesystem. This method is not suitable for team environments or managing production infrastructure.

BACKEND URLS

The URL parameter can be used to specify the backend location. For example, to log into a self-hosted Pulumi backend running at `https://my-pulumi-backend.com`, you would use `pulumi login https://my-pulumi-backend.com`. When using `--local` the URL should be left blank or the `file://` scheme should be used, which will store the state file in the user's home directory. Example: `pulumi login file:///path/to/state/dir`. Using `--local` is recommended only for development and testing.

HISTORY

The `pulumi login` command has been a part of the Pulumi CLI since its initial release. The command's functionality has been refined over time to support different backend options (Pulumi Cloud, self-hosted backends, local file system) and authentication methods. Its development has been driven by the need to provide a secure and flexible way to manage Pulumi projects and state across various deployment environments.

SEE ALSO

pulumi logout(1), pulumi stack(1), pulumi config(1)

Copied to clipboard