Skip to content

opsd-io/terraform-module-digitalocean-droplet

Repository files navigation

OPSd - the unique and effortless way of managing cloud infrastructure.

Meet OPSd. The unique and effortless way of managing cloud infrastructure.

terraform-module-template

Introduction

DigitalOcean virtual machine (droplet) module

Usage

module "digitalocean_droplet" {
  source = "github.com/opsd-io/terraform-module-digitalocean-droplet?ref=v1.0.0"
  image           = "ubuntu-20-04-x64"
  name            = "web-1"
  region          = "nyc1"
  size            = "s-1vcpu-1gb"
  firewall_enable = false
}

IMPORTANT: Make sure not to pin to main branch because there may be breaking changes between releases.

Requirements

Name Version
terraform >= 1.9.5
digitalocean >= 2.41.0

Providers

Name Version
digitalocean >= 2.41.0

Modules

No modules.

Resources

Name Type
digitalocean_droplet.main resource
digitalocean_firewall.main resource
digitalocean_volume.main resource
digitalocean_volume_attachment.main resource

Inputs

Name Description Type Default Required
backups A list of the tags to be applied to this Droplet. bool false no
firewall_enable Flag to control the droplet firewall creation. bool false no
firewall_inbound_rule List of objects that represent the configuration of each inbound rule.
list(object({
protocol = string
port_range = string
source_addresses = optional(list(string))
droplet_ids = optional(list(string))
load_balancer_uids = optional(list(string))
kubernetes_ids = optional(list(string))
tags = optional(list(string))
}))
[
{
"port_range": "1-65535",
"protocol": "tcp",
"source_addresses": [
"0.0.0.0/0",
"::/0"
]
},
{
"port_range": "1-65535",
"protocol": "udp",
"source_addresses": [
"0.0.0.0/0",
"::/0"
]
}
]
no
firewall_outbound_rule List of objects that represent the configuration of each outbound rule.
list(object({
protocol = string
port_range = string
destination_addresses = optional(list(string))
droplet_ids = optional(list(string))
load_balancer_uids = optional(list(string))
kubernetes_ids = optional(list(string))
tags = optional(list(string))
}))
[
{
"destination_addresses": [
"0.0.0.0/0",
"::/0"
],
"port_range": "1-65535",
"protocol": "tcp"
},
{
"destination_addresses": [
"0.0.0.0/0",
"::/0"
],
"port_range": "1-65535",
"protocol": "udp"
}
]
no
image The Droplet image ID or slug. This could be either image ID or droplet snapshot ID. string n/a yes
monitoring A list of the tags to be applied to this Droplet. bool false no
name The Droplet name. string n/a yes
region The region where the Droplet will be created. string n/a yes
size The unique slug that indentifies the type of Droplet. string n/a yes
ssh_keys A list of the tags to be applied to this Droplet. list(string) [] no
tags A list of the tags to be applied to this Droplet. list(string) [] no
user_data A string of the desired User Data for the Droplet. string null no
volumes Volume name and size for for_each, each.key is used as name, each.value is used as size map(number) {} no
vpc_uuid The ID of the VPC where the load balancer will be located. string null no

Outputs

Name Description
arn The URN of the droplet.
id The ID of the droplet.
image The image of the Droplet.
ipv4_address The IPv4 address.
name The name of the Droplet.
region The region of the Droplet.
status The status of the Droplet.

Examples of usage

Do you want to see how the module works? See all the usage examples.

Related modules

The list of related modules (if present).

Contributing

If you are interested in contributing to the project, see see our guide.

Support

If you have a problem with the module or want to propose a new feature, you can report it via the project's (Github) issue tracker.

If you want to discuss something in person, you can join our community on Slack.

License

Apache License 2.0

About

Terraform module for creating Droplet on the DigitalOcean cloud.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •