Provides an IAM Signing Certificate resource to upload Signing Certificates.
Using certs on file:
resource "aws_iam_signing_certificate" "test_cert" {
username = "some_test_cert"
certificate_body = file("self-ca-cert.pem")
}
Example with cert in-line:
resource "aws_iam_signing_certificate" "test_cert_alt" {
username = "some_test_cert"
certificate_body = <<EOF
-----BEGIN CERTIFICATE-----
[......] # cert contents
-----END CERTIFICATE-----
EOF
}
This resource supports the following arguments:
certificate_body
– (Required) The contents of the signing certificate in PEM-encoded format.status
– (Optional) The status you want to assign to the certificate. Active
means that the certificate can be used for programmatic calls to Amazon Web Services Inactive
means that the certificate cannot be used.user_name
– (Required) The name of the user the signing certificate is for.This resource exports the following attributes in addition to the arguments above:
certificate_id
- The ID for the signing certificate.id
- The certificate_id:user_name
In Terraform v1.5.0 and later, use an import
block to import IAM Signing Certificates using the id
. For example:
import {
to = aws_iam_signing_certificate.certificate
id = "IDIDIDIDID:user-name"
}
Using terraform import
, import IAM Signing Certificates using the id
. For example:
% terraform import aws_iam_signing_certificate.certificate IDIDIDIDID:user-name