> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rad.security/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Using Terraform

> Integrate your cloud infrastructure with RAD Security using Terraform for enhanced threat detection and compliance

# Connect Using Terraform Setup

Integrate your cloud infrastructure with RAD Security using Terraform to leverage enhanced threat detection capabilities and ensure your cloud environments adhere to stringent compliance frameworks.

## Prerequisites

Before initiating the cloud connection process, ensure you have:

* An **active RAD Security account**
* **Terraform** installed on your local machine

If you've previously set up cloud connections, you may have:

* An **optional cloud connect key**

## Connection Setup

1. Navigate to the Settings icon in your RAD Security dashboard
2. Find the `Cloud Providers` section
3. Click on the desired cloud provider you wish to connect to generate your configuration

## Terraform Setup

A Terraform snippet will be displayed on the screen. This is to be used in your Terraform configuration file **main.tf**. Copy the Terraform snippet by clicking on the copy icon in the top right corner and paste the copied code into your **main.tf** file.

### Cloud Connect Key Configuration

To automatically generate and input your cloud connect key into the configuration, you can provision a key within the UI by clicking on `Generate a cloud plugin key`.

Alternatively, you can manually provision cloud keys by clicking on the "Cloud Provisioning Keys" tab in Settings → Cloud Providers, and then clicking on the "New cloud provisioning key" button. You can then use those credentials in your **variables.tf**.

There might be additional variables that are needed based on the cloud provider:

```hcl theme={null}
variable "access_key_id" {
  description = "The access key ID for RAD Security."
  type        = string
}

variable "secret_key" {
  description = "The secret key for RAD Security."
  type        = string
}
```

<Note>
  **Security Best Practice**: We do not recommend storing actual credentials in the file. Use your standard secrets approach, environment variables, or prompt for these values when applying Terraform. This site contains some recommendations for good practices with secrets.
</Note>

## Terraform Execution

Run the following Terraform commands in your terminal:

### 1. Initialize Terraform

```bash theme={null}
terraform init
```

This should give a confirmation that Terraform has been successfully initialized.

### 2. Plan Changes

```bash theme={null}
terraform plan
```

This displays a summary of the actions Terraform plans to perform, such as creating, updating, or deleting resources. The output concludes with a message indicating that the plan was created successfully, showing the number of resources to be added, changed, or destroyed.

### 3. Apply Configuration

```bash theme={null}
terraform apply
```

This should give detailed list of the changes applied to the infrastructure, similar to the plan, but with confirmation that each resource has been created, updated, or deleted as expected. It ends with a message confirming the successful application of the plan, including the number of resources added, changed, or destroyed.

## Verification

After executing the Terraform code:

1. Click 'Continue' in the RAD Security UI
2. Monitor the account screen for the appearance of your cloud account
3. Confirm the integration has been successful

## Supported Cloud Providers

Terraform integration is available for:

* **Amazon Web Services (AWS)**
* **Microsoft Azure**
* **Google Cloud Platform (GCP)**
* **Linode**

## Next Steps

After successful Terraform integration:

1. **Review Security Findings**: Check the Evidence Room for any immediate security issues
2. **Configure Alerts**: Set up notifications for critical security events
3. **Enable Compliance Scanning**: Activate compliance monitoring for your industry standards
4. **Set Up Workflows**: Create automated responses to security events

For cloud provider-specific setup guides, see:

* [AWS Setup](/rad-security/integrations/aws-setup)
* [Azure Setup](/rad-security/integrations/azure-setup)
* [Google Cloud Platform Setup](/rad-security/integrations/gcp-setup)
* [Linode Setup](/rad-security/integrations/linode-setup)
