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 elasticsearch user_bundles and user_plugins #224

Closed
marclop opened this issue Jan 12, 2021 · 2 comments · Fixed by #264
Closed

ec_deployment: Support elasticsearch user_bundles and user_plugins #224

marclop opened this issue Jan 12, 2021 · 2 comments · Fixed by #264
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@marclop
Copy link
Contributor

marclop commented Jan 12, 2021

Overview

After #216 is merged, some work needs to be done on the ec_deployment resource to allow users to specify user_bundles and user_plugins in the API calls.

Possible Implementation

There's two ways that we can implement this as part of our provider schema, keeping the schema close to our API models or diverge to provide a more generic "extension" abstraction.

Copying what our API does

resource "ec_deployment" "plugins" {
  name                   = "user-plugins"
  region                 = "us-east-1"
  version                = "7.10.1"
  deployment_template_id = "aws-io-optimized-v2"

  elasticsearch {
    topology {
      size = "2g"
    }

    user_plugin {
        version = "7.10.1"
        name    = "my_plugin"
        url     = "some-url"
    }

    user_plugin {
        version = "7.10.1"
        name    = "my_second_plugin"
        url     = "some-second-url"
    }

    user_bundles {
        version = "7.10.1"
        name    = "my_bundle"
        url     = "some-url"
    }

    user_bundles {
        version = "7.10.1"
        name    = "my_second_bundle"
        url     = "some-second-url"
    }
  }
}

API Diversion

Instead of creating two different fields in the schema and mapping them to the exact API field, we could just add a single field extension with a type string field which can be set to plugin or bundle.

resource "ec_deployment" "plugins" {
  name                   = "user-plugins"
  region                 = "us-east-1"
  version                = "7.10.1"
  deployment_template_id = "aws-io-optimized-v2"

  elasticsearch {
    topology {
      size = "2g"
    }

    extension {
        type    = "plugin"
        version = "7.10.1"
        name    = "my_plugin"
        url     = "some-url"
    }

    extension {
        type    = "plugin"
        version = "7.10.1"
        name    = "my_second_plugin"
        url     = "some-second-url"
    }

    extension {
        type    = "bundle"
        version = "7.10.1"
        name    = "my_bundle"
        url     = "some-url"
    }

    extension {
        type    = "bundle"
        version = "7.10.1"
        name    = "my_second_bundle"
        url     = "some-second-url"
    }
  }
}
@marclop marclop added enhancement New feature or request Team:Delivery labels Jan 12, 2021
@marclop marclop added this to the v0.1.0 milestone Jan 12, 2021
@Kushmaro
Copy link
Collaborator

++ looks great.
Just want to verify a question I have though:

  • If a user doesn't enter a URL, will the URL be automatically be generated and returned? (i.e computed?)

@marclop
Copy link
Contributor Author

marclop commented Jan 18, 2021

@Kushmaro the URL will be required, to create the extension and upload the bundle or plugin the ec_deployment_extension can be used and the url attribute can be used.

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.

2 participants