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
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
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
resource "aws_iot_certificate" "this" {
active = var.active
csr = var.csr
}
resource "aws_iot_certificate" "cert" {
active = true
}
resource "local_file" "secrets_h" {
content = templatefile("./secrets.tmpl.h", {
resource "aws_iot_certificate" "this" {
active = true
}
#TODO: set proper permissions
resource "aws_iot_policy" "this" {
Parameters
-
active
required - bool -
arn
optional computed - string -
certificate_pem
optional computed - string -
csr
optional - string -
id
optional computed - string -
private_key
optional computed - string -
public_key
optional computed - string
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
-
CACertificatePem
optional - String -
CertificatePem
optional - String -
CertificateSigningRequest
optional - String -
CertificateMode
optional - String -
Status
required - String
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.