The Terraform task runs Terraform `apply`.
50K+
This Terraform step container runs Terraform apply.
Use the following specifications:
| Setting | Child setting | Data type | Description | Default | Required |
|---|---|---|---|---|---|
provider | string | The cloud provider to use. Currently "aws" or "gcp". | gcp | False | |
credentials | mapping | A map of platform credentials. | None | True | |
credentials.json | mapping | The GCP service account file contents. Pass the contents to Nebula as a secret. See the example below. | None | True for gcp | |
credentials | mapping | The AWS shared account file contents. Pass the file contents into Nebula as a secret. See the example below. | None | True for aws | |
backendConfig | mapping | A map of configuration to pass to the terraform backend as -backend-config options. | None | False | |
vars | mapping | A map of variables that are interpolated into the terraform configuration files. | None | False | |
workspace | string | A name for the Terraform workspace to use. | default | False | |
directory | string | The directory in the git repo that contains your Terraform modules and resources. | default | False | |
git | mapping | A map of git configuration. If you're using HTTPS, only name and repository are required. | None | False | |
ssh_key | string | The SSH key to use when cloning the git repository. You can pass the key into Nebula as a secret. See the example below. | None | True | |
known_hosts | string | SSH known hosts file. Pass the contents of the file into Nebula as a secret. See the example below. | None | True | |
name | string | A directory name for the git clone. | None | True | |
branch | string | The Git branch to clone. | master | False | |
repository | string | The git repository URL. | None | True |
Note: The value you set for a secret must be a string. If you have multiple key-value pairs to pass into the secret, or your secret is the contents of a file, you must encode the values using base64 encoding, and use the encoded string as the secret value.
All outputs you specify in your Terraform workspace are mapped to Nebula outputs as 1:1 key-value pairs.
Here is an example of the step in a Nebula workflow:
steps:
...
- name: terraform
image: projectnebula/terraform:latest
spec:
provider: gcp
credentials:
credentials.json:
$type: Secret
name: credentials
workspace: my_workspace
directory: infra/app
git:
ssh_key:
$type: Secret
name: ssh_key
known_hosts:
$type: Secret
name: known_hosts
name: my-git-repo
branch: dev
repository: path/to/your/repo
docker pull projectnebula/terraform:latest