Init Command
Initialize Pluralith in the current working directory and generate a config file (pluralith.yml) for CI.
pluralith init [flags]
Example
The pluralith init
command initializes Pluralith in your current working directory and creates a config file (pluralith.yml
). Run pluralith init
at the level you usually run your Terraform commands on and follow the wizard to create a valid pluralith.yml
. Alternatively you can generate an empty config file by running pluralith init --empty
and populate it yourself.
pluralith init --api-key $PLURALITH_API_KEY --org-id $PLURALITH_ORG_ID --project-id $PLURALITH_PROJECT_ID --project-name $PLURALITH_PROJECT_NAME
pluralith run plan --show-changes --show-costs --show-drift
Where To Find Things
- The
org-id
can also be found in the Pluralith dashboard (by clicking on your org name in the right upper corner and then on 'Organisation Settings'). - The
project-id
can also be found in the Pluralith dashboard (by opening a project and clicking on settings in the left menu). You can also pass your ownproject-id
here, if Pluralith detects that no project with thisproject-id
exists it will create a new one. Theproject-id
can only consist of lowercase letter, numbers and dashes (-). - The
project-name
is only necessary when you pass aproject-id
that doesn't exist yet. In that case theproject-name
will be used for project creation. Theproject-name
is what will be shown in your project grid in the Pluralith dashboard.
How To Pass Things To Init
There are a few options to pass configuration to the init
command. In the list below they are ordered by how the CLI prioritizes them (meaning 3. will override 2., 2. will override 1.)
- Environment Variables: Set the following variables and the CLI will pick them up automatically.
- $PLURALITH_API_KEY
- $PLURALITH_ORG_ID
- $PLURALITH_PROJECT_ID
- $PLURALITH_PROJECT_NAME
Config File: Run
pluralith init
locally in the root directory of your Terraform project, follow the wizard and commit the resulting pluralith.yml to your repo.Flags: Pass the necessary parameters to initialize a project via flags. All availabe flags are listed blow.
Available Flags
--api-key | Your Pluralith API key. Pass via flag to skip user prompt. | string |
--org-id | Your Org Id (Can be found in your Pluralith dashboard). Pass via flag to skip user prompt and override pluralith.yml | string |
--project-id | Your Project Id (If no project with passed Id exists, one gets created). Pass via flag to skip user prompt and override pluralith.yml | string |
--project-name | Your Project name. Pass via flag to skip user prompt and override pluralith.yml | string |
--empty | Creates an empty pluralith.yml | bool |