Skip to content

sidick/terraform-aws-iam-ssl-certificate

Repository files navigation

terraform-aws-iam-ssl-certificate

AWS IAM SSL Certificate Terraform module

Terraform module which creates AWS IAM Server Certificates on AWS.

These types of resources are supported:

Features

This module allows the management of IAM SSL Server Certificates.

If there is a missing feature or a bug - open an issue.

Important

There are some important notes about this resource type on the Terraform website, but for ease of access I've duplicated them here to make them harder to miss. Both of these are taken from https://www.terraform.io/docs/providers/aws/r/iam_server_certificate.html

  • AWS performs behind-the-scenes modifications to some certificate files if they do not adhere to a specific format. These modifications will result in terraform forever believing that it needs to update the resources since the local and AWS file contents will not match after theses modifications occur. In order to prevent this from happening you must ensure that all your PEM-encoded files use UNIX line-breaks and that certificate_body contains only one certificate. All other certificates should go in certificate_chain. It is common for some Certificate Authorities to issue certificate files that have DOS line-breaks and that are actually multiple certificates concatenated together in order to form a full certificate chain.
  • All arguments including the private key will be stored in the raw state as plain-text. Read more about sensitive data in state.

Usage

1. SSL Certificate with no extra chain

module "ssl_certificate" {
  source = "sidick/iam-ssl-certificate/aws"

  name_prefix      = "moduletest-"
  private_key      = "${file("ssl_cert_test.key")}"
  certificate_body = "${file("ssl_cert_test.crt")}"
}

2. SSL Certificate with extra chain included

module "ssl_certificate" {
  source = "sidick/iam-ssl-certificate/aws"

  name_prefix       = "moduletest-"
  private_key       = "${file("ssl_cert_test.key")}"
  certificate_body  = "${file("ssl_cert_test.crt")}"
  certificate_chain = "${file("ssl_cert_test_chain.crt")}"
}

Inputs

Name Description Type Default Required
certificate_body The contents of the public key certificate in PEM-encoded format string n/a yes
certificate_chain The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain string "" no
name_prefix Prefix of the Certificate name string n/a yes
path The IAM path for the server certificate string "/" no
private_key The contents of the private key in PEM-encoded format string n/a yes

Outputs

Name Description
arn The ARN of the certificate
id The ID of the certificate
name The name of the certificate

Authors

Module managed by Simon Dick.

License

BSD 3-Clause License. See LICENSE for full details.

About

Terraform module which uploads an IAM Server Certificate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages