tls_self_signed_cert

    0

    0

    lucycodes42

    Terraform snippets

    This resource defines a self-signed TLS certificate. The name of the certificate is "my-resource-name". The description of the certificate is "my-description-name". The key algorithm is "ECDSA". The private key is stored in a file called private_key.pem. The subject of the certificate must have the common name "example.com" and the organization the certificate is for must be "ACME Examples, Inc." The validity period of the certificate is 12 hours. The allowed uses for this certificate are "key_encipherment", "digital_signature", and "server_auth".

    Shortcut: tf_tls_self_signed_cert

    resource "tls_self_signed_cert" "${myResourceName}" {
       name = "my-${myResourceName}"
       description = "my-description-${myResourceName}"
    
       key_algorithm = "ECDSA"
       private_key_pem = "\${file("private_key.pem")}"
       subject {
           common_name = "example.com"
           organization = "ACME Examples, Inc"
       }
       validity_period_hours = 12
       allowed_uses = [
           "key_encipherment",
           "digital_signature",
           "server_auth",
       ]
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.