Terraform-provider-aws: Add ability to import a certificate with aws_acm_certificate

Created on 28 Feb 2018  ยท  9Comments  ยท  Source: hashicorp/terraform-provider-aws

Please expand the aws_acm_certificate resource to support the ability to import an existing in-hand certificate, a la https://docs.aws.amazon.com/sdk-for-go/api/service/acm/#ACM.ImportCertificate

enhancement servicacm

Most helpful comment

Interesting idea. Maybe this could be implemented via:

  • New certificate, certificate_chain, and private_key attributes
  • Use CustomizeDiff to fail plan time validation if one of the new attributes is defined but another one is missing OR if validation_method is missing
  • Set Optional: true on validation_method attribute
  • Set ConflictsWith: []string{"private_key"} on existing attributes domain_name, subject_alternative_names, and validation_method
  • In the Create function, if d.GetOk("private_key") then call ImportCertificate

For the acceptance testing, we could probably get away with using the TLS provider to generate self-signed certificates to import

All 9 comments

Interesting idea. Maybe this could be implemented via:

  • New certificate, certificate_chain, and private_key attributes
  • Use CustomizeDiff to fail plan time validation if one of the new attributes is defined but another one is missing OR if validation_method is missing
  • Set Optional: true on validation_method attribute
  • Set ConflictsWith: []string{"private_key"} on existing attributes domain_name, subject_alternative_names, and validation_method
  • In the Create function, if d.GetOk("private_key") then call ImportCertificate

For the acceptance testing, we could probably get away with using the TLS provider to generate self-signed certificates to import

This would be a really nice improvement since ACM seems to support the in-place update of the certificate.

Yes please, I'd like the ability to import my Certificates using Terraform, otherwise it's a mess of having to perform an outside API call to do it...

Yes, please. Otherwise we have to bounce out of terraform to do this elsewhere and then come back.

This is not a slight against anyone who posted here (I promise!), but we are now including the following note in our feature request issue template for the repository:


Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

I have a feeling this probably would garner more community/maintainer attention if it were not for the current lack of ๐Ÿ‘ reactions on the original issue above. The feature request certainly seems valuable. Unfortunately the upvotes on my comment do not show up in the top level GitHub issue sorting. ๐Ÿ˜„

As I'm writing this I now feel like we should go back through all the old issues and add that note. It'd
probably be very helpful especially for those not actively working with this project. ๐Ÿ˜…

This would be a good addition!

Support for ACM importing of certificates (e.g. uploading them) has been merged and will release with version 1.54.0 of the AWS provider, very shortly. ๐Ÿ‘

This has been released in version 1.54.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings