cf2tf
cf2tf copied to clipboard
aws_acmpca_certificate generation improperly creates validity block.
The Issue
When running cf2tf on a yaml file that includes RootCACertificate as a resource, the validity block created has the wrong syntax around the validity argument:
resource "aws_acmpca_certificate" "root_ca_certificate" {
certificate_authority_arn = aws_acmpca_certificate_authority.root_ca.id
certificate_signing_request = aws_acmpca_certificate_authority.root_ca.certificate_signing_request
signing_algorithm = "SHA256WITHRSA"
template_arn = "arn:aws:acm-pca:::template/RootCACertificate/V1"
#### issue below.
validity = {
Type = "YEARS"
Value = 10
}
### issue above.
}
This causes additional work for a dev to convert to the proper syntax, wherein the validity does not have an equal sign before the curly brace, and "Type" and "Value" arguments should be lowercased.
How to recreate
- In a yaml file, add this cloudformations block:
Resources:
RootCACertificate:
Type: AWS::ACMPCA::Certificate
Properties:
CertificateAuthorityArn:
Ref: RootCA
CertificateSigningRequest:
Fn::GetAtt:
- RootCA
- CertificateSigningRequest
SigningAlgorithm: SHA256WITHRSA
TemplateArn: arn:aws:acm-pca:::template/RootCACertificate/V1
Validity:
Type: YEARS
Value: 10
- run cf2tf