layout | page_title | sidebar_current | description |
---|---|---|---|
codefresh |
Provider: Codefresh |
docs-codefresh-index |
The Codefresh provider is used to manage Codefresh resources. |
The Codefresh Provider can be used to configure Codefresh resources - pipelines, projects, accounts, etc using the Codefresh API.
The Codefresh API requires the authentication key to authenticate.
The key can be passed either as the provider's attribute or as environment variable - CODEFRESH_API_KEY
.
api_url
(String) The Codefresh API URL. Defaults tohttps://g.codefresh.io/api
. Can also be set using theCODEFRESH_API_URL
environment variable.api_url_v2
(String) The Codefresh gitops API URL. Defaults tohttps://g.codefresh.io/2.0/api/graphql
. Can also be set using theCODEFRESH_API2_URL
environment variable.token
(String) The Codefresh API token. Can also be set using theCODEFRESH_API_KEY
environment variable.
The Codefresh API only allows one to operate with the entities in the account tied to the API Key the provider is configured for.
To be able to operate with entities in different accounts, you should create a new key in the relevant account and use providers aliases.
For example:
provider "codefresh" {
api_key = "..."
}
provider "codefresh" {
api_key = "..."
alias = "acme-dev"
}
resource "codefresh_pipeline" "pipeline" {
... # Omited for brevity
}
resource "codefresh_pipeline" "pipeline-dev" {
provider = codefresh.acme-dev
... # Omited for brevity
}