Skip to content

Commit 4b84872

Browse files
anshulsaoclaude
andauthored
Add Vultr cloud module set (live-validated) (#354)
* Add Vultr cloud module set (mirror of Linode) Mirrors the Linode redesign module set one-for-one for Vultr, using the official vultr/vultr provider (v2.31.2). All modules pass terraform validate and raptor create iac-module --dry-run; uploaded + published to the demo CP and wired into a vultr-demo sample blueprint (account -> vpc -> vke -> node pool + object storage + managed postgres). Modules: - cloud_account/vultr_provider -> @facets/vultr_cloud_account (exposes vultr provider, API key from secret store) - network/vultr_vpc -> @facets/vultr-vpc-details (legacy vultr_vpc; VKE is NOT compatible with VPC 2.0) - kubernetes_cluster/vke -> @facets/vke + @facets/kubernetes-details (client-cert auth; exposes kubernetes + helm) - kubernetes_node_pool/vke -> @facets/kubernetes_nodepool - object_storage/vultr -> @facets/vultr-object-storage (S3 subscription, not a bucket) - datastore/postgres/vultr -> @facets/postgres (Vultr Managed Database) Also: vultr project type, ONBOARDING guide, README Vultr section, and a cloud-neutral object_storage icon (was missing for the object_storage intent). Vultr-specific deviations from the Linode template (provider-driven): - VKE requires the original VPC (vultr_vpc), not the deprecated VPC 2.0 - VKE auth is client certificate/key, not a bearer token - Vultr object storage is a subscription (S3 endpoint + keys), no ACL/versioning - DB plan is a single slug; k8s version is a volatile full string (v1.35.0+1) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix Vultr object storage cluster selection: select by hostname The vultr_object_storage_cluster data source errored with 'too many results' during live deploy because Vultr now exposes multiple object storage clusters per region (e.g. ewr -> ewr1, ewr2). The singular data source rejects a filter that matches >1 cluster, and the provider offers no list-and-pick variant. Select the cluster by its unique hostname instead of the ambiguous region. Spec: region -> cluster_hostname (default ewr1.vultrobjects.com). Fix tier docs (1=Legacy, 2=Standard) and default tier_id to 2 (Standard, validated for ewr1). Live-validated: object storage subscription created active on ewr1.vultrobjects.com. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 56af741 commit 4b84872

43 files changed

Lines changed: 1847 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,55 @@ raptor import project-type --managed facets/azure --name "My Platform"
152152

153153
---
154154

155+
### Vultr — Preview
156+
157+
VKE (Vultr Kubernetes Engine) clusters with node pools, Vultr VPC networking, S3-compatible object storage, managed PostgreSQL, and a cloud-agnostic Kubernetes service — plus the shared K8s platform and KubeBlocks datastores.
158+
159+
**First, create a Vultr API key** at https://my.vultr.com/settings/#settingsapi and add your control plane egress IP to the API access-control allow-list. Full walkthrough: [`project-type/vultr/ONBOARDING.md`](project-type/vultr/ONBOARDING.md).
160+
161+
**Prompt for Praxis:**
162+
163+
```
164+
Import the Vultr project type for me from the facets-modules-redesign repo
165+
(project-type/vultr/project-type.yml) along with its output types.
166+
```
167+
168+
**Raptor CLI:** (imports the project type + modules + outputs; no base template — projects start empty)
169+
170+
```bash
171+
raptor import project-type -f ./project-type/vultr/project-type.yml \
172+
--modules-dir ./modules --outputs-dir ./outputs
173+
```
174+
175+
With custom name:
176+
177+
```bash
178+
raptor import project-type -f ./project-type/vultr/project-type.yml \
179+
--modules-dir ./modules --outputs-dir ./outputs --name "Vultr Platform"
180+
```
181+
182+
<details>
183+
<summary><strong>What's included</strong></summary>
184+
185+
**Infrastructure**
186+
`Cloud Account (vultr_provider)` `Network/VPC (vultr_vpc)` `VKE Cluster (vke)` `Node Pool (vke)` `Object Storage (vultr)` `Service (k8s)`
187+
188+
**Managed Datastores**
189+
`PostgreSQL (vultr)`
190+
191+
**Self-hosted via KubeBlocks**
192+
`PostgreSQL` `MySQL` `MongoDB` `Redis`
193+
194+
**K8s Platform**
195+
`Helm` `Ingress/NGINX` `cert-manager` `ConfigMap` `Secrets` `PVC` `Access Controls` `Callbacks` `K8s Resources` `Gateway API CRD` `Artifactories`
196+
197+
**Operators & Monitoring**
198+
`KubeBlocks` `ECK` `Prometheus` `Grafana` `Alert Rules` `Monitoring`
199+
200+
</details>
201+
202+
---
203+
155204
### Linode (Akamai) — Preview
156205

157206
LKE (Linode Kubernetes Engine) clusters with node pools, Linode VPC networking, S3-compatible object storage, managed PostgreSQL, and a cloud-agnostic Kubernetes service — plus the shared K8s platform and KubeBlocks datastores.

icons/object_storage.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Vultr Provider Configuration
2+
3+
Configures the Vultr Terraform provider with API key authentication for use by other Vultr modules.
4+
5+
## Overview
6+
7+
This module establishes the foundational Vultr provider configuration using a Vultr API key. It serves as the base provider configuration that other Vultr infrastructure modules (VPC, VKE, Object Storage, Managed Database) consume to access Vultr APIs and provision resources. It produces the `@facets/vultr_cloud_account` output type.
8+
9+
## Environment as Dimension
10+
11+
**Environment-specific provider configuration**: The API key is a secret reference and the default region is an override-only field, allowing different Vultr credentials and regions per environment.
12+
13+
## Resources Created
14+
15+
- **Vultr Provider Configuration**: Establishes an authenticated connection to the Vultr API
16+
- **Provider Output Interface**: Exposes the configured provider and default region for consumption by other modules
17+
18+
## Security Considerations
19+
20+
- The API key is supplied via a secret reference and is never stored in plain text within the module configuration
21+
- The key is declared in the `secrets` output attribute so the platform treats it as sensitive
22+
- Provider configuration is scoped per environment for security isolation
23+
24+
## Required Configuration
25+
26+
- **Vultr API Key**: A Vultr API key with access to the resources you intend to manage (secret reference)
27+
- **Vultr Region**: The default region for downstream resources, e.g. `ewr`, `lax`, `ord`, `fra`, `sgp` (override-only)
28+
29+
## Usage Notes
30+
31+
This module does not create any actual Vultr resources — it only configures the provider authentication. Other Vultr modules should consume this module's `@facets/vultr_cloud_account` output to access Vultr services with proper authentication.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
intent: cloud_account
2+
flavor: vultr_provider
3+
version: "1.0"
4+
description: Module to configure and provision resources within a Vultr cloud account
5+
intentDetails:
6+
type: Cloud & Infrastructure
7+
description: Configure and provision resources within a Vultr cloud account
8+
displayName: Cloud Account
9+
iconUrl: https://raw.githubusercontent.com/Facets-cloud/facets-modules-redesign/main/icons/cloud_account.svg
10+
clouds:
11+
- kubernetes
12+
spec:
13+
title: Vultr Provider Configuration
14+
description: Configure Vultr API access credentials and the default region
15+
type: object
16+
properties:
17+
api_key:
18+
type: string
19+
title: Vultr API Key
20+
description: Vultr API key with access to the resources you intend to manage
21+
x-ui-secret-ref: true
22+
region:
23+
type: string
24+
title: Vultr Region
25+
description: Default Vultr region for downstream resources (e.g. ewr, lax, ord, fra, sgp)
26+
x-ui-placeholder: ewr
27+
x-ui-overrides-only: true
28+
required:
29+
- api_key
30+
- region
31+
x-ui-order:
32+
- api_key
33+
- region
34+
outputs:
35+
default:
36+
type: "@facets/vultr_cloud_account"
37+
providers:
38+
vultr:
39+
source: vultr/vultr
40+
version: 2.31.2
41+
attributes:
42+
api_key: attributes.api_key
43+
sample:
44+
kind: cloud_account
45+
flavor: vultr_provider
46+
version: "1.0"
47+
disabled: true
48+
spec:
49+
api_key: ""
50+
region: ewr
51+
iac:
52+
validated_files:
53+
- main.tf
54+
- variables.tf
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Vultr Provider Configuration Module
2+
# This module configures the Vultr provider credentials and exposes them for other modules.
3+
#
4+
# Note: output_attributes and output_interfaces locals are defined in outputs.tf
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
locals {
2+
output_attributes = {
3+
api_key = var.instance.spec.api_key
4+
region = var.instance.spec.region
5+
secrets = "[\"api_key\"]"
6+
}
7+
output_interfaces = {
8+
}
9+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
variable "instance" {
2+
description = "Configures the Vultr Terraform provider with API key authentication"
3+
type = object({
4+
kind = string
5+
flavor = string
6+
version = string
7+
spec = object({
8+
api_key = string
9+
region = string
10+
})
11+
})
12+
}
13+
14+
variable "instance_name" {
15+
description = "The architectural name for the resource as added in the Facets blueprint designer."
16+
type = string
17+
}
18+
19+
variable "environment" {
20+
description = "An object containing details about the environment."
21+
type = object({
22+
name = string
23+
unique_name = string
24+
})
25+
}
26+
27+
variable "inputs" {
28+
description = "A map of inputs requested by the module developer."
29+
type = object({
30+
})
31+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Vultr Managed PostgreSQL
2+
3+
Creates a Vultr managed PostgreSQL database with SSL/TLS and trusted-IP allow-listing. Produces `@facets/postgres`.
4+
5+
## Overview
6+
7+
Provisions a Vultr Managed Database running the PostgreSQL engine. The module exposes `writer` and `reader` connection interfaces (both pointing at the primary host; Vultr handles read scaling via separate read replicas). The database is protected from accidental deletion with `prevent_destroy`.
8+
9+
## Resources Created
10+
11+
- **vultr_database**: A managed PostgreSQL cluster (`database_engine = "pg"`)
12+
13+
## Required Configuration
14+
15+
- **PostgreSQL Version**: one of `13`, `14`, `15`, `16`, `17`
16+
- **Database Plan** (`sizing.plan`): a Vultr managed-database plan slug encoding vCPU/RAM/disk and node count, e.g. `vultr-dbaas-hobbyist-cc-1-25-1` (list via `GET /v2/databases/plans`)
17+
- **Trusted IPs** (optional): CIDRs permitted to connect; empty denies all external access
18+
19+
## Inputs
20+
21+
- **Vultr Cloud Account** (`@facets/vultr_cloud_account`): provides the Vultr provider and region
22+
23+
## Outputs
24+
25+
- `@facets/postgres` (default): `writer` and `reader` interfaces with `host`, `port`, `username`, `password`, `connection_string`
26+
27+
## Notes & Gotchas
28+
29+
- **Trusted IPs**: the database is reachable only from CIDRs in `network_access.trusted_ips`. Add your VKE node egress CIDRs to allow the cluster to connect.
30+
- **SSL required**: connection strings include `sslmode=require`.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
intent: postgres
2+
flavor: vultr
3+
version: "1.0"
4+
clouds:
5+
- kubernetes
6+
description: Managed PostgreSQL database on Vultr with SSL/TLS and trusted-IP allow-listing
7+
intentDetails:
8+
type: Datastores
9+
description: Vultr managed PostgreSQL database service
10+
displayName: PostgreSQL
11+
iconUrl: https://raw.githubusercontent.com/Facets-cloud/facets-modules-redesign/main/icons/postgres.svg
12+
spec:
13+
title: Vultr Managed PostgreSQL Database
14+
description: Managed PostgreSQL database on Vultr
15+
type: object
16+
x-ui-order:
17+
- version_config
18+
- sizing
19+
- network_access
20+
properties:
21+
version_config:
22+
type: object
23+
title: Version Configuration
24+
x-ui-order:
25+
- version
26+
properties:
27+
version:
28+
type: string
29+
title: PostgreSQL Version
30+
description: PostgreSQL engine major version
31+
enum:
32+
- "13"
33+
- "14"
34+
- "15"
35+
- "16"
36+
- "17"
37+
default: "16"
38+
required:
39+
- version
40+
sizing:
41+
type: object
42+
title: Sizing & Performance
43+
x-ui-order:
44+
- plan
45+
properties:
46+
plan:
47+
type: string
48+
title: Database Plan
49+
description: "Vultr managed database plan slug (encodes vCPU/RAM/disk and node count, e.g. vultr-dbaas-hobbyist-cc-1-25-1). List plans via the Vultr API (GET /v2/databases/plans)."
50+
default: vultr-dbaas-hobbyist-cc-1-25-1
51+
x-ui-placeholder: vultr-dbaas-hobbyist-cc-1-25-1
52+
required:
53+
- plan
54+
network_access:
55+
type: object
56+
title: Network Access
57+
properties:
58+
trusted_ips:
59+
type: array
60+
title: Trusted IPs
61+
description: List of CIDRs permitted to connect (empty denies all external access)
62+
default: []
63+
items:
64+
type: string
65+
pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$
66+
required: []
67+
required:
68+
- version_config
69+
- sizing
70+
inputs:
71+
vultr_cloud_account:
72+
type: "@facets/vultr_cloud_account"
73+
optional: false
74+
displayName: Vultr Cloud Account
75+
description: Vultr provider configuration and default region
76+
providers:
77+
- vultr
78+
outputs:
79+
default:
80+
type: "@facets/postgres"
81+
title: Vultr PostgreSQL Database
82+
sample:
83+
kind: postgres
84+
flavor: vultr
85+
version: "1.0"
86+
disabled: true
87+
spec:
88+
version_config:
89+
version: "16"
90+
sizing:
91+
plan: vultr-dbaas-hobbyist-cc-1-25-1
92+
network_access:
93+
trusted_ips: []
94+
iac:
95+
validated_files:
96+
- main.tf
97+
- variables.tf
98+
- outputs.tf
99+
- versions.tf
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Vultr Managed PostgreSQL Module
2+
# Creates a Vultr managed PostgreSQL database.
3+
4+
module "name" {
5+
source = "github.com/Facets-cloud/facets-utility-modules//name"
6+
environment = var.environment
7+
limit = 32
8+
resource_name = var.instance_name
9+
resource_type = "postgres"
10+
}
11+
12+
locals {
13+
region = var.inputs.vultr_cloud_account.attributes.region
14+
}
15+
16+
resource "vultr_database" "db" {
17+
label = module.name.name
18+
database_engine = "pg"
19+
database_engine_version = var.instance.spec.version_config.version
20+
region = local.region
21+
plan = var.instance.spec.sizing.plan
22+
trusted_ips = var.instance.spec.network_access.trusted_ips
23+
24+
lifecycle {
25+
prevent_destroy = true
26+
}
27+
}

0 commit comments

Comments
 (0)