Generate a private key and self-signed TLS certificate using the Terraform TLS provider.
# Download this terraform file into the current directory
curl -O https://gist.githubusercontent.com/atheiman/0944ece7399af7dd951b1bfe23fae847/raw/main.tf
# Modify "locals" in main.tf as needed
# Generate the key and cert
terraform init -upgrade
terraform apply -auto-approve
# See the local key and certificate files
ls -alh *.pem
# Inspect the TLS certificate
openssl x509 -in *.crt.pem -text -noout