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

[Feature]: equinix_metal_spot_market_prices #714

Open
displague opened this issue Jul 1, 2024 · 0 comments
Open

[Feature]: equinix_metal_spot_market_prices #714

displague opened this issue Jul 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@displague
Copy link
Member

displague commented Jul 1, 2024

Description

Implement a sortable, filterable, version of equinix_metal_spot_market_price where multiple factors can be used to determine the best plan + location.

As seen in rancherlabs/terraform-harvester-equinix#63, it is possible to gather this information without a Terraform datasource, however, this requires usage of the Equinix Metal API directly, which prevents users from taking advantage of METAL_AUTH_TOKEN alone.

Alternatively, adding spotmarket pricing to the existing equinix_metal_plans could make for a more comprehensive feature, although it would mean tying separate EM APIs together in one resource.

The examples for equinix_metal_plans include a stanza that suggests that the existing filters, coupled with a sort for spot price, could be powerful:

https://registry.terraform.io/providers/equinix/equinix/latest/docs/data-sources/equinix_metal_plans#example-usage

    filter {
        attribute = "deployment_types"
        values    = ["spot_market"]
    }

Implementing this datasource in HCL is not a simple task. Kudos to the team that pulled this example together.

New or Affected Terraform Resources

equinix_metal_spot_market_prices

Potential Terraform Configuration

data "equinix_metal_spot_market_prices" "example" {
    sort {
        attribute = "pricing_hour"
        direction = "asc"
    }
    filter {
        attribute = "pricing_hour"
        values    = [2.5]
        match_by  = "less_than"
    }
    filter {
        attribute = "available_in_metros"
        values    = ["da", "sv"]
    }
}
@displague displague added the enhancement New feature or request label Jul 1, 2024
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

No branches or pull requests

1 participant