Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_acmpca_certificate generation improperly creates validity block. #378

Open
aaron-loz opened this issue Feb 15, 2025 · 0 comments
Open

Comments

@aaron-loz
Copy link

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

  1. 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
  1. run cf2tf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant