Terraform

Terraform subscription active
You will receive email notifications for new publications on Terraform.
21 Results
  • Question

    Attach Kubernetes cluster to project

    Is there any way to create a k8s cluster inside a newly created project, or to assign it, after-the-fact, to one of the existing projects, with Terraform, doctl or another tool? I am currently writing a Terraform pro...
    Accepted Answer: You can see the DOKS documentation calls out a bit of a lack of support here, but provides a workaround:https://www.digitalocean.com/docs/kubernetes/#limits The control panel does not support assigning a cluster to a ...
    1 By servicesShrimp Kubernetes Terraform DigitalOcean API and CLI (doctl)
  • Question

    Create Spaces bucket with Terraform gives malformed request

    I want to create a space bucket using Terraform. Here is my attempt: ``` provider "digitalocean" { token = var.dotoken spacesaccessid = var.dospacesclientid spacessecretkey = var.dospacessecret_key } resource "d...
    Accepted Answer: The error being returned by the API here is unclear, but the cause is the underscore (_) in the Space name. In the control panel, when creating a new Space, it notes that names must be between 3 and 63 characters long...
    3 By jpauthier Terraform DigitalOcean Spaces
  • Question

    How do I work with "count" and connection.host using Terraform?

    Using this setup me@mybox:~terraform -v Terraform v0.12.8 + provider.digitalocean v1.7.0 I try to create two droplets serving Nginx using this Terraform file ``` resource "digitalocean_droplet" "web" { count = 2 na...
    Accepted Answer: Rather than using the count, you can simplify this a bit by referencing self.ipv4_address and Terraform will do the right thing. self allows you to access attributes of the resource it is called from. Putting this all...
    2 By Mowijo Terraform DigitalOcean
  • Question

    Firewall droplet_id list

    VERSION DETAILS Terraform v0.12.13 + provider.aws v2.29.0 + provider.digitalocean v1.7.0 + provider.null v2.1.2 + provider.template v2.1.2 PROBLEM I have the following terraform file which defined a DigitalOcean Clo...
    Accepted Answer: The best way to combine to lists of attributes using Terraform >= 0.12 syntax is to use the concat function. From the docs (https://www.terraform.io/docs/configuration/functions/concat.html): concat takes two or more ...
    1 By goodwillhacking Terraform DigitalOcean API and CLI (doctl)
  • Question

    What's the best way to create a droplet with block storage using Terraform and Ansible?

    Hi I'm in the process of automating my infrastructure on DO. I have all droplets and volumes created using terraform, and I'm also using user data during the provisioning for things like defining base packages, creati...
    Accepted Answer: Your approach to using Terraform for provisioning infrastructure and Ansible for config management is the right way to think about it. Luckily Terraform should be able to do what you'd like. Pre-formatted volumes crea...
    1 By bytencode Ansible Terraform Block Storage Ubuntu 18.04
  • Question

    DigitalOcean Terraform can't work with Count and droplet_ids

    When trying to run the following script I get an error and I don't understand why. All the example show it should be done this way: ``` resource "digitalocean_loadbalancer" "web" { name = "loadbalancer-1" region...
    Accepted Answer: Terraform recently released a major new version, 0.12.x. This included some fairly important changes in syntax. One of these changes is "first-class list support (https://www.terraform.io/upgrade-guides/0-12.html#refe...
    1 By freekmencke DigitalOcean Terraform
  • Question

    Migrating to a Scalable Wordpress Solution

    TLDR; I want to manage and configure multiple LEMP stacks with Terraform and Chef/Ansible to host WordPress sites without losing the data when a droplet is destroyed. Here are the questions that I am looking to have a...
    Accepted Answer: (Some mistakes were made in this reply, see comments that follow it) Hello friend! That sounds like a lot of fun any way you spin it. I'm going to do my best to provide answers to what I can, and hope that others feel...
    2 By KnowIsPow WordPress Nginx Chef Terraform Docker MySQL Block Storage Ubuntu
  • Question

    Error with firewalls api, shows `Server was unable to give you a response.`

    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...
    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 ...
    2 By surajstha Terraform Firewall Ubuntu 18.04
  • Question

    Add load balancer created by helm chart to project

    Hi. I have a Terraform project that does the following: 1) creates a VPC 2) provisions a k8s cluster and adds it to the aforementioned VPC 3) creates a project 4) adds the k8s cluster to the project 5) applies a helm ...
    1 By servicesShrimp Kubernetes WordPress Load Balancing DigitalOcean Volumes Terraform
  • Question

    How to pass docker swarm join-token using Terraform

    When using terraform to create a swarm on DigitalOcean, how can I pass the join-token to a worker node? I can create a simple 2-node swarm; a manager node and a worker node; but there does not seem to be an efficient ...
    0 By mark19594 Terraform Docker
  • Question

    Terraform config to create domain, record, certificate and loadbalancer at once results in a cycle error

    I'm trying to create a Terraform config that will set up a load balancer with Let's encrypt's certificate installed for the particular domain. The configuration I have resulted in "Error: Cycle: digitaloceanrecord.st...
    1 By mwisniowski Terraform Load Balancing
  • Question

    how-to-use-terraform-with-digitalocean

    As I was following thought the tutorial on the same topic, https://www.digitalocean.com/community/tutorials/how-to-use-terraform-with-digitalocean I successful was able to create a nginx server but then an error happ...
    4 By matrixindigo Terraform
  • Question

    Restricting port 80 to private network with a cloud firewall, using terraform.

    Hi, I'm using terraform to provision an environment. But I'm running into an issue. I'd like to terminate SSL on the LB, and then restrict port 80 on my 2 backend servers to only allow the LB to connect on the private...
    1 By weareananymous560 Terraform DigitalOcean Cloud Firewalls Networking
  • Question

    Why using eval ssh-agent -s ssh-add ~/.ssh/id_rsa to SSH into a Debian droplet created using Terraform CLI?

    Hi everyone, I developed a bash script which uses Terraform CLI to deploy a Debian 10 droplet. I noticed that to SSH into a server like that using my SSH private key, I have to type in the following commands, as in th...
    1 By spampirico Terraform DigitalOcean Deployment
  • Question

    Droplets created by Terraform cannot ping each other

    Terraform resource "digitalocean_droplet" "api" { image = "ubuntu-18-04-x64" name = "api" region = "SGP1" size = "s-2vcpu-2gb" count = 2 p...
    1 By SaboteurKid Networking Terraform
  • Question

    Is there a way to create a space using terraform?

    Hi I'm trying to setup my database backups so that they are stored in a DO Space. My infrastructure on DO is created using Terraform and provisioned using Ansible. So my approach was to use Terraform's digitalocean_s...
    1 By bytencode Terraform DigitalOcean Spaces
  • Question

    Dynamic DO Droplets' creation and configuration of

    Currently I'm developing an API REST with NodeJS. What I want to do is everytime an User register in my system, create a new droplet, deploy and run an instance of the API REST previously mentioned and add a new DNS r...
    1 By ivandiazu Automated Setups Applications Terraform Ubuntu
  • Question

    Show us your toolbox

    Hi Everyone, I'm working in my startup project which I hope it will launch by April (Wish me good luck!) I was thinking about the project infrastructure part, my project will require multiple layers of servers (Web, A...
    1 By ahmadt Ansible Automated Setups Configuration Management Terraform Monitoring Security Logging
  • Question

    Terraform cant create volumes

    I am trying to spin up a volume via terraform to attach to droplets that terraform creates. Droplet creation works fine hence provider settings are correct, but volume creation constantly fails with no indication of w...
    1 By hostingcd82e40feeb6139655f Terraform API Automated Setups
  • Question

    terraform: digitalocean_{domain/record} type NS

    I am working to build my personal and professional infrastructure from the group up using Terraform on DigitalOcean. The issue I am having is setting up my primary domain name. When created it automatically enters th...
    1 By jasonjpeters Terraform DigitalOcean Initial Server Setup API Monitoring Development