diff --git a/.github/workflows/plan_terraform_ensnode_yellow.yml b/.github/workflows/plan_terraform_ensnode_yellow.yml new file mode 100644 index 000000000..2bf4284c1 --- /dev/null +++ b/.github/workflows/plan_terraform_ensnode_yellow.yml @@ -0,0 +1,75 @@ +name: "Plan: Terraform for ENSNode Yellow Environment" + +on: + workflow_dispatch: + inputs: + tag: + description: "Docker Image Tag (also used for schema name generation)" + required: true + type: string + pull_request: + paths: + - "terraform/**" + +permissions: + id-token: write + contents: read + +jobs: + plan-environment: + runs-on: blacksmith-4vcpu-ubuntu-2204 + env: + TARGET_ENVIRONMENT: "yellow" + # Terraform related envs + + # AWS_REGION is required for aws-actions/configure-aws-credentials@v4 + # Terraform keeps it's state inside S3 bucket. This bucket needs to be created before running Terraform apply. + # AWS_REGION should be the same as Terraform S3 bucket state region. + AWS_REGION: us-east-1 + TF_VAR_ensnode_version: ${{ inputs.tag || 'latest' }} + TF_VAR_ensindexer_label_set_id: ${{ vars.LABEL_SET_ID }} + TF_VAR_ensindexer_label_set_version: ${{ vars.LABEL_SET_VERSION }} + TF_VAR_ensrainbow_label_set_id: ${{ vars.LABEL_SET_ID }} + TF_VAR_ensrainbow_label_set_version: ${{ vars.LABEL_SET_VERSION }} + TF_VAR_db_schema_version: ${{ vars.DB_SCHEMA_VERSION }} + TF_VAR_anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + # For now only one Terraform environment is active. In future this will be calculated based on workflow input. + TF_VAR_render_environment: "yellow" + TF_VAR_render_api_key: ${{ secrets.RENDER_API_KEY }} + TF_VAR_render_owner_id: ${{ secrets.RENDER_OWNER_ID }} + TF_VAR_alchemy_api_key: ${{ secrets.ALCHEMY_API_KEY }} + TF_VAR_quicknode_api_key: ${{ secrets.QUICKNODE_API_KEY }} + TF_VAR_quicknode_endpoint_name: ${{ secrets.QUICKNODE_ENDPOINT_NAME}} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.6.0 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE}} + aws-region: ${{ env.AWS_REGION }} + + - name: Terraform Init + run: terraform init + working-directory: terraform + + - name: Terraform workspace + run: terraform workspace select ${{env.TF_VAR_render_environment}} + working-directory: terraform + + - name: Terraform Validate + run: terraform validate + working-directory: terraform + + - name: Terraform Plan + run: terraform plan -out=tfplan + working-directory: terraform diff --git a/terraform/main.tf b/terraform/main.tf index 15f781d59..c7ac71c2a 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -19,15 +19,6 @@ locals { # See https://render.com/docs/blueprint-spec#region render_region = "ohio" ensindexer_instances = { - holesky = { - ensnode_indexer_type = "holesky" - ensnode_environment_name = var.render_environment - database_schema = "holeskySchema-${var.ensnode_version}" - plugins = "subgraph" - namespace = "holesky" - render_instance_plan = "starter" - subgraph_compat = true - } sepolia = { ensnode_indexer_type = "sepolia" ensnode_environment_name = var.render_environment