Skip to content

mgvalverde/terraform-porkbun-route53-integration

Repository files navigation

Porkbun Subdomains as AWS Route 53 Hosted Zones using Terraform

Add subdomain

  1. Follow the Porkbun getting started to use the API to activate the API for your domain and get the API key and Secret key.
  2. Ensure that you have permissions to create hosted zones in AWS.
  3. Create the SSM Parameters:
aws ssm put-parameter \
    --name "/porkbun/api_key" \
    --value "<PORKBUN_API_KEY>" \
    --type "SecureString" \
    --description "Porkbun API key" 

aws ssm put-parameter \
    --name "/porkbun/secret_api_key" \
    --value "<PORKBUN_SECRET_API_KEY>" \
    --type "SecureString" \
    --description "Porkbun Secret key"
  1. Write your terraform.tfvars:
mv template.terraform.tfvars terraform.tfstate

And complete it with your values

  1. terraform init
  2. terraform apply
  3. Check that you have correctly set the NS values in Porkbun: porkbun.png dns_records.png
  4. After ~10 you should be able to check it from your terminal using dig:
dig subdomain.domain.com NS

If everything is ok you should see the four NS records from the hosted zone.

Now you can use your hosted zone to redirect a Load Balancer or and instance as you would normally do.

About

Porkbun subdomains as AWS Route 53 Hosted Zones using Terraform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages