Skip to main content

DigiCert Terraform Provider sample configuration

You can use the DigiCert Terraform Provider plugin to manage certificates from your DigiCert ONE platform. This plugin acts as a bridge between Terraform and DigiCert ONE APIs, ensuring seamless certificate management.

Before you begin

  • To use this plugin when running a Terraform plan, you must configure the plugin with an API key and host URL.

  • Ensure that you have created a certificate profile for REST API.

    참고

    At the user binding step, we recommend that you use a Service User. If you do not select a user, then any API KEY can be used to authenticate against this certificate profile.

  • Use the digicert_certificate core resource to define common_name, dns_names, csr, and other certificate parameters.

After you configure these parameters, the plugin ensures secure communication, provisioning certificates, and tracking certificates. For more information on DigiCert Terraform Provider integration, and details on various certificate management commands, see the HashiCorp Terraform Registry.

Configuration

You must build your main.tf file to configure the Terraform provider, generate a private key, and define the certificate output. Use the variables.tf file to declare the variables for the configuration.

Sample configuration snippet

Sample snippet (terraform.tfvars)

The terraform.tfvars file contains actual values for the variables declared in the variables.tf file.

# DigiCert Configuration
digicert_api_key = "01gdthbbejkejlk2944kjfkjdvvcbcbmcmm2"
digicert_url     = "https://one.digicert.com"
digicert_profile_id = "fjhrh-djfh-sjshjhs"

# Certificate Details
common_name  = "name.io"
organization = "Your Organization"
country      = "Name of country"
dns_names    = [
  "sample.io",
  "www.sample.io"
]

# Private Key Configuration
private_key_algorithm = "RSA"
private_key_rsa_bits  = 2048

# Output Files
private_key_filename = "sample.io.key"
certificate_filename = "sample.io.crt"
private_key_file_permission = "0600"
certificate_file_permission = "0644"