diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 384dc14d543..24ac14bfd52 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v3.2.0 - name: Apply Issue Labels - uses: github/issue-labeler@v2.5 + uses: github/issue-labeler@v3.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue.yml diff --git a/examples/ibm-certificate-manager/README.md b/examples/ibm-certificate-manager/README.md deleted file mode 100644 index 2f9c8afc853..00000000000 --- a/examples/ibm-certificate-manager/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# Example for Certificate Manager resources - -This example illustrates how to use the Certificate Manager resources to import a certifictae and to order a certificate into the Certificate Manager service instance. - -These types of resources are supported: - -* [ Import Certificates ](https://cloud.ibm.com/docs/terraform?topic=terraform-cert-manager-resources#cert-manager) -* [ Order Certificates ](https://cloud.ibm.com/docs/terraform?topic=terraform-cert-manager-resources#certmanager-order) - -## Terraform versions - -Terraform 0.12. Pin module version to `~> v1.4.0`. Branch - `master`. - -Terraform 0.11. Pin module version to `~> v0.25.0`. Branch - `terraform_v0.11.x`. - -## Usage - -To run this example you need to execute: - -```bash -$ terraform init -$ terraform plan -$ terraform apply -``` - -Run `terraform destroy` when you don't need these resources. - - -## Certificate Manager Resources - -`Import existing Certificates`: - -```hcl -resource "ibm_certificate_manager_import" "cert" { - certificate_manager_instance_id = ibm_resource_instance.cm.id - name = var.import_name - data = { - content = file(var.cert_file_path) - } -} -``` - -`Create ssl certificates using null resource and Import Certificates`: -```hcl - -resource "ibm_certificate_manager_import" "cert" { - - certificate_manager_instance_id = ibm_resource_instance.cm.id - name = var.import_name - data = { - content = data.local_file.cert.content - priv_key = data.local_file.key.content - } -} - -``` -`Order Certificates`: -```hcl - -resource "ibm_certificate_manager_order" "cert" { - certificate_manager_instance_id = ibm_resource_instance.cm.id - name = var.order_name - description = var.order_description - domains = [ibm_cis_domain.example.domain] - rotate_keys = var.rotate_key - domain_validation_method = var.dvm - dns_provider_instance_crn = ibm_cis.instance.id -} - -``` -## Certificate Manager Data Source -`List all certificates:` - -```hcl - -data "ibm_certificate_manager_certificates" "certs"{ - certificate_manager_instance_id=data.ibm_resource_instance.cm.id -} - -``` -`Get details of certificate:` - -```hcl - -data "ibm_certificate_manager_certificate" "certificate"{ - certificate_manager_instance_id=data.ibm_resource_instance.cm.id - name = "cert_name" -} - -``` - -## Assumptions - -1. It's assumed that user has valid domain ownership while ordering certificates using IBM CIS. -2. [ Certificate Ordering Limitations ](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-ordering-certificates#certificate-ordering-limitations) -3. Before ordering certificates using IBM CIS [ Set up ordering certificates using CIS ](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-ordering-certificates#cis) -4. [ Certificate Ordering Limits ](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-limits#api-limits) -5. [ API Documentation for CMS ](https://cloud.ibm.com/apidocs/certificate-manager) - -## Notes - -1. Terraform IBM provider v1.4.0 (via Terraform 0.12) doesn't supports ordering certificates using `Other DNS provider`. -2. With `auto_renew_enabled`, certificates are automatically renewed 31 days before they expire. If your certificate expires in less than 31 days, you must renew it by updating `rotate_keys`. After you do so, your future certificates are renewed automatically. -3. Certificates generated using `tls_private_key` and `tls_self_signed_cert` [tls resources](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/self_signed_cert) can also be imported using `ibm_certificate_manager_import` resource. - -## Examples - -* [ Certificate Manager Import Certificates ](https://github.com/IBM-Cloud/terraform-provider-ibm/tree/master/examples/ibm-certificate-manager/ibm-certificate-manager-import) -* [ Certificate Manager Order Certificates ](https://github.com/IBM-Cloud/terraform-provider-ibm/tree/master/examples/ibm-certificate-manager/ibm-certificate-manager-order) -* [ Import Certificates across IBM-Cloud Accounts] (https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/examples/ibm-certificate-manager/ibm-cross-account-cms-certificate-import/main.tf) - - - -## Requirements - -| Name | Version | -|------|---------| -| terraform | ~> 0.12 | - -## Providers - -| Name | Version | -|------|---------| -| ibm | n/a | - -## Inputs - -| Name | Description | Type | Required | -|------|-------------|------|---------| -| region | THe region where the resource has to be provisioned. Default: `us-south`| `string` | yes | -| cms\_name | The name of the Certificate Manager Service Instance. | `string` | yes | -| cis\_name | The name of the CIS Instance resource. | `string` | yes | -| cis\_plan | The Plan of CIS Instance resource. Default: `standard` | `string` | yes | -| domain | Valid CIS domain | `string` | yes | -| order\_name | Name of certificate that has to be orderd.| `string` | yes | -| order\_description | Description of certificate that has to be orderd| `string` | no | -| rotate\_key | Rotate Keys. Default: `false` | `bool` | Required while Renewing certificate. | -| dvm | Domain Validation Method of the CIS Domain. Default: `dns-01` | `string` | yes | -| import\_name | Name of certificate that has to be imported. | `string` | yes | -| cert\_file\_path | Path of the certificate file that has to be imported. | `string` | yes | -| ssl\_region | Region of SSL certificate that is been generated. | `string` | Required while generating a certificate using null resource. | -| host | Host of SSL certificate that is been generated. | `string` | Required while generating a certificate using null resource. | -| ssl\_key | Private Key file name of SSL certificate. Default: `private_key.key` | `string` | Required while generating a certificate using null resource. | -| ssl\_cert | SSL Certificate file name. Default: `certificate.pem` | `string` | Required while generating a certificate using null resource. | - -## Outputs - -| Name | Description | -|------|-------------| -| cert_order_id | ID of the ordered Certificate | -| expires_on | Indicates when the ordered certificate expires. | -| cert_import_id | ID of the Imported Certificate | -| cert_import_content | Content of Imported Certificate. | - - diff --git a/examples/ibm-certificate-manager/ibm-certificate-manager-import/README.md b/examples/ibm-certificate-manager/ibm-certificate-manager-import/README.md deleted file mode 100644 index b3d87b190ca..00000000000 --- a/examples/ibm-certificate-manager/ibm-certificate-manager-import/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# IBM Certificate Manager Import Certificate example - -This example shows how to Import a Certificate onto the Certificate Manager Instance. - -To run, configure your IBM Cloud provider - -Running the example - -For planning phase - -```shell -terraform plan -``` - -For apply phase - -```shell -terraform apply -``` - -For destroy - -```shell -terraform destroy -``` diff --git a/examples/ibm-certificate-manager/ibm-certificate-manager-import/main.tf b/examples/ibm-certificate-manager/ibm-certificate-manager-import/main.tf deleted file mode 100644 index a75bad0b2ba..00000000000 --- a/examples/ibm-certificate-manager/ibm-certificate-manager-import/main.tf +++ /dev/null @@ -1,82 +0,0 @@ -provider "tls" {} - -resource "tls_private_key" "ca" { - algorithm = "RSA" -} - -resource "tls_self_signed_cert" "ca" { - key_algorithm = "RSA" - private_key_pem = tls_private_key.ca.private_key_pem - validity_period_hours = var.ca_cert_validity_period_days * 24 - early_renewal_hours = var.ca_cert_early_renewal_days * 24 - is_ca_certificate = true - - allowed_uses = ["digital_signature", "cert_signing", "key_encipherment"] - - dns_names = ["example.com"] - - subject { - common_name = "example.com" - organization = "Example" - } -} -provider "ibm" { -} -resource "ibm_resource_instance" "cm" { - name = var.cms_name - location = var.region - service = "cloudcerts" - plan = "free" -} -resource "ibm_certificate_manager_import" "cert" { - certificate_manager_instance_id = ibm_resource_instance.cm.id - name = var.import_name - data = { - content = tls_self_signed_cert.ca.cert_pem - priv_key = tls_private_key.ca.private_key_pem - intermediate = "" - } -} - -# // template to import existing certificate... -# resource "ibm_certificate_manager_import" "cert" { -# certificate_manager_instance_id = ibm_resource_instance.cm.id -# name = var.import_name -# data = { -# content = file(var.cert_file_path) -# } -# } - -# // template file to generate ssl certificate and key and import generated certificate... -# #null resource for generating ssl key and certificate... -# resource "null_resource" "import" { -# provisioner "local-exec" { -# command = <:`. diff --git a/website/docs/d/certificate_manager_certificates.html.markdown b/website/docs/d/certificate_manager_certificates.html.markdown deleted file mode 100644 index add3c5dd8a0..00000000000 --- a/website/docs/d/certificate_manager_certificates.html.markdown +++ /dev/null @@ -1,54 +0,0 @@ ---- -subcategory: "Certificate Manager" -layout: "ibm" -page_title: "IBM: certificate_manager_certificates" -description: |- - Lists certificates of a Certificate Manager instance ---- - -# ibm_certificate_manager_certificates - -Retrieve the details of one or lists all certificates that are managed by your Certificate Manager service instance resource. For more information, about Certificate Manager, see [managing certificates from the dashboard](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-managing-certificates-from-the-dashboard). - - -## Example usage - -```terraform -data "ibm_resource_instance" "cm" { - name = "testname" - location = "us-south" - service = "cloudcerts" -} -data "ibm_certificate_manager_certificates" "certs"{ - certificate_manager_instance_id=data.ibm_resource_instance.cm.id -} -``` - -## Argument reference -Review the argument reference that you can specify for your resource. - -- `certificate_manager_instance_id` - (Required, String) The CRN based of the certificate manager service instance ID. - -## Attribute reference -In addition to the argument reference list, you can access the following attribute references after your data source is created. - -- `algorithm` - (String) The Algorithm of a certificate. -- `begins_on` - (String) The creation date of the certificate in UNIX epoch time. -- `domains` - (String) An array of valid domains for the issued certificate. The first domain is the primary domain. extra domains are secondary domains. -- `expires_on` - (String) The expiration date of the certificate in Unix epoch time. -- `has_previous` - (String) Indicates whether a certificate has a previous version. -- `id` - (String) The ID of the certificate that is managed in certificate manager. The ID is composed of `:`. -- `issuer` - (String) The issuer of the certificate. -- `issuance_info` - (String) The issuance information of a certificate. - - Nested scheme for `issuance_info`: - - `additional_info` - (String) The extra information of a certificate. - - `status` - (String) The status of a certificate. - - `ordered_on` - (String) The certificate ordered date. - - `code` - (String) The code of a certificate. - -- `imported` - (String) Indicates whether a certificate has imported or not. -- `key_algorithm` - (String) The key algorithm of a certificate. -- `name` - (String) The display name of the certificate. -- `serial_number` - (String) The serial number of a certificate. -- `status` - (String) The status of a certificate. diff --git a/website/docs/r/certificate_manager_import.html.markdown b/website/docs/r/certificate_manager_import.html.markdown deleted file mode 100644 index 4207007b76f..00000000000 --- a/website/docs/r/certificate_manager_import.html.markdown +++ /dev/null @@ -1,66 +0,0 @@ ---- -subcategory: "Certificate Manager" -layout: "ibm" -page_title: "IBM: certificate_manager_import" -description: |- - Imports and manages imported certificate. ---- - -# ibm_certificate_manager_import - -Upload or delete a certificate in Certificate Manager. For more information, about IBM Cloud certificate manager, see [managing certificates](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-managing-certificates-from-the-dashboard). - - -## Example usage -A Example usage to create a certificate manager service instance that enables customer managed keys and imports a certificate. - - -```terraform -resource "ibm_resource_instance" "cm" { - name = "test" - location = "us-south" - plan = "free" - service = "cloudcerts" - parameters = { - kms_info = "{-"id-":-"-",-"url-":-"-"}", - tek_id = "CRN OF KMS/HPCS KEY", - } -} - -resource "ibm_certificate_manager_import" "cert" { - certificate_manager_instance_id = ibm_resource_instance.cm.id - name = "test" - description="string" - data = { - content = file(var.certfile_path) - } -} -``` - - -## Argument reference -Review the argument reference that you can specify for your resource. - -- `certificate_manager_instance_id` - (Required, String) The CRN-based service instance ID. -- `description` - (Optional, String) The description of the certificate. -- `name` - (Required, String) The display name for the imported certificate. -- `data`- (Required, Map) The certificate data. - - Nested scheme for `data`: - - `content` - (Required, String) The content of certificate data, escaped. - - `intermediate` - (Optional, String) The intermediate certificate data, escaped. - - `priv_key` - (Optional, String) The private key data, escaped. - - -## Attribute reference -In addition to all argument references list, you can access the following attribute references after your resource is created. - -- `algorithm` - (String) The encryption algorithm. Valid values are `sha256WithRSAEncryption`. Default value is `sha256WithRSAEncryption`. -- `begins_on` - (String) The creation date of the certificate in UNIX epoch time. -- `expires_on` - (String) The expiration date of the certificate in UNIX epoch time. -- `has_previous`- (Bool) Indicates whether a certificate has a previous version. -- `id` - (String) The ID of the certificate. -- `imported`- (Bool) Indicates whether a certificate was imported or not. -- `issuer` - (String) The issuer of the certificate. -- `key_algorithm` - (String) The key algorithm. Valid values are `rsaEncryption 2048 bit` or `rsaEncryption 4096 bit`. Default value is `rsaEncryption 2048 bit`. -- `status` - (String) The status of certificate. Possible values are `active`, `inactive`, `expired`, `revoked`, `valid`, `pending`, and `failed`. diff --git a/website/docs/r/certificate_manager_order.html.markdown b/website/docs/r/certificate_manager_order.html.markdown deleted file mode 100644 index 764458de424..00000000000 --- a/website/docs/r/certificate_manager_order.html.markdown +++ /dev/null @@ -1,95 +0,0 @@ ---- -subcategory: "Certificate Manager" -layout: "ibm" -page_title: "IBM: certificate_manager_order" -description: |- - Orders and manages ordered certificate. ---- - -# ibm_certificate_manager_order - -Order, renew, update, or delete a certificate in Certificate Manager. For more information, about an IBM Certificate Manager order, see [ordering certificates](https://cloud.ibm.com/docs/certificate-manager?topic=certificate-manager-ordering-certificates). - - -## Example usage -A Example usage to create a Certificate Manager service instance that enables customer managed keys and orders a certificate. - - -```terraform -resource "ibm_resource_instance" "cm" { - name = "test" - location = "us-south" - plan = "free" - service = "cloudcerts" - parameters = { - kms_info = "{-"id-":-"-",-"url-":-"-"}", - tek_id = "CRN OF KMS/HPCS KEY", - } -} - -resource "ibm_certificate_manager_order" "cert" { - certificate_manager_instance_id = ibm_resource_instance.cm.id - name = "test" - description = "test description" - domains = ["example.com"] - rotate_keys = false - domain_validation_method = "dns-01" - dns_provider_instance_crn = ibm_cis.instance.id -} - -``` - -## Timeouts -The following [timeouts](https://www.terraform.io/docs/language/resources/syntax.html) are defined for this resource. - -- **Create**: The ordering of the certificate is considered failed if no response is received for 10 minutes. -- **Update**: The renewal or update of the certificate is considered failed if no response is received for 10 minutes. - -## Argument reference -Review the argument reference that you can specify for your resource. - -- `auto_renew_enabled` - (Optional, Bool) Determines the certificate is auto that is renewed. Default is **false**. - **Note** - With `auto_renew_enabled` as true, certificates are automatically renewed for 31 days. If the certificate expires before 31 days. You can renew by updating `rotate_keys` to renew the certificates automatically. -- `certificate_manager_instance_id` - (Required, Forces new resource, String) The CRN of your Certificate Manager instance. -- `description` - (Optional, String) The description that you want to add to the certificate that you order. -- `domains` (Required, List) A list of valid domains for the issued certificate. The first domain is the primary domain. More domains are secondary domains.Yes. -- `domain_validation_method` - (Optional, String) The domain validation method that you want to use for your domain. The validation method is applied to analyze DNS parameters for your domain and determine the domain health and quality standards that your domain meets. Supported parameters are `dns-01`. -- `dns_provider_instance_crn` - (Optional, String) The CRN based instance ID of the IBM Cloud Internet Services instance that manages the domains. If not present, Certificate Manager assumes that a `v4` or callback URL notifications channel with domain validation exists. -- `key_algorithm` - (Optional, String) The encryption algorithm key that you want to use for your certificate. Supported values are `rsaEncryption 2048 bit`, and `rsaEncryption 4096 bit`. If you do not provide an algorithm, `rsaEncryption 2048 bit` is used by default. -- `name` - (Required, String) The name for the certificate that you want to order. -- `renew_certificate` - (Optional, Bool) Determines the certificate to renew. Default value is **false**. -- `rotate_keys` - (Optional, Bool) Default value is **false**. - - -## Attribute reference -In addition to all argument references list, you can access the following attribute references after your resource is created. - -- `algorithm` - (String) The encryption algorithm. Valid values are `sha256WithRSAEncryption`. -- `begins_on` - (String) The creation date of the certificate in UNIX epoch time. -- `expires_on` - (String) The expiration date of the certificate in UNIX epoch time. -- `has_previous`- (Bool) Indicates whether a certificate has a previous version. -- `id` - (String) The ID of the certificate. -- `imported`- (Bool) Indicates whether a certificate was imported or not. -- `issuer` - (String) The issuer of the certificate. -- `status` - (String) The status of certificate. Possible values are `active`, `inactive`, `expired`, `revoked`, `valid`, `pending`, and `failed`. - - -## Import -The `ibm_certificate_manager_order` resource can be imported by using CRN ID of the certificate. The ID is available in the console as `Certificate CRN` in the certificate details section. - -* **ID** is a string of the form: `crn:v1:bluemix:public:cloudcerts:us-south:a/4448261269a14562b839e0a3019ed980:8e80c112-5e48-43f8-8ab9-e198520f62e4:certificate:f543e1907a0020cfe0e883936916b336`. - - -**Syntax** - -``` -terraform import ibm_certificate_manager_order.cert - -``` -**Example** - -``` -terraform import ibm_certificate_manager_order.cert crn:v1:bluemix:public:cloudcerts:us-south:a/4448261269a14562b839e0a3019ed980:8e80c112-5e48-43f8-8ab9-e198520f62e4:certificate:f543e1907a0020cfe0e883936916b336 -``` -