Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

turo/terraform-provider-cyral

 
 

Repository files navigation

Cyral Terraform Provider

The Cyral Terraform Provider contains resources that can be used to interact with the Cyral API through Terraform code. It allows customers to maintain a history of changes in Cyral environment by transforming configurations into code and use Terraform to control state changes.

Our provider uses the same naming conventions and organization as stated in Terraform guidelines for writing custom providers.

Documentation

Full and comprehensive documentation for this provider is available on the provider documentation index.

Change Log

The Change Log keeps track of features, bug fixes and Control Plane compatibility of this provider.

Guides

See below a list of guides that can be used to deploy some predefined scenarios:

Building and Testing

Build Instructions

In order to build this repository, follow the steps below:

  1. Clone terraform-provider-cyral repo from GitHub;

  2. Go to the root directory of the cloned repo using Linux shell and execute make. The build process will create binaries in directory out for both darwin and linux 64 bits. These binaries will be copied automatically to the local Terraform registry to be used by Terraform 13 and later.

Alternatively, you can use the dockerfile to build the image using make docker-compose/build

To use the local provider, the module must be configured to use the local provider path as follows:

terraform {
  required_providers {
    cyral = {
      source = "local/terraform/cyral"
    }
  }
}

Test Instructions

The test framework requires basic configuration before it can be executed as follows:

  1. Set the configuration environment variables:
# Set the control plane DNS name and port (default 8000):
export CYRAL_TF_CONTROL_PLANE=mycp.cyral.com:8000

# Set Keycloak client and secret ID:
export CYRAL_TF_CLIENT_ID=?
export CYRAL_TF_CLIENT_SECRET=?

# Initialize Terraform acceptance tests variable
export TF_ACC=true
  1. Run make

Commit instructions

This project uses pre-commit to automatically lint changes during the commit process.

Before committing a change, you will need to install pre-commit and then install the hooks by running the following command in the root of the repository:

pre-commit install

Running Project Built Locally

Terraform v0.12

Copy the desired binary file created in directory out (see Build Instructions) to the root folder containing those .tf files that will be used to handle Cyral Terraform provider resources.

Run terraform init and proceed with terraform apply normally to execute your Terraform scripts.

Terraform v0.13+

Build the project using steps in Build Instructions, then proceed normally with terraform init and terraform apply commands.

Packages

No packages published

Languages

  • Go 97.8%
  • Makefile 1.1%
  • Other 1.1%