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

equinix.metal.UserApiKey

Explore with Pulumi AI

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

    Use this resource to create Metal User API Key resources in Equinix Metal. Each API key contains a token which can be used for authentication in Equinix Metal HTTP API (in HTTP request header X-Auth-Token).

    Read-only keys only allow to list and view existing resources, read-write keys can also be used to create resources.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Equinix = Pulumi.Equinix;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Equinix.Metal.UserApiKey("test", new()
        {
            Description = "Read-only user key",
            ReadOnly = true,
        });
    
    });
    
    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.NewUserApiKey(ctx, "test", &metal.UserApiKeyArgs{
    			Description: pulumi.String("Read-only user key"),
    			ReadOnly:    pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.equinix.metal.UserApiKey;
    import com.pulumi.equinix.metal.UserApiKeyArgs;
    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) {
            var test = new UserApiKey("test", UserApiKeyArgs.builder()
                .description("Read-only user key")
                .readOnly(true)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_equinix as equinix
    
    test = equinix.metal.UserApiKey("test",
        description="Read-only user key",
        read_only=True)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@equinix-labs/pulumi-equinix";
    
    const test = new equinix.metal.UserApiKey("test", {
        description: "Read-only user key",
        readOnly: true,
    });
    
    resources:
      # Create a new read-only user API key
      test:
        type: equinix:metal:UserApiKey
        properties:
          description: Read-only user key
          readOnly: true
    

    Create UserApiKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new UserApiKey(name: string, args: UserApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def UserApiKey(resource_name: str,
                   args: UserApiKeyArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserApiKey(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   description: Optional[str] = None,
                   read_only: Optional[bool] = None)
    func NewUserApiKey(ctx *Context, name string, args UserApiKeyArgs, opts ...ResourceOption) (*UserApiKey, error)
    public UserApiKey(string name, UserApiKeyArgs args, CustomResourceOptions? opts = null)
    public UserApiKey(String name, UserApiKeyArgs args)
    public UserApiKey(String name, UserApiKeyArgs args, CustomResourceOptions options)
    
    type: equinix:metal:UserApiKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args UserApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UserApiKeyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UserApiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserApiKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var userApiKeyResource = new Equinix.Metal.UserApiKey("userApiKeyResource", new()
    {
        Description = "string",
        ReadOnly = false,
    });
    
    example, err := metal.NewUserApiKey(ctx, "userApiKeyResource", &metal.UserApiKeyArgs{
    	Description: pulumi.String("string"),
    	ReadOnly:    pulumi.Bool(false),
    })
    
    var userApiKeyResource = new UserApiKey("userApiKeyResource", UserApiKeyArgs.builder()
        .description("string")
        .readOnly(false)
        .build());
    
    user_api_key_resource = equinix.metal.UserApiKey("userApiKeyResource",
        description="string",
        read_only=False)
    
    const userApiKeyResource = new equinix.metal.UserApiKey("userApiKeyResource", {
        description: "string",
        readOnly: false,
    });
    
    type: equinix:metal:UserApiKey
    properties:
        description: string
        readOnly: false
    

    UserApiKey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The UserApiKey resource accepts the following input properties:

    Description string
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    ReadOnly bool
    Flag indicating whether the API key shoud be read-only
    Description string
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    ReadOnly bool
    Flag indicating whether the API key shoud be read-only
    description String
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    readOnly Boolean
    Flag indicating whether the API key shoud be read-only
    description string
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    readOnly boolean
    Flag indicating whether the API key shoud be read-only
    description str
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    read_only bool
    Flag indicating whether the API key shoud be read-only
    description String
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    readOnly Boolean
    Flag indicating whether the API key shoud be read-only

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UserApiKey resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    API token which can be used in Equinix Metal API clients.
    UserId string
    UUID of the owner of the API key.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    API token which can be used in Equinix Metal API clients.
    UserId string
    UUID of the owner of the API key.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    API token which can be used in Equinix Metal API clients.
    userId String
    UUID of the owner of the API key.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    API token which can be used in Equinix Metal API clients.
    userId string
    UUID of the owner of the API key.
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    API token which can be used in Equinix Metal API clients.
    user_id str
    UUID of the owner of the API key.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    API token which can be used in Equinix Metal API clients.
    userId String
    UUID of the owner of the API key.

    Look up Existing UserApiKey Resource

    Get an existing UserApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: UserApiKeyState, opts?: CustomResourceOptions): UserApiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            read_only: Optional[bool] = None,
            token: Optional[str] = None,
            user_id: Optional[str] = None) -> UserApiKey
    func GetUserApiKey(ctx *Context, name string, id IDInput, state *UserApiKeyState, opts ...ResourceOption) (*UserApiKey, error)
    public static UserApiKey Get(string name, Input<string> id, UserApiKeyState? state, CustomResourceOptions? opts = null)
    public static UserApiKey get(String name, Output<String> id, UserApiKeyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    ReadOnly bool
    Flag indicating whether the API key shoud be read-only
    Token string
    API token which can be used in Equinix Metal API clients.
    UserId string
    UUID of the owner of the API key.
    Description string
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    ReadOnly bool
    Flag indicating whether the API key shoud be read-only
    Token string
    API token which can be used in Equinix Metal API clients.
    UserId string
    UUID of the owner of the API key.
    description String
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    readOnly Boolean
    Flag indicating whether the API key shoud be read-only
    token String
    API token which can be used in Equinix Metal API clients.
    userId String
    UUID of the owner of the API key.
    description string
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    readOnly boolean
    Flag indicating whether the API key shoud be read-only
    token string
    API token which can be used in Equinix Metal API clients.
    userId string
    UUID of the owner of the API key.
    description str
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    read_only bool
    Flag indicating whether the API key shoud be read-only
    token str
    API token which can be used in Equinix Metal API clients.
    user_id str
    UUID of the owner of the API key.
    description String
    Description string for the User API Key resource.

    • read-only - (Required) Flag indicating whether the API key shoud be read-only.
    readOnly Boolean
    Flag indicating whether the API key shoud be read-only
    token String
    API token which can be used in Equinix Metal API clients.
    userId String
    UUID of the owner of the API key.

    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