Skip to content

Conversation

@DaMandal0rian
Copy link
Contributor

@DaMandal0rian DaMandal0rian commented Jun 4, 2025

User description

  • change entities from nova to auto-evm for devnet, taurus and mainnet modules
  • Breaking changes to cloudflare provider v5.5.0 which needed a refactor of the TF declarations
  • Fix some filenames

PR Type

Enhancement


Description

  • Rename nova-indexer to auto-evm-indexer throughout Terraform

  • Introduce cloudflare_zone_id variable for DNS records

  • Migrate Cloudflare resources to cloudflare_dns_record with TTL

  • Update tfvars examples with new variables


Changes walkthrough 📝

Relevant files
Configuration changes
5 files
main.tf
Rename nova-indexer to auto-evm-indexer and add zone ID   
+6/-5     
variables.tf
Add cloudflare_zone_id and rename domain labels                   
+10/-4   
instances.tf
Rename aws_instance nova_indexer_node to auto_evm               
+8/-8     
outputs.tf
Rename nova-indexer outputs to auto_evm-indexer                   
+16/-18 
variables.tf
Add cloudflare_zone_id and update instance_count map         
+18/-12 
Enhancement
1 files
outputs.tf
Rename indexer output to auto-evm-indexer-node-ipv4           
+3/-3     
Dependencies
1 files
dns.tf
Switch to cloudflare_dns_record and use zone_id var           
+60/-46 
Miscellaneous
2 files
evm_indexer_node_provisioner.tf
Rename nova-indexer provisioner to auto-evm-indexer           
+29/-29 
evm_node_provisioner.tf
Update node keys source to auto_evm_node_keys.txt               
+1/-1     
Documentation
3 files
terraform.tfvars.example
Add required Cloudflare and AWS example variables               
[link]   
terraform.tfvars.example
Update mainnet tfvars example with new vars                           
[link]   
terraform.tfvars.example
Update taurus tfvars example with new vars                             
[link]   

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link

    github-actions bot commented Jun 4, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Schema Mismatch

    The new auto-evm-indexer-node-config object type only includes instance-type, deployment-version, and regions, but multiple fields (e.g., domain-prefix, instance-count, docker-org, node-dsn-port, etc.) are referenced elsewhere, causing Terraform validation errors.

    variable "auto-evm-indexer-node-config" {
      description = "Auto EVM indexer node deployment config"
      type = object({
        instance-type      = string
        deployment-version = number
        regions            = list(string)
    Typo

    In the instance_count map, the key autoid_bootsrap is misspelled; it should be autoid_bootstrap to align with other resource configurations.

    variable "instance_count" {
      type = map(number)
      default = {
        bootstrap             = 2
        rpc                   = 2
        domain                = 0
        rpc-indexer           = 0
        auto-evm-indexer      = 0
        farmer                = 1
        evm_bootstrap         = 0
        autoid_bootsrap       = 0
    Key Mismatch

    The instance_count map uses underscore-case keys (e.g., auto_evm_indexer_node) that do not match the dash-case keys (auto-evm-indexer) used in resource lookups, leading to missing map entries at runtime.

    variable "instance_count" {
      type = map(number)
      default = {
        bootstrap             = 2
        rpc                   = 2
        domain                = 0
        rpc-indexer           = 0
        auto-evm-indexer      = 0
        farmer                = 1
        evm_bootstrap         = 0
        autoid_bootsrap       = 0
        auto_evm_indexer_node = 0
        rpc_indexer_node      = 0
      }

    @github-actions
    Copy link

    github-actions bot commented Jun 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix Cloudflare record resource type

    The Cloudflare Terraform provider expects the resource type cloudflare_record rather
    than cloudflare_dns_record. Update the resource block declarations accordingly to
    avoid invalid resource type errors.

    templates/terraform/network-primitives/dns.tf [26-28]

    -resource "cloudflare_dns_record" "rpc" {
    +resource "cloudflare_record" "rpc" {
       count   = length(local.rpc_nodes_ip_v4)
       zone_id = var.cloudflare_zone_id
    Suggestion importance[1-10]: 8

    __

    Why: The resource type cloudflare_dns_record is invalid for the Cloudflare provider and will break Terraform, so updating it is critical.

    Medium
    General
    Add cloudflare_zone_id to tfvars

    The new cloudflare_zone_id variable must be set in your tfvars example to avoid
    missing configuration when applying. Add it alongside the other Cloudflare
    credentials.

    resources/terraform/devnet/terraform.tfvars.example [14-16]

     cloudflare_api_token  = ""
    +cloudflare_zone_id    = ""
     nr_api_key            = ""
     farmer_reward_address = ""
    Suggestion importance[1-10]: 5

    __

    Why: Including cloudflare_zone_id in the tfvars example prevents missing configuration errors, improving usability without major impact.

    Low
    Security
    Mark zone ID as sensitive

    Mark the new cloudflare_zone_id variable as sensitive to prevent accidental exposure
    in logs or state files. Adding sensitive = true aligns it with other Cloudflare
    credentials.

    resources/terraform/devnet/variables.tf [8-11]

     variable "cloudflare_zone_id" {
       description = "Cloudflare zone ID"
       type        = string
    +  sensitive   = true
     }
    Suggestion importance[1-10]: 4

    __

    Why: Adding sensitive = true helps protect the cloudflare_zone_id from exposure, but it’s a minor security improvement since zone IDs aren’t highly secret.

    Low

    @DaMandal0rian DaMandal0rian requested a review from vedhavyas June 4, 2025 18:39
    @DaMandal0rian DaMandal0rian marked this pull request as ready for review June 4, 2025 18:39
    @DaMandal0rian DaMandal0rian changed the title refactor network primitives and devnet refactor network primitives and network modules Jun 4, 2025
    @DaMandal0rian DaMandal0rian changed the title refactor network primitives and network modules refactor network primitives and network resources Jun 4, 2025
    @DaMandal0rian DaMandal0rian force-pushed the chore/refactor-nova-2-auto-evm branch 2 times, most recently from 7a8d6d1 to 79ec26d Compare June 5, 2025 00:39
    @DaMandal0rian DaMandal0rian force-pushed the chore/refactor-nova-2-auto-evm branch from 6615290 to eaa9eec Compare June 5, 2025 00:43
    @DaMandal0rian DaMandal0rian force-pushed the chore/refactor-nova-2-auto-evm branch from 2ae9c38 to 19041e2 Compare June 5, 2025 01:23
    @DaMandal0rian DaMandal0rian merged commit baf0c49 into main Jun 5, 2025
    @DaMandal0rian DaMandal0rian deleted the chore/refactor-nova-2-auto-evm branch June 5, 2025 12:48
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants