1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getProjectSshKey
Equinix v0.11.2 published on Wednesday, Jun 26, 2024 by Equinix

equinix.metal.getProjectSshKey

Explore with Pulumi AI

equinix logo
Equinix v0.11.2 published on Wednesday, Jun 26, 2024 by Equinix

    Use this datasource to retrieve attributes of a Project SSH Key API resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@pulumi/equinix";
    
    const myKey = equinix.metal.getProjectSshKey({
        search: "username@hostname",
        projectId: local.project_id,
    });
    
    import pulumi
    import pulumi_equinix as equinix
    
    my_key = equinix.metal.get_project_ssh_key(search="username@hostname",
        project_id=local["project_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 {
    		_, err := metal.LookupProjectSshKey(ctx, &metal.LookupProjectSshKeyArgs{
    			Search:    pulumi.StringRef("username@hostname"),
    			ProjectId: local.Project_id,
    		}, 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 myKey = Equinix.Metal.GetProjectSshKey.Invoke(new()
        {
            Search = "username@hostname",
            ProjectId = local.Project_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.GetProjectSshKeyArgs;
    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 myKey = MetalFunctions.getProjectSshKey(GetProjectSshKeyArgs.builder()
                .search("username@hostname")
                .projectId(local.project_id())
                .build());
    
        }
    }
    
    variables:
      myKey:
        fn::invoke:
          Function: equinix:metal:getProjectSshKey
          Arguments:
            search: username@hostname
            projectId: ${local.project_id}
    

    Using getProjectSshKey

    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 getProjectSshKey(args: GetProjectSshKeyArgs, opts?: InvokeOptions): Promise<GetProjectSshKeyResult>
    function getProjectSshKeyOutput(args: GetProjectSshKeyOutputArgs, opts?: InvokeOptions): Output<GetProjectSshKeyResult>
    def get_project_ssh_key(id: Optional[str] = None,
                            project_id: Optional[str] = None,
                            search: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetProjectSshKeyResult
    def get_project_ssh_key_output(id: Optional[pulumi.Input[str]] = None,
                            project_id: Optional[pulumi.Input[str]] = None,
                            search: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetProjectSshKeyResult]
    func LookupProjectSshKey(ctx *Context, args *LookupProjectSshKeyArgs, opts ...InvokeOption) (*LookupProjectSshKeyResult, error)
    func LookupProjectSshKeyOutput(ctx *Context, args *LookupProjectSshKeyOutputArgs, opts ...InvokeOption) LookupProjectSshKeyResultOutput

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

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

    The following arguments are supported:

    ProjectId string

    The Equinix Metal project id of the Equinix Metal SSH Key.

    NOTE: One of either search or id must be provided along with project_id.

    Id string
    The id of the SSH Key to search for in the Equinix Metal project.
    Search string
    The name, fingerprint, or public_key of the SSH Key to search for in the Equinix Metal project.
    ProjectId string

    The Equinix Metal project id of the Equinix Metal SSH Key.

    NOTE: One of either search or id must be provided along with project_id.

    Id string
    The id of the SSH Key to search for in the Equinix Metal project.
    Search string
    The name, fingerprint, or public_key of the SSH Key to search for in the Equinix Metal project.
    projectId String

    The Equinix Metal project id of the Equinix Metal SSH Key.

    NOTE: One of either search or id must be provided along with project_id.

    id String
    The id of the SSH Key to search for in the Equinix Metal project.
    search String
    The name, fingerprint, or public_key of the SSH Key to search for in the Equinix Metal project.
    projectId string

    The Equinix Metal project id of the Equinix Metal SSH Key.

    NOTE: One of either search or id must be provided along with project_id.

    id string
    The id of the SSH Key to search for in the Equinix Metal project.
    search string
    The name, fingerprint, or public_key of the SSH Key to search for in the Equinix Metal project.
    project_id str

    The Equinix Metal project id of the Equinix Metal SSH Key.

    NOTE: One of either search or id must be provided along with project_id.

    id str
    The id of the SSH Key to search for in the Equinix Metal project.
    search str
    The name, fingerprint, or public_key of the SSH Key to search for in the Equinix Metal project.
    projectId String

    The Equinix Metal project id of the Equinix Metal SSH Key.

    NOTE: One of either search or id must be provided along with project_id.

    id String
    The id of the SSH Key to search for in the Equinix Metal project.
    search String
    The name, fingerprint, or public_key of the SSH Key to search for in the Equinix Metal project.

    getProjectSshKey Result

    The following output properties are available:

    Created string
    The timestamp for when the SSH key was created.
    Fingerprint string
    The fingerprint of the SSH key.
    Id string
    The unique ID of the key.
    Name string
    The name of the SSH key.
    OwnerId string
    The ID of parent project (same as project_id).
    ProjectId string
    The ID of parent project.
    PublicKey string
    The text of the public key.
    Updated string
    The timestamp for the last time the SSH key was updated.
    Search string
    Created string
    The timestamp for when the SSH key was created.
    Fingerprint string
    The fingerprint of the SSH key.
    Id string
    The unique ID of the key.
    Name string
    The name of the SSH key.
    OwnerId string
    The ID of parent project (same as project_id).
    ProjectId string
    The ID of parent project.
    PublicKey string
    The text of the public key.
    Updated string
    The timestamp for the last time the SSH key was updated.
    Search string
    created String
    The timestamp for when the SSH key was created.
    fingerprint String
    The fingerprint of the SSH key.
    id String
    The unique ID of the key.
    name String
    The name of the SSH key.
    ownerId String
    The ID of parent project (same as project_id).
    projectId String
    The ID of parent project.
    publicKey String
    The text of the public key.
    updated String
    The timestamp for the last time the SSH key was updated.
    search String
    created string
    The timestamp for when the SSH key was created.
    fingerprint string
    The fingerprint of the SSH key.
    id string
    The unique ID of the key.
    name string
    The name of the SSH key.
    ownerId string
    The ID of parent project (same as project_id).
    projectId string
    The ID of parent project.
    publicKey string
    The text of the public key.
    updated string
    The timestamp for the last time the SSH key was updated.
    search string
    created str
    The timestamp for when the SSH key was created.
    fingerprint str
    The fingerprint of the SSH key.
    id str
    The unique ID of the key.
    name str
    The name of the SSH key.
    owner_id str
    The ID of parent project (same as project_id).
    project_id str
    The ID of parent project.
    public_key str
    The text of the public key.
    updated str
    The timestamp for the last time the SSH key was updated.
    search str
    created String
    The timestamp for when the SSH key was created.
    fingerprint String
    The fingerprint of the SSH key.
    id String
    The unique ID of the key.
    name String
    The name of the SSH key.
    ownerId String
    The ID of parent project (same as project_id).
    projectId String
    The ID of parent project.
    publicKey String
    The text of the public key.
    updated String
    The timestamp for the last time the SSH key was updated.
    search 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.11.2 published on Wednesday, Jun 26, 2024 by Equinix