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

ec_deployment: Support Autoscaling #258

Closed
marclop opened this issue Mar 11, 2021 · 3 comments · Fixed by #296
Closed

ec_deployment: Support Autoscaling #258

marclop opened this issue Mar 11, 2021 · 3 comments · Fixed by #296
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@marclop
Copy link
Contributor

marclop commented Mar 11, 2021

Overview

Add support for the new autoscaling feature. API Ref.

Possible Implementation

resource "ec_deployment" "autoscale" {
  name = "autoscaling_deployment"

  # Mandatory fields
  region                 = "us-east-1"
  version                = "7.11.2"
  deployment_template_id = "aws-io-optimized-v2"

  elasticsearch {
      topology {
        id = "hot_content"
        # Optional: Default value "memory"
        size_resource = "memory" 
        
        # Current for the deployment, if autoscaling kicks in, this will
        # change in the deployment status, meaning that if "terraform plan"
        # runs and the deployment has autoscaled, there will be a diff on this
        # field.
        size = "32g"

        # Optional
        autoscale_max {
            # Optional: Default value "memory"
            size_resource = "memory" 
            
            # Required
            size = "128g"
        }
      }

      topology {
        id = "warm"
        
        # Optional: Default value "memory"
        size_resource = "memory" 
        
        # Current for the deployment, if autoscaling kicks in, this will
        # change in the deployment status, meaning that if "terraform plan"
        # runs and the deployment has autoscaled, there will be a diff on this
        # field.
        size = "64g"

        # Optional
        autoscale_max {
            # Optional: Default value "memory"
            size_resource = "memory" 
            
            # Required
            size = "128g"
        }
      }

      topology {
        id = "cold"

        # Optional: Default value "memory"
        size_resource = "memory" 
        
        # Current for the deployment, if autoscaling kicks in, this will
        # change in the deployment status, meaning that if "terraform plan"
        # runs and the deployment has autoscaled, there will be a diff on this
        # field.
        size = "128g"

        autoscale_max {
            # Optional: Default value "memory"
            resource = "memory" 
            
            # Required
            size = "256g"
        }
      }

      topology {
        id = "ml"
        
        # Optional
        autoscale_max {
            # Optional: Default value "memory"
            resource = "memory" 
            
            # Required
            size = "128g"
        }

        # For Phase 1 only ML supports autoscale_min. This is validated by the API.
        autoscale_min {
            # Optional: Default value "memory"
            resource = "memory"

            # Required
            size = "0g"
        }
      }
  }

  kibana {}
}
@marclop marclop added enhancement New feature or request Team:Delivery labels Mar 11, 2021
@marclop marclop added this to the v0.1.0 milestone Mar 11, 2021
@Kushmaro
Copy link
Collaborator

@marclop how about having a single "autoscaling" object, with min/max values, rather two separate objects per topology?

@marclop
Copy link
Contributor Author

marclop commented Mar 18, 2021

how's this look?

resource "ec_deployment" "autoscale" {
  name = "autoscaling_deployment"

  # Mandatory fields
  region                 = "us-east-1"
  version                = "7.11.2"
  deployment_template_id = "aws-io-optimized-v2"

  elasticsearch {
      topology {
        id = "hot_content"
        # Optional: Default value "memory"
        size_resource = "memory" 
        
        # Current for the deployment, if autoscaling kicks in, this will
        # change in the deployment status, meaning that if "terraform plan"
        # runs and the deployment has autoscaled, there will be a diff on this
        # field.
        size = "32g"

        # Optional
        autoscale {
            # Optional: Default value "memory"
            max_size_resource = "memory" 
            
            # Required
            max_size = "128g"
        }
      }

      topology {
        id = "warm"
        
        # Optional: Default value "memory"
        size_resource = "memory" 
        
        # Current for the deployment, if autoscaling kicks in, this will
        # change in the deployment status, meaning that if "terraform plan"
        # runs and the deployment has autoscaled, there will be a diff on this
        # field.
        size = "64g"

        # Optional
        autoscale {
            # Optional: Default value "memory"
            max_size_resource = "memory" 
            
            # Required
            max_size = "128g"
        }
      }

      topology {
        id = "cold"

        # Optional: Default value "memory"
        size_resource = "memory" 
        
        # Current for the deployment, if autoscaling kicks in, this will
        # change in the deployment status, meaning that if "terraform plan"
        # runs and the deployment has autoscaled, there will be a diff on this
        # field.
        size = "128g"

        autoscale {
            # Optional: Default value "memory"
            max_size_resource = "memory" 
            
            # Required
            max_size = "256g"
        }
      }

      topology {
        id = "ml"
        
        # Optional
        autoscale {
            # Optional: Default value "memory"
            max_resource = "memory" 
            # Required
            max_size = "128g"

            # For Phase 1 only ML supports autoscale_min. This is validated by the API.
            # Optional: Default value "memory"
            min_resource = "memory"

            # Required
            min_size = "0g"
        }
      }
  }

  kibana {}
}

@marclop marclop modified the milestones: v0.1.0, v0.2.0 Mar 25, 2021
@karencfv
Copy link
Contributor

karencfv commented Mar 25, 2021

Hmmmm... I'm not too sold on having the top level "global" autoscaling object.

It's a fact that we have to have per topology autoscaling objects. Having an additional "global" object will only add complexity to the schema in my opinion. The API also doesn't have this ability so we should tread carefully I think 😄

Please ignore this comment, I saw something that wasn't there. (Friday brain 😅 )

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

Successfully merging a pull request may close this issue.

3 participants