Skip to content

avi-piertwo/terraform-gcp-chainlinknode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform module for Chainlink nodes

This module is used to create GCP resources to support Chainlink IAC setups.

Usage implementation

See the chainlink nodes for a usage example.

module "chainlinknode" {
  source  = "avinava-mycelium/chainlinknode/gcp"
  version = "1.0.11"  # Use latest version for Apple Silicon compatibility
  
  # Required variables
  project_id     = var.project_id
  machine_type   = var.machine_type
  node_name      = var.node_name
  node_type      = var.node_type
  boot_disk_size = var.boot_disk_size
}

Apple Silicon (M1/M2) Compatibility

This module is fully compatible with Apple Silicon Macs starting from version 1.0.11. If you're using an M1/M2 Mac, make sure to use version 1.0.11 or later to avoid the deprecated template provider compatibility issues.

Release Process

Version Numbering

This module follows Semantic Versioning:

  • MAJOR (x.0.0): Breaking changes that require user action
  • MINOR (0.x.0): New features that are backward compatible
  • PATCH (0.0.x): Bug fixes and improvements

Pre-Release Checklist

Before creating a new release:

  1. Test the changes locally:

    terraform init
    terraform plan
    terraform validate
  2. Ensure compatibility:

    • Test on both Intel and Apple Silicon Macs
    • Verify no deprecated provider dependencies
    • Check that all required variables are documented
  3. Update documentation:

    • Update this README if new variables/outputs are added
    • Update examples if functionality changes
    • Document any breaking changes

Release Steps

  1. Prepare the release:

    # Ensure you're on master and up to date
    git checkout master
    git pull origin master
    
    # Check current tags
    git tag --sort=-version:refname | head -5
  2. Create and push the release:

    # Create the new tag (replace x.y.z with actual version)
    git tag vx.y.z
    
    # Push the tag to trigger Terraform Registry release
    git push origin vx.y.z
  3. Verify the release:

    • Check that the new version appears on Terraform Registry
    • Test the new version in a development environment
    • Update production deployments as needed

Release Notes Template

When creating a GitHub release, use this template:

## vx.y.z - Release Title

### 🚀 New Features
- Feature description

### 🐛 Bug Fixes  
- Bug fix description

### ⚠️ Breaking Changes
- Breaking change description (for major versions only)

### 📋 Notes
- Additional notes or migration instructions

Production Deployment Strategy

  • Development environments: Can use latest version immediately
  • Production nodes: Test in staging first, then gradual rollout
  • Apple Silicon developers: Always use version 1.0.11 or later

Rollback Process

If a release has issues:

  1. Identify the last known good version
  2. Update module version in affected deployments
  3. Create a patch release with the fix
  4. Document the issue and resolution

Inputs

Name Description Type Default Required
access_config Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet.
list(object({
nat_ip = string
network_tier = string
}))
[] no
add_hostname_suffix Adds a suffix to the hostname bool true no
hostname Hostname of instances string "" no
instance_template Instance template self_link used to create compute instances any n/a no
network Network to deploy to. Only one of network or subnetwork should be specified. string "" no
num_instances Number of instances to create. This value is ignored if static_ips is provided. string "1" no
region Region where the instances should be created. string us-central1 no
static_ips List of static IPs for VM instances list(string) [] no
subnetwork Subnet to deploy to. Only one of network or subnetwork should be specified. string "" no
subnetwork_project The project that subnetwork belongs to string "" no
zone Zone where the instances should be created. If not specified, instances will be spread across available zones in the region. string us-central1-a no
machine_type Machine configuration for CPU and Memory. string `` yes
node_name Name of CL node. string `` yes
node_type Type of CL node. string `` yes
project_id Project ID in GCP for the code to be deployed. string `` yes

Outputs

Name Description
disk_names The boot disk name of the node
instance_name The name of the VM instance holding the node
disk_size The disk size allocated to the node
gcs_startup_script The private bucket location for the startup script of the node
external_ip_addresses The static public IP address of the node
external_ip_names The static public IP name of the node
internal_ip_addresses The internal static IP address of the node
internal_ip_names The internal static IP names of the node