1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getFacility
Equinix v0.19.0 published on Thursday, Oct 24, 2024 by Equinix

equinix.metal.getFacility

Explore with Pulumi AI

equinix logo
Equinix v0.19.0 published on Thursday, Oct 24, 2024 by Equinix

    Deprecated Use equinix.metal.getMetro instead. For more information, refer to the facility to metro migration guide.

    Provides an Equinix Metal facility datasource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@pulumi/equinix";
    
    const ny5 = equinix.metal.getFacility({
        code: "ny5",
    });
    export const id = ny5.then(ny5 => ny5.id);
    
    import pulumi
    import pulumi_equinix as equinix
    
    ny5 = equinix.metal.get_facility(code="ny5")
    pulumi.export("id", ny5.id)
    
    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 {
    		ny5, err := metal.GetFacility(ctx, &metal.GetFacilityArgs{
    			Code: "ny5",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", ny5.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Equinix = Pulumi.Equinix;
    
    return await Deployment.RunAsync(() => 
    {
        var ny5 = Equinix.Metal.GetFacility.Invoke(new()
        {
            Code = "ny5",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = ny5.Apply(getFacilityResult => getFacilityResult.Id),
        };
    });
    
    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.GetFacilityArgs;
    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 ny5 = MetalFunctions.getFacility(GetFacilityArgs.builder()
                .code("ny5")
                .build());
    
            ctx.export("id", ny5.applyValue(getFacilityResult -> getFacilityResult.id()));
        }
    }
    
    variables:
      ny5:
        fn::invoke:
          Function: equinix:metal:getFacility
          Arguments:
            code: ny5
    outputs:
      id: ${ny5.id}
    

    Using getFacility

    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 getFacility(args: GetFacilityArgs, opts?: InvokeOptions): Promise<GetFacilityResult>
    function getFacilityOutput(args: GetFacilityOutputArgs, opts?: InvokeOptions): Output<GetFacilityResult>
    def get_facility(capacities: Optional[Sequence[GetFacilityCapacity]] = None,
                     code: Optional[str] = None,
                     features_requireds: Optional[Sequence[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> GetFacilityResult
    def get_facility_output(capacities: Optional[pulumi.Input[Sequence[pulumi.Input[GetFacilityCapacityArgs]]]] = None,
                     code: Optional[pulumi.Input[str]] = None,
                     features_requireds: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetFacilityResult]
    func GetFacility(ctx *Context, args *GetFacilityArgs, opts ...InvokeOption) (*GetFacilityResult, error)
    func GetFacilityOutput(ctx *Context, args *GetFacilityOutputArgs, opts ...InvokeOption) GetFacilityResultOutput

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

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

    The following arguments are supported:

    Code string
    The facility code to search for facilities.
    Capacities List<GetFacilityCapacity>
    One or more device plans for which the facility must have capacity.
    FeaturesRequireds List<string>
    Set of feature strings that the facility must have. Some possible values are baremetal, ibx, storage, global_ipv4, backend_transfer, layer_2.
    Code string
    The facility code to search for facilities.
    Capacities []GetFacilityCapacity
    One or more device plans for which the facility must have capacity.
    FeaturesRequireds []string
    Set of feature strings that the facility must have. Some possible values are baremetal, ibx, storage, global_ipv4, backend_transfer, layer_2.
    code String
    The facility code to search for facilities.
    capacities List<GetFacilityCapacity>
    One or more device plans for which the facility must have capacity.
    featuresRequireds List<String>
    Set of feature strings that the facility must have. Some possible values are baremetal, ibx, storage, global_ipv4, backend_transfer, layer_2.
    code string
    The facility code to search for facilities.
    capacities GetFacilityCapacity[]
    One or more device plans for which the facility must have capacity.
    featuresRequireds string[]
    Set of feature strings that the facility must have. Some possible values are baremetal, ibx, storage, global_ipv4, backend_transfer, layer_2.
    code str
    The facility code to search for facilities.
    capacities Sequence[GetFacilityCapacity]
    One or more device plans for which the facility must have capacity.
    features_requireds Sequence[str]
    Set of feature strings that the facility must have. Some possible values are baremetal, ibx, storage, global_ipv4, backend_transfer, layer_2.
    code String
    The facility code to search for facilities.
    capacities List<Property Map>
    One or more device plans for which the facility must have capacity.
    featuresRequireds List<String>
    Set of feature strings that the facility must have. Some possible values are baremetal, ibx, storage, global_ipv4, backend_transfer, layer_2.

    getFacility Result

    The following output properties are available:

    Code string
    Features List<string>
    The features of the facility.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metro string
    The metro code the facility is part of.
    Name string
    The name of the facility.
    Capacities List<GetFacilityCapacity>
    FeaturesRequireds List<string>
    Code string
    Features []string
    The features of the facility.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metro string
    The metro code the facility is part of.
    Name string
    The name of the facility.
    Capacities []GetFacilityCapacity
    FeaturesRequireds []string
    code String
    features List<String>
    The features of the facility.
    id String
    The provider-assigned unique ID for this managed resource.
    metro String
    The metro code the facility is part of.
    name String
    The name of the facility.
    capacities List<GetFacilityCapacity>
    featuresRequireds List<String>
    code string
    features string[]
    The features of the facility.
    id string
    The provider-assigned unique ID for this managed resource.
    metro string
    The metro code the facility is part of.
    name string
    The name of the facility.
    capacities GetFacilityCapacity[]
    featuresRequireds string[]
    code str
    features Sequence[str]
    The features of the facility.
    id str
    The provider-assigned unique ID for this managed resource.
    metro str
    The metro code the facility is part of.
    name str
    The name of the facility.
    capacities Sequence[GetFacilityCapacity]
    features_requireds Sequence[str]
    code String
    features List<String>
    The features of the facility.
    id String
    The provider-assigned unique ID for this managed resource.
    metro String
    The metro code the facility is part of.
    name String
    The name of the facility.
    capacities List<Property Map>
    featuresRequireds List<String>

    Supporting Types

    GetFacilityCapacity

    Plan string
    Device plan that must be available in selected location.
    Quantity int
    Minimun number of devices that must be available in selected location. Default is 1.
    Plan string
    Device plan that must be available in selected location.
    Quantity int
    Minimun number of devices that must be available in selected location. Default is 1.
    plan String
    Device plan that must be available in selected location.
    quantity Integer
    Minimun number of devices that must be available in selected location. Default is 1.
    plan string
    Device plan that must be available in selected location.
    quantity number
    Minimun number of devices that must be available in selected location. Default is 1.
    plan str
    Device plan that must be available in selected location.
    quantity int
    Minimun number of devices that must be available in selected location. Default is 1.
    plan String
    Device plan that must be available in selected location.
    quantity Number
    Minimun number of devices that must be available in selected location. Default is 1.

    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.19.0 published on Thursday, Oct 24, 2024 by Equinix