I have a terraform code to import certificate to aws certificate manager using null resource. But i need to destroy the resources created by null resource when do terraform destroy.
resource “null_resource” “import_cert” {
provisioner “local-exec” {
command = <<-EOT
aws secretsmanager get-secret-value --secret-id /stage/privatekey --query ‘SecretString’ --output text > key.pem
aws secretsmanager get-secret-value --secret-id /stage/crt --query ‘SecretString’ --output text > cert.pem
aws acm import-certificate --certificate file://cert.pem --private-key file://key.pem --tags Key=“Name”,Value=“custom”
EOT
}
}