AWS IoT Certificate

This page shows how to write Terraform and CloudFormation for AWS IoT Certificate and write them securely.

aws_iot_certificate (Terraform)

The Certificate in AWS IoT can be configured in Terraform with the resource name aws_iot_certificate. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L7
resource "aws_iot_certificate" "cert" {
  active = var.poc_iot_certificate_active
}

resource "aws_iot_thing_principal_attachment" "princ_attach" {
  principal = aws_iot_certificate.cert.arn
main.tf#L7
resource "aws_iot_certificate" "cert" {
  active = var.poc_iot_certificate_active
}

resource "aws_iot_thing_principal_attachment" "princ_attach" {
  principal = aws_iot_certificate.cert.arn
main.tf#L7
resource "aws_iot_certificate" "this" {
  active = var.active
  csr    = var.csr
}

secrets.tf#L5
resource "aws_iot_certificate" "cert" {
  active = true
}

resource "local_file" "secrets_h" {
  content = templatefile("./secrets.tmpl.h", {
main.tf#L7
resource "aws_iot_certificate" "this" {
  active = true
}

#TODO: set proper permissions
resource "aws_iot_policy" "this" {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Creates and manages an AWS IoT certificate.

AWS::IoT::Certificate (CloudFormation)

The Certificate in IoT can be configured in CloudFormation with the resource name AWS::IoT::Certificate. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

Use the AWS::IoT::Certificate resource to declare an AWS IoT X.

509 certificate. For information about working with X.

509 certificates, see [X.

509 Client Certificates](https://docs.aws.amazon.com/iot/latest/developerguide/x509-client-certs.html) in the AWS IoT Developer Guide.

Frequently asked questions

What is AWS IoT Certificate?

AWS IoT Certificate is a resource for IoT of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS IoT Certificate?

For Terraform, the j0rzsh/aws-iot-meetup, j0rzsh/aws-iot-tfg and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.