terraform-provider-idsec

command module
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

README

Terraform Provider Idsec

License

Terraform Provider Idsec

CyberArk's Official Terraform Provider for CyberArk. This provider allows you to manage CyberArk resources using Terraform.

Installation

Install from Terraform Registry
terraform {
  required_providers {
    idsec = {
      source  = "cyberark/idsec"
      version = ">= 0.1"
    }
  }
}
Install from Source
git clone https://github.com/cyberark/terraform-provider-idsec.git
cd terraform-provider-idsec
make build

Provider Configuration

The provider automatically discovers your tenant based on your credentials. You only need to provide:

  • auth_method - Authentication method (identity or identity_service_user)
  • username - Your CyberArk username (for identity method)
  • secret - Your password (for identity method)

Optional: Set DEPLOY_ENV environment variable for non-production environments (e.g., integration-dev).

Note: No subdomain or tenant URL configuration is required. The provider automatically discovers your tenant from your username and environment.

Environment Variables

You can configure the provider using environment variables:

export DEPLOY_ENV=integration-dev          # Optional: for non-production environments
export IDSEC_USERNAME=user@cyberark.cloud  # Your CyberArk username
export IDSEC_SECRET=your-password          # Your password
export IDSEC_AUTH_METHOD=identity          # Authentication method

Example Usage

terraform {
  required_providers {
    idsec = {
      source  = "cyberark/idsec"
      version = ">= 0.1"
    }
  }
}

provider "idsec" {
  auth_method = "identity"
  username    = var.idsec_username
  secret      = var.idsec_secret
}

resource "idsec_cmgr_network" "example_network" {
  name = "example_network"
}

resource "idsec_cmgr_pool" "example_pool" {
  name                  = "example_pool"
  description           = "A pool for example resources"
  assigned_network_ids  = [idsec_cmgr_network.example_network.network_id]
}

resource idsec_sia_access_connector "example_connector" {
  connector_type    = "ON-PREMISE"
  connector_os      = "linux"
  connector_pool_id = idsec_cmgr_pool.example_pool.pool_id
  target_machine    = "1.1.1.1"
  username          = "ec2-user"
  private_key_path  = "~/.ssh/key.pem"
}

In this example, we create a network, a pool, and a SIA connector using the Idsec Terraform provider. The access connector is configured to be installed on the ec2 machine with the given private key and username.

More examples can be found in the examples directory.

Provider Configuration can be found in the provider documentation.

Schemas can be found in the relevant documentation for each resource / data source.

Immutable Attributes

Resources can mark attributes as immutable to prevent changes after resource creation. Configure immutable attributes in your action definition:

&actions.IdsecServiceTerraformResourceActionDefinition{
    IdsecServiceBaseTerraformActionDefinition: actions.IdsecServiceBaseTerraformActionDefinition{
        // ... other fields
        ImmutableAttributes: []string{"field_name", "another_field"},
    },
}

Attempts to modify immutable attributes will result in clear error messages during terraform plan.

Customizing Documentation Service Names

Service names in the documentation sidebar can be customized by editing docs/service-names.yaml.

How to Add or Modify Service Names
  1. Open docs/service-names.yaml
  2. Add or update a line with the format: directory-name: "Display Name"
  3. Run go run tools/gen-nav.go to regenerate the navigation
  4. Review the changes in mkdocs.yml
  5. Commit both files to git

Services not listed in the YAML file will automatically display their directory name in uppercase.

Acceptance tests

Refer to the acceptance tests guide for adding or maintaining provider tests: Acceptance Tests Documentation.

Container-based development

Refer to the Local Container Setup instructions file

License

This project is licensed under Apache License 2.0 - see LICENSE for more details

Copyright (c) 2025 CyberArk Software Ltd. All rights reserved.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
schemas
Package schemas provides schema generation and conversion utilities for the Terraform provider.
Package schemas provides schema generation and conversion utilities for the Terraform provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL