Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding fleet_endpoint to integrations_server #890

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sholzhauer-es
Copy link

Add a property to the datasource of ec_deployment to directly get the fleet endpoint.

Description

Related Issues

#875

Motivation and Context

It allows a deployment to directly reference data.ec_deployment.stack.integrations_server.fleet_endpoint instead of having to dynamically build it from available properties (see issue)

How Has This Been Tested?

  1. first determined the api response (focussed on int.server):
...
"integrations_server" : [
      {
        ...
        "info" : {
          ...
          "metadata" : {
            ...
            "ports" : {
              "http" : 80,
              "https" : 443,
              "transport_passthrough" : 9400
            },
            "services_urls" : [
              {
                "service" : "fleet",
                "url" : "https://hosted-sholzhauer.fleet.us-west2.gcp.elastic-cloud.com"
              },
              {
                "service" : "apm",
                "url" : "https://hosted-sholzhauer.apm.us-west2.gcp.elastic-cloud.com"
              }
            ]
          },
          ...
        }
      }
    ]
...

which showed the availability of the endpoint

  1. determined how the endpoint (http/https) was currently build
  2. added the code in the commit
  3. ran make build
  4. copied the binary from /bin/ to my test directory
  5. ran terraform init -upgrade and terraform apply in test directory
  6. got the fleet_endpoint in the output

Test template

referencing a test cluster of mine

terraform {
  required_providers {
    ec = {
      source = "elastic/ec"
      version = ">= 0.0.1"
      #source = "terraform-provider-ec"
    }
  }
}

variable "apikey" {}
variable "region" { default = "gcp-us-west1" }

provider "ec" {
  apikey = var.apikey  
}

data "ec_deployment" "example" {
  id = var.cluster_id
}

output "fleet" {
  value = data.ec_deployment.example
}

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant