1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getSpotMarketPrice
Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix

equinix.metal.getSpotMarketPrice

Explore with Pulumi AI

equinix logo
Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix

    Use this data source to get Equinix Metal Spot Market Price for a plan.

    Example Usage

    Lookup by metro:

    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@pulumi/equinix";
    
    const example = equinix.metal.getSpotMarketPrice({
        metro: "sv",
        plan: "c3.small.x86",
    });
    
    import pulumi
    import pulumi_equinix as equinix
    
    example = equinix.metal.get_spot_market_price(metro="sv",
        plan="c3.small.x86")
    
    package main
    
    import (
    	"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := metal.GetSpotMarketPrice(ctx, &metal.GetSpotMarketPriceArgs{
    			Metro: pulumi.StringRef("sv"),
    			Plan:  "c3.small.x86",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Equinix = Pulumi.Equinix;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Equinix.Metal.GetSpotMarketPrice.Invoke(new()
        {
            Metro = "sv",
            Plan = "c3.small.x86",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.equinix.metal.MetalFunctions;
    import com.pulumi.equinix.metal.inputs.GetSpotMarketPriceArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = MetalFunctions.getSpotMarketPrice(GetSpotMarketPriceArgs.builder()
                .metro("sv")
                .plan("c3.small.x86")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: equinix:metal:getSpotMarketPrice
          Arguments:
            metro: sv
            plan: c3.small.x86
    

    Using getSpotMarketPrice

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSpotMarketPrice(args: GetSpotMarketPriceArgs, opts?: InvokeOptions): Promise<GetSpotMarketPriceResult>
    function getSpotMarketPriceOutput(args: GetSpotMarketPriceOutputArgs, opts?: InvokeOptions): Output<GetSpotMarketPriceResult>
    def get_spot_market_price(facility: Optional[str] = None,
                              metro: Optional[str] = None,
                              plan: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetSpotMarketPriceResult
    def get_spot_market_price_output(facility: Optional[pulumi.Input[str]] = None,
                              metro: Optional[pulumi.Input[str]] = None,
                              plan: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetSpotMarketPriceResult]
    func GetSpotMarketPrice(ctx *Context, args *GetSpotMarketPriceArgs, opts ...InvokeOption) (*GetSpotMarketPriceResult, error)
    func GetSpotMarketPriceOutput(ctx *Context, args *GetSpotMarketPriceOutputArgs, opts ...InvokeOption) GetSpotMarketPriceResultOutput

    > Note: This function is named GetSpotMarketPrice in the Go SDK.

    public static class GetSpotMarketPrice 
    {
        public static Task<GetSpotMarketPriceResult> InvokeAsync(GetSpotMarketPriceArgs args, InvokeOptions? opts = null)
        public static Output<GetSpotMarketPriceResult> Invoke(GetSpotMarketPriceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSpotMarketPriceResult> getSpotMarketPrice(GetSpotMarketPriceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: equinix:metal/getSpotMarketPrice:getSpotMarketPrice
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Plan string
    Name of the plan.
    Facility string
    Name of the facility. Use metro instead; read the facility to metro migration guide

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Metro string
    Name of the metro.
    Plan string
    Name of the plan.
    Facility string
    Name of the facility. Use metro instead; read the facility to metro migration guide

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Metro string
    Name of the metro.
    plan String
    Name of the plan.
    facility String
    Name of the facility. Use metro instead; read the facility to metro migration guide

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro String
    Name of the metro.
    plan string
    Name of the plan.
    facility string
    Name of the facility. Use metro instead; read the facility to metro migration guide

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro string
    Name of the metro.
    plan str
    Name of the plan.
    facility str
    Name of the facility. Use metro instead; read the facility to metro migration guide

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro str
    Name of the metro.
    plan String
    Name of the plan.
    facility String
    Name of the facility. Use metro instead; read the facility to metro migration guide

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro String
    Name of the metro.

    getSpotMarketPrice Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Plan string
    Price double
    Current spot market price for given plan in given facility.
    Facility string

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Metro string
    Id string
    The provider-assigned unique ID for this managed resource.
    Plan string
    Price float64
    Current spot market price for given plan in given facility.
    Facility string

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    Metro string
    id String
    The provider-assigned unique ID for this managed resource.
    plan String
    price Double
    Current spot market price for given plan in given facility.
    facility String

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro String
    id string
    The provider-assigned unique ID for this managed resource.
    plan string
    price number
    Current spot market price for given plan in given facility.
    facility string

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro string
    id str
    The provider-assigned unique ID for this managed resource.
    plan str
    price float
    Current spot market price for given plan in given facility.
    facility str

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro str
    id String
    The provider-assigned unique ID for this managed resource.
    plan String
    price Number
    Current spot market price for given plan in given facility.
    facility String

    Deprecated: Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices

    metro String

    Package Details

    Repository
    equinix equinix/pulumi-equinix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the equinix Terraform Provider.
    equinix logo
    Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix