johnybradshaw / acc-quickstart

Quick deployment of services on Akamai Connected Cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

acc-quickstart

Overview

Quick deployment of services on Akamai Connected Cloud

acc-quickstart

This deploys n number of Virtual Machines (Linodes) on Akamai Connected Cloud, it also registers them in the DNS zone and applies a cloud-init to them.

Important

The readme.md has the following sections:

  • Requirements - Min requirements for the module to run
  • Providers - Providers required by the module
  • Inputs- Inputs to the module
  • Outputs - Outputs from the module
  • Usage - How to use the module

Requirements

The following requirements are needed by this module:

Providers

The following providers are used by this module:

Required Inputs

The following input variables are required:

Description: Cloud-init secrets

Type:

object({
        ubuntu_advantage_token = string
        github_username = string
    })

Description: Configuration for Linode services.

Type:

object({
        # Linode account configuration
        email        = string // Linode email address

        # Linode instance configuration
        region           = string // Linode region
        type             = string // Linode instance type
        image            = string // Linode image
        tags             = list(string) // Linode tags

        # Linode domain configuration
        domain           = string // Linode domain
        domain_ttl       = number // Linode domain TTL
    })

Description: Number of Linode instances

Type: number

Description: Linode instance label

Type: string

Description: Linode API token

Type: string

Outputs

The following outputs are exported:

Description: Created instances

Usage

Sample usage of this module is as shown below. For detailed info, look at inputs and outputs.

Step 1

Create a terraform.tfvars file and update with:

linode_token = "<linode-token>"

linode_count = 4
linode_label = "test"

linode_config = {
    email = "<linode-email>"
    region = "<linode-region>"
    type = "<linode-type>"
    image = "linode/ubuntu22.04"
    tags = [ "quickstart", "terraform" ]

    domain = "<linode-domain>"
    domain_ttl = 60

}

cloud_init_secrets = {
    ubuntu_advantage_token = "<ubuntu-advantage-token>"
    github_username = "<github-username>"
}

Step 2

Verify your settings using the following command:

terraform init
terraform plan

Step 3

Apply the changes

terraform apply

You will see a list of outputs similar to:

Apply complete! Resources: 13 added, 0 changed, 0 destroyed.

Outputs:

instance_ips = [
  "ssh://acc-user@test-0.fr-par.acc.domain.cloud",
  "ssh://acc-user@test-1.fr-par.acc.domain.cloud",
  "ssh://acc-user@test-2.fr-par.acc.domain.cloud",
  "ssh://acc-user@test-3.fr-par.acc.domain.cloud",
]

Step 4

To clean up simply run:

terraform destroy

And confirm to remove all created resources.

About

Quick deployment of services on Akamai Connected Cloud


Languages

Language:HCL 83.6%Language:Shell 16.4%