Giter Site home page Giter Site logo

kavya498 / terraform-ibm-certificate-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terraform-ibm-modules/terraform-ibm-certificate-manager

0.0 0.0 0.0 32 KB

https://cloud.ibm.com/docs/terraform?topic=terraform-cert-manager-resources

License: Apache License 2.0

HCL 100.00%

terraform-ibm-certificate-manager's Introduction

IBM Certificate Manager Terraform Module

This is a collection of modules that make it easier to provision certificate Manager, Import and Order Certificates on IBM Cloud Platform:

Compatibility

This module is meant for use with Terraform 0.12.

Usage

Full examples are in the examples folder, but basic usage is as follows:

Provisioning instance:

data "ibm_resource_group" "resource_group" {
  name = var.resource_group_name
}

module "certificate-manager_instance" {
  source = "terraform-ibm-modules/certificate-manager/ibm//modules/instance"
  resource_group_id = data.ibm_resource_group.resource_group.id
  service_name      = var.service_name
  region            = var.region
  plan              = var.plan
  tags              = var.tags
  service_endpoints = var.service_endpoints
  parameters        = var.parameters
}

Importing Certificate from a file:

provider "ibm" {
}
data "ibm_resource_group" "resource_group" {
  name = var.resource_group_name
}

data "ibm_resource_instance" "cms_instance" {
  name     = var.service_intance_name
  location = var.region
  service  = "cloudcerts"
  resource_group_id = data.ibm_resource_group.resource_group.id
}
}

module "certificate-manager_import-from-file" {
  source                          = "terraform-ibm-modules/certificate-manager/ibm//modules/import"
  region                          = var.region
  certificate_manager_instance_id = data.ibm_resource_instance.cms_instance.id
  name                            = var.name
  description                     = var.description
  certificate_file                = file(var.certificate_file)
  priv_key_file                   = var.priv_key_file
  intermediate_certificate_file   = var.intermediate_certificate_file
}

Ordering Certificate

provider "ibm" {
}
data "ibm_resource_group" "resource_group" {
  name = var.resource_group_name
}

data "ibm_resource_instance" "cms_instance" {
  name     = var.service_intance_name
  location = var.region
  service  = "cloudcerts"
  resource_group_id = data.ibm_resource_group.resource_group.id
}
}
//Getting existing CIS resource
data "ibm_cis" "cis_instance" {
  name = var.cis_instance_name
}
module "certificate-manager_order" {
  source                          = "terraform-ibm-modules/certificate-manager/ibm//modules/order"
  region                          = var.region
  certificate_manager_instance_id = data.ibm_resource_instance.cms_instance.id
  name                            = var.name
  description                     = var.description
  domain_names                    = var.domain_names
  domain_validation_method        = var.domain_validation_method
  cis_instance_crn                = data.ibm_cis.cis_instance.id
  key_algorithm                   = var.key_algorithm
  automatic_certificate_renewal   = var.automatic_certificate_renewal
  renew_certificate               = var.renew_certificate
  rekey_certificate               = var.rekey_certificate
}

NOTE: If we want to make use of a particular version of module, then set the "version" argument to respective module version.

Certificate Manager Data Sources

List all certificates:

data "ibm_certificate_manager_certificates" "certs"{
    certificate_manager_instance_id=data.ibm_resource_instance.cms_instance.id
}

Get details of certificate:

data "ibm_certificate_manager_certificate" "certificate"{
    certificate_manager_instance_id=data.ibm_resource_instance.cms_instance.id
    name = "cert_name"
}

Requirements

Terraform plugins

Install

Terraform

Be sure you have the correct Terraform version (0.12), you can choose the binary here:

Terraform plugins

Be sure you have the compiled plugins on $HOME/.terraform.d/plugins/

How to input varaible values through a file

To review the plan for the configuration defined (no resources actually provisioned)

terraform plan -var-file=./input.tfvars

To execute and start building the configuration defined in the plan (provisions resources)

terraform apply -var-file=./input.tfvars

To destroy the Database resources

terraform destroy -var-file=./input.tfvars

All optional parameters by default will be set to null in respective example's varaible.tf file. If user wants to configure any optional paramter he has overwrite the default value.

Notes

  • All optional fields should be given value null in respective resource varaible.tf file. User can configure the same by overwriting with appropriate values.

  • Notification Channel is not currently supported by the latest version of provider.

References

IBM-Cloud Certificate Manager docs

terraform-ibm-certificate-manager's People

Contributors

kavya498 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.