ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud
ibm.getIamApiKey
Explore with Pulumi AI
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:
getIamApiKey Result
The following output properties are available:
- Account
Id string - (String) ID of the account that this API key authenticates for.
- Apikey
Id string - (String) The unique identifier of the IBM-Cloud Api Key.
- Created
At string - (Timestamp) If set contains a date time string of the creation date in ISO format.
- Created
By 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.
- Entity
Tag string - (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 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.
- Modified
At 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 string - (String) ID of the account that this API key authenticates for.
- Apikey
Id string - (String) The unique identifier of the IBM-Cloud Api Key.
- Created
At string - (Timestamp) If set contains a date time string of the creation date in ISO format.
- Created
By 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.
- Entity
Tag string - (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 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.
- Modified
At 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 String - (String) ID of the account that this API key authenticates for.
- apikey
Id String - (String) The unique identifier of the IBM-Cloud Api Key.
- created
At String - (Timestamp) If set contains a date time string of the creation date in ISO format.
- created
By 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.
- entity
Tag String - (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 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.
- modified
At 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 string - (String) ID of the account that this API key authenticates for.
- apikey
Id string - (String) The unique identifier of the IBM-Cloud Api Key.
- created
At string - (Timestamp) If set contains a date time string of the creation date in ISO format.
- created
By 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.
- entity
Tag string - (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 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.
- modified
At 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.
- account
Id String - (String) ID of the account that this API key authenticates for.
- apikey
Id String - (String) The unique identifier of the IBM-Cloud Api Key.
- created
At String - (Timestamp) If set contains a date time string of the creation date in ISO format.
- created
By 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.
- entity
Tag String - (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 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.
- modified
At 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.