1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIamApiKey
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIamApiKey

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve information about an IAM API key data sources. For more information, about IAM API key, see managing user API keys.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const iamApiKey = ibm.getIamApiKey({
        apikeyId: "id",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    iam_api_key = ibm.get_iam_api_key(apikey_id="id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupIamApiKey(ctx, &ibm.LookupIamApiKeyArgs{
    			ApikeyId: "id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var iamApiKey = Ibm.GetIamApiKey.Invoke(new()
        {
            ApikeyId = "id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIamApiKeyArgs;
    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 iamApiKey = IbmFunctions.getIamApiKey(GetIamApiKeyArgs.builder()
                .apikeyId("id")
                .build());
    
        }
    }
    
    variables:
      iamApiKey:
        fn::invoke:
          function: ibm:getIamApiKey
          arguments:
            apikeyId: id
    

    Using getIamApiKey

    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 getIamApiKey(args: GetIamApiKeyArgs, opts?: InvokeOptions): Promise<GetIamApiKeyResult>
    function getIamApiKeyOutput(args: GetIamApiKeyOutputArgs, opts?: InvokeOptions): Output<GetIamApiKeyResult>
    def get_iam_api_key(apikey_id: Optional[str] = None,
                        id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetIamApiKeyResult
    def get_iam_api_key_output(apikey_id: Optional[pulumi.Input[str]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetIamApiKeyResult]
    func LookupIamApiKey(ctx *Context, args *LookupIamApiKeyArgs, opts ...InvokeOption) (*LookupIamApiKeyResult, error)
    func LookupIamApiKeyOutput(ctx *Context, args *LookupIamApiKeyOutputArgs, opts ...InvokeOption) LookupIamApiKeyResultOutput

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

    public static class GetIamApiKey 
    {
        public static Task<GetIamApiKeyResult> InvokeAsync(GetIamApiKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetIamApiKeyResult> Invoke(GetIamApiKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamApiKeyResult> getIamApiKey(GetIamApiKeyArgs args, InvokeOptions options)
    public static Output<GetIamApiKeyResult> getIamApiKey(GetIamApiKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIamApiKey:getIamApiKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ApikeyId string
    Unique ID of the API key.
    Id string
    ApikeyId string
    Unique ID of the API key.
    Id string
    apikeyId String
    Unique ID of the API key.
    id String
    apikeyId string
    Unique ID of the API key.
    id string
    apikey_id str
    Unique ID of the API key.
    id str
    apikeyId String
    Unique ID of the API key.
    id String

    getIamApiKey Result

    The following output properties are available:

    AccountId string
    (String) ID of the account that this API key authenticates for.
    ApikeyId string
    (String) The unique identifier of the IBM-Cloud Api Key.
    CreatedAt string
    (Timestamp) If set contains a date time string of the creation date in ISO format.
    CreatedBy string
    (String) IAM ID of the user or service which created the API key.
    Crn string
    (String) Cloud Resource Name (CRN) of the item. For example Cloud Resource Name: crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678.
    Description string
    (String) The optional description of the API key. The 'description' property is only available if a description is provided when you create an API key.
    EntityTag string
    (String) Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.
    IamId string
    (String) The iam_id that this API key authenticates.
    Id string
    Locked bool
    (Bool) The API key cannot be changed if set to true.
    ModifiedAt string
    (Timestamp) If set contains a date time string of the last modification date in ISO format.
    Name string
    (String) Name of the API key. The name is not checked for uniqueness. Therefore, multiple names with the same value can exist. Access is done by using the UUID of the API key.
    AccountId string
    (String) ID of the account that this API key authenticates for.
    ApikeyId string
    (String) The unique identifier of the IBM-Cloud Api Key.
    CreatedAt string
    (Timestamp) If set contains a date time string of the creation date in ISO format.
    CreatedBy string
    (String) IAM ID of the user or service which created the API key.
    Crn string
    (String) Cloud Resource Name (CRN) of the item. For example Cloud Resource Name: crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678.
    Description string
    (String) The optional description of the API key. The 'description' property is only available if a description is provided when you create an API key.
    EntityTag string
    (String) Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.
    IamId string
    (String) The iam_id that this API key authenticates.
    Id string
    Locked bool
    (Bool) The API key cannot be changed if set to true.
    ModifiedAt string
    (Timestamp) If set contains a date time string of the last modification date in ISO format.
    Name string
    (String) Name of the API key. The name is not checked for uniqueness. Therefore, multiple names with the same value can exist. Access is done by using the UUID of the API key.
    accountId String
    (String) ID of the account that this API key authenticates for.
    apikeyId String
    (String) The unique identifier of the IBM-Cloud Api Key.
    createdAt String
    (Timestamp) If set contains a date time string of the creation date in ISO format.
    createdBy String
    (String) IAM ID of the user or service which created the API key.
    crn String
    (String) Cloud Resource Name (CRN) of the item. For example Cloud Resource Name: crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678.
    description String
    (String) The optional description of the API key. The 'description' property is only available if a description is provided when you create an API key.
    entityTag String
    (String) Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.
    iamId String
    (String) The iam_id that this API key authenticates.
    id String
    locked Boolean
    (Bool) The API key cannot be changed if set to true.
    modifiedAt String
    (Timestamp) If set contains a date time string of the last modification date in ISO format.
    name String
    (String) Name of the API key. The name is not checked for uniqueness. Therefore, multiple names with the same value can exist. Access is done by using the UUID of the API key.
    accountId string
    (String) ID of the account that this API key authenticates for.
    apikeyId string
    (String) The unique identifier of the IBM-Cloud Api Key.
    createdAt string
    (Timestamp) If set contains a date time string of the creation date in ISO format.
    createdBy string
    (String) IAM ID of the user or service which created the API key.
    crn string
    (String) Cloud Resource Name (CRN) of the item. For example Cloud Resource Name: crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678.
    description string
    (String) The optional description of the API key. The 'description' property is only available if a description is provided when you create an API key.
    entityTag string
    (String) Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.
    iamId string
    (String) The iam_id that this API key authenticates.
    id string
    locked boolean
    (Bool) The API key cannot be changed if set to true.
    modifiedAt string
    (Timestamp) If set contains a date time string of the last modification date in ISO format.
    name string
    (String) Name of the API key. The name is not checked for uniqueness. Therefore, multiple names with the same value can exist. Access is done by using the UUID of the API key.
    account_id str
    (String) ID of the account that this API key authenticates for.
    apikey_id str
    (String) The unique identifier of the IBM-Cloud Api Key.
    created_at str
    (Timestamp) If set contains a date time string of the creation date in ISO format.
    created_by str
    (String) IAM ID of the user or service which created the API key.
    crn str
    (String) Cloud Resource Name (CRN) of the item. For example Cloud Resource Name: crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678.
    description str
    (String) The optional description of the API key. The 'description' property is only available if a description is provided when you create an API key.
    entity_tag str
    (String) Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.
    iam_id str
    (String) The iam_id that this API key authenticates.
    id str
    locked bool
    (Bool) The API key cannot be changed if set to true.
    modified_at str
    (Timestamp) If set contains a date time string of the last modification date in ISO format.
    name str
    (String) Name of the API key. The name is not checked for uniqueness. Therefore, multiple names with the same value can exist. Access is done by using the UUID of the API key.
    accountId String
    (String) ID of the account that this API key authenticates for.
    apikeyId String
    (String) The unique identifier of the IBM-Cloud Api Key.
    createdAt String
    (Timestamp) If set contains a date time string of the creation date in ISO format.
    createdBy String
    (String) IAM ID of the user or service which created the API key.
    crn String
    (String) Cloud Resource Name (CRN) of the item. For example Cloud Resource Name: crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::apikey:1234-9012-5678.
    description String
    (String) The optional description of the API key. The 'description' property is only available if a description is provided when you create an API key.
    entityTag String
    (String) Version of the API Key details object. You need to specify this value when updating the API key to avoid stale updates.
    iamId String
    (String) The iam_id that this API key authenticates.
    id String
    locked Boolean
    (Bool) The API key cannot be changed if set to true.
    modifiedAt String
    (Timestamp) If set contains a date time string of the last modification date in ISO format.
    name String
    (String) Name of the API key. The name is not checked for uniqueness. Therefore, multiple names with the same value can exist. Access is done by using the UUID of the API key.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud