Skip to main content
selectel_secretsmanager_certificate_v1
Last update:

selectel_secretsmanager_certificate_v1

For your information

Эта инструкция — копия документации Selectel Terraform-провайдера в Terraform Registry.

Creates and manages a certificate in Selectel Secrets Manager using public API v1. For more information about certificates, see the official Selectel documentation.

Example Usage

Text format

resource "selectel_secretsmanager_certificate_v1" "certificate_1" {
name = "certificate"
certificates = [file("./_cert.pem")]
private_key = file("./_private_key.pem")
project_id = selectel_vpc_project_v2.project_1.id
}

EOF

resource "selectel_secretsmanager_certificate_v1" "certificate_1" {
name = "certificate"
certificates = [
<<-EOF
-----BEGIN CERTIFICATE-----
MIIDSzCCAjOgAwIBAgIULEumDHpDEHvQ1seZB9yRX9sCgoUwDQYJKoZIhvcNAQEL
...
----END CERTIFICATE-----
EOF
]
private_key = <<-EOF
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCuk3SFn0AfAoxo
...
-----END PRIVATE KEY-----
EOF
project_id = selectel_vpc_project_v2.project_1.id
}

Argument Reference

  • name - (Required) Certificate name.

  • certificates - (Required) Certificate chain in PEM format. The value of each certificate must begin with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----.

  • private_key - (Required, Sensitive) Private key. The value must begin with -----BEGIN PRIVATE KEY----- and end with -----END PRIVATE KEY-----.

  • project_id - (Required) Unique identifier of the associated project. Retrieved from the selectel_vpc_project_v2 resource. Learn more about Projects.

Attributes Reference

  • dns_names - Domain names for which the certificate is issued.

  • id - Unique identifier of the certificate.

  • issued_by - Information about the Certificate Authority (CA) which verified and signed the certificate.

  • serial - Certificate serial number assigned by the Certificate Authority (CA) which issued the certificate.

  • validity - Certificate validity in the RFC3339 timestamp format:

    • not_before - Effective date and time of the certificate.

    • not_after - Expiration date and time of the certificate.

  • version - Certificate version.

Import

You can import a certificate:

export SEL_PROJECT_ID=<selectel_project_id>
terraform import selectel_secretsmanager_certificate_v1.certificate_1 <certificate_id>

where:

  • <selectel_project_id> — Unique identifier of the associated project. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.

  • <certificate_id> — Unique identifier of the certificate. To get the ID of the certificate, in the Control panel, go to Cloud PlatformSecrets Manager ⟶ the Certificates tab ⟶ in the certificate menu select Copy UUID.