# CircleCI

![CircleCI-logo.svg](https://assets.relyanceuat.xyz/images/docs/12089343913869/12089288516365.svg)
CircleCI is a continuous integration and continuous delivery platform that can be used to implement DevOps practices. It helps development teams release code rapidly by automating build, test, and code deployments.

In order to integrate CircleCI with Relyance AI you will need an **API Key**.

#### In CircleCI:

1. Login to your CircleCI account.
2. Click on the user profile icon at the bottom of the left-hand navigation menu.
3. This will show the **User Settings** page. Click on **Personal API Tokens** in the left-hand navigation menu.
4. Click on **Create New Token**.
5. This will open up a dialog box to create the new token. Give it a meaningful name (e.g. Relyance Scan) and click **Add API Token**.
6. This will present your new **API Token**. Copy it to be used in Relyance.

![CircleCI-ps-3.png](https://assets.relyanceuat.xyz/images/docs/12089343913869/12089750788493.png)

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendors and Data Stores** filter.
5. Find the **CircleCI** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Custom**.
8. Paste the **API Key** into its respective field.

![CircleCI-ps-1.png](https://assets.relyanceuat.xyz/images/docs/12089343913869/12089406546701.png)

The **Authentication** step asks for:

- **API Key**: required; held as a secret.

9. Click **Authenticate**.
10. At this point, you should see the following result on the **Vendor** Integrations page:

![CircleCI-ps-2.png](https://assets.relyanceuat.xyz/images/docs/12089343913869/12089390704653.png)

11. Congratulations, you are now connected to **CircleCI**.

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

```hcl
resource "relyance_integration_connection" "circleci" {
  vendor = "circleci"
  name   = "<your connection name>"

  auth = {
    method = "api-key"
    params = {
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      api_key = var.circleci_api_key
    }
    secrets_wo_version = 1
  }

  scans = { "property-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
