By surajstha
Most firewalls declared on Terraform .hcl file does not get created when using tarraform as in this docs https://www.terraform.io/docs/providers/do/r/firewall.html
Shows error like this,
Error: Error applying plan:
5 error(s) occurred:
* module.default-firewall.digitalocean_firewall.outbound-ntp: 1 error(s) occurred:
* digitalocean_firewall.outbound-ntp: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* digitalocean_firewall.gluster_client: 1 error(s) occurred:
* digitalocean_firewall.gluster_client: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* module.default-firewall.digitalocean_firewall.outbound-dns: 1 error(s) occurred:
* digitalocean_firewall.outbound-dns: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* module.docker-swarm-firewall.digitalocean_firewall.swarm-mode-internal-fw: 1 error(s) occurred:
* digitalocean_firewall.swarm-mode-internal-fw: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* module.default-firewall.digitalocean_firewall.outbound-http: 1 error(s) occurred:
* digitalocean_firewall.outbound-http: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
I believe terraform was trying to apply firewalls to droplet resources, and dependent resource was not available to handle it at the time. So some of the firewalls were applied randomly on each try. Related issue on github: https://github.com/thojkooi/terraform-digitalocean-docker-swarm-firewall/issues/8
Hey friend,
I believe this uses our firewall product, though it may use software firewall inside of a droplet. The first seems more likely. It may be good to cross post this to GitHub so that the maintainers can review it as well:
https://github.com/terraform-providers/terraform-provider-digitalocean/issues
If you do get an answer elsewhere, please share it here so I can know how to help others who experience the same.
Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.