Code Monkey home page Code Monkey logo

tls-self-signed-cert's Introduction

TLS Self Signed Cert Terraform Module

  • Generates a secure RSA or ECDAS private key for the CA cert
  • Generates a self signed CA cert
  • Generates a secure RSA or ECDAS private key for the leaf cert
  • Generates a TLS certificate request for the leaf cert
  • Generates a locally signed leaf cert
  • Encodes the private keys as PEM

Checkout examples for fully functioning examples.

Environment Variables

This module doesn't require any environment variables to be set.

Input Variables

  • create: [Optional] Create Module, defaults to true.
  • name: [Optional] Filename to write the private key data to, default to "tls-private-key".
  • algorithm: [Optional] The name of the algorithm to use for the key. Currently-supported values are "RSA" and "ECDSA". Defaults to "RSA".
  • rsa_bits: [Optional] When algorithm is "RSA", the size of the generated RSA key in bits. Defaults to "2048".
  • ecdsa_curve: [Optional] When algorithm is "ECDSA", the name of the elliptic curve to use. May be any one of "P224", "P256", "P384" or "P521". Defaults to "P224".
  • permissions: [Optional] The Unix file permission to assign to the cert files (e.g. 0600), defaults to "0600".
  • validity_period_hours: [Required] The number of hours after initial issuing that the certificate will become invalid.
  • ca_allowed_uses: [Optional] List of keywords from RFC5280 describing a use that is permitted for the CA certificate. For more info and the list of keywords, see https://www.terraform.io/docs/providers/tls/r/self_signed_cert.html#allowed_uses.
  • ca_common_name: [Optional] The common name to use in the subject of the CA certificate (e.g. hashicorp.com).
  • organization_name: [Required] The name of the organization to associate with the certificates (e.g. HashiCorp Inc.).
  • allowed_uses: [Required] List of keywords from RFC5280 describing a use that is permitted for the issued certificate. For more info and the list of keywords, see https://www.terraform.io/docs/providers/tls/r/self_signed_cert.html#allowed_uses.
  • common_name: [Required] The common name to use in the subject of the certificate (e.g. hashicorp.com).
  • dns_names: [Required] List of DNS names for which the certificate will be valid (e.g. foo.hashicorp.com), defaults to empty list.
  • ip_addresses: [Required] List of IP addresses for which the certificate will be valid (e.g. 127.0.0.1), defaults to empty list.
  • ca_override: [Optional] Don't create a CA cert, override with the provided CA to sign certs withr
  • ca_key_override: [Optional] CA private key pem override.
  • ca_cert_override: [Optional] CA cert pem override.
  • download_certs: [Optional] Download certs locally, defaults to false.

Outputs

  • algorithm: The algorithm that was selected for the key.

  • ca_cert_pem: The CA cert data in PEM format.

  • ca_cert_validity_start_time: The time after which the CA certificate is valid, as an RFC3339 timestamp.

  • ca_cert_validity_end_time: The time until which the CA certificate is invalid, as an RFC3339 timestamp.

  • ca_private_key_pem: The CA cert private key data in PEM format.

  • ca_private_key_name: The CA cert private key filename.

  • ca_private_key_filename: The CA cert private key filename with file extension.

  • ca_public_key_pem: The CA cert public key data in PEM format.

  • ca_public_key_openssh: The CA cert public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves "P256", "P384" and "P251" are supported. This attribute is empty if an incompatible ECDSA curve is selected.

  • leaf_private_key_pem: The Leaf cert private key data in PEM format.

  • leaf_private_key_name: The Leaf cert private key filename.

  • leaf_private_key_filename: The Leaf cert private key filename with file extension.

  • leaf_public_key_pem: The Leaf cert public key data in PEM format.

  • leaf_public_key_openssh: The Leaf cert public key data in OpenSSH authorized_keys format, if the selected private key format is compatible. All RSA keys are supported, and ECDSA keys with curves "P256", "P384" and "P251" are supported. This attribute is empty if an incompatible ECDSA curve is selected.

  • leaf_cert_request_pem: The Leaf cert request data in PEM format.

  • leaf_cert_pem: The Leaf cert data in PEM format.

  • leaf_cert_validity_start_time: The time after which the leaf certificate is valid, as an RFC3339 timestamp.

  • leaf_cert_validity_end_time: The time until which the leaf certificate is invalid, as an RFC3339 timestamp.

Submodules

This module has no submodules.

Authors

HashiCorp Solutions Engineering Team.

License

Mozilla Public License Version 2.0. See LICENSE for full details.

tls-self-signed-cert's People

Contributors

bensojona avatar kawsark avatar

Watchers

James Cloos 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.