oci.Identity.getApiKeys
Explore with Pulumi AI
This data source provides the list of Api Keys in Oracle Cloud Infrastructure Identity service.
Lists the API signing keys for the specified user. A user can have a maximum of three keys.
Every user has permission to use this API call for their own user ID. An administrator in your organization does not need to write a policy to give users this ability.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testApiKeys = oci.Identity.getApiKeys({
    userId: testUser.id,
});
import pulumi
import pulumi_oci as oci
test_api_keys = oci.Identity.get_api_keys(user_id=test_user["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.GetApiKeys(ctx, &identity.GetApiKeysArgs{
			UserId: testUser.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testApiKeys = Oci.Identity.GetApiKeys.Invoke(new()
    {
        UserId = testUser.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.IdentityFunctions;
import com.pulumi.oci.Identity.inputs.GetApiKeysArgs;
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 testApiKeys = IdentityFunctions.getApiKeys(GetApiKeysArgs.builder()
            .userId(testUser.id())
            .build());
    }
}
variables:
  testApiKeys:
    fn::invoke:
      function: oci:Identity:getApiKeys
      arguments:
        userId: ${testUser.id}
Using getApiKeys
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 getApiKeys(args: GetApiKeysArgs, opts?: InvokeOptions): Promise<GetApiKeysResult>
function getApiKeysOutput(args: GetApiKeysOutputArgs, opts?: InvokeOptions): Output<GetApiKeysResult>def get_api_keys(filters: Optional[Sequence[GetApiKeysFilter]] = None,
                 user_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetApiKeysResult
def get_api_keys_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetApiKeysFilterArgs]]]] = None,
                 user_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetApiKeysResult]func GetApiKeys(ctx *Context, args *GetApiKeysArgs, opts ...InvokeOption) (*GetApiKeysResult, error)
func GetApiKeysOutput(ctx *Context, args *GetApiKeysOutputArgs, opts ...InvokeOption) GetApiKeysResultOutput> Note: This function is named GetApiKeys in the Go SDK.
public static class GetApiKeys 
{
    public static Task<GetApiKeysResult> InvokeAsync(GetApiKeysArgs args, InvokeOptions? opts = null)
    public static Output<GetApiKeysResult> Invoke(GetApiKeysInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetApiKeysResult> getApiKeys(GetApiKeysArgs args, InvokeOptions options)
public static Output<GetApiKeysResult> getApiKeys(GetApiKeysArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Identity/getApiKeys:getApiKeys
  arguments:
    # arguments dictionaryThe following arguments are supported:
- UserId string
- The OCID of the user.
- Filters
List<GetApi Keys Filter> 
- UserId string
- The OCID of the user.
- Filters
[]GetApi Keys Filter 
- userId String
- The OCID of the user.
- filters
List<GetApi Keys Filter> 
- userId string
- The OCID of the user.
- filters
GetApi Keys Filter[] 
- user_id str
- The OCID of the user.
- filters
Sequence[GetApi Keys Filter] 
- userId String
- The OCID of the user.
- filters List<Property Map>
getApiKeys Result
The following output properties are available:
- ApiKeys List<GetApi Keys Api Key> 
- The list of api_keys.
- Id string
- The provider-assigned unique ID for this managed resource.
- UserId string
- The OCID of the user the key belongs to.
- Filters
List<GetApi Keys Filter> 
- ApiKeys []GetApi Keys Api Key 
- The list of api_keys.
- Id string
- The provider-assigned unique ID for this managed resource.
- UserId string
- The OCID of the user the key belongs to.
- Filters
[]GetApi Keys Filter 
- apiKeys List<GetApi Keys Api Key> 
- The list of api_keys.
- id String
- The provider-assigned unique ID for this managed resource.
- userId String
- The OCID of the user the key belongs to.
- filters
List<GetApi Keys Filter> 
- apiKeys GetApi Keys Api Key[] 
- The list of api_keys.
- id string
- The provider-assigned unique ID for this managed resource.
- userId string
- The OCID of the user the key belongs to.
- filters
GetApi Keys Filter[] 
- api_keys Sequence[GetApi Keys Api Key] 
- The list of api_keys.
- id str
- The provider-assigned unique ID for this managed resource.
- user_id str
- The OCID of the user the key belongs to.
- filters
Sequence[GetApi Keys Filter] 
- apiKeys List<Property Map>
- The list of api_keys.
- id String
- The provider-assigned unique ID for this managed resource.
- userId String
- The OCID of the user the key belongs to.
- filters List<Property Map>
Supporting Types
GetApiKeysApiKey    
- Fingerprint string
- The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
- Id string
- An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
- InactiveStatus string
- The detailed status of INACTIVE lifecycleState.
- KeyValue string
- The key's value.
- State string
- The API key's current state.
- TimeCreated string
- Date and time the ApiKeyobject was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- UserId string
- The OCID of the user.
- Fingerprint string
- The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
- Id string
- An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
- InactiveStatus string
- The detailed status of INACTIVE lifecycleState.
- KeyValue string
- The key's value.
- State string
- The API key's current state.
- TimeCreated string
- Date and time the ApiKeyobject was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- UserId string
- The OCID of the user.
- fingerprint String
- The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
- id String
- An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
- inactiveStatus String
- The detailed status of INACTIVE lifecycleState.
- keyValue String
- The key's value.
- state String
- The API key's current state.
- timeCreated String
- Date and time the ApiKeyobject was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- userId String
- The OCID of the user.
- fingerprint string
- The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
- id string
- An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
- inactiveStatus string
- The detailed status of INACTIVE lifecycleState.
- keyValue string
- The key's value.
- state string
- The API key's current state.
- timeCreated string
- Date and time the ApiKeyobject was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- userId string
- The OCID of the user.
- fingerprint str
- The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
- id str
- An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
- inactive_status str
- The detailed status of INACTIVE lifecycleState.
- key_value str
- The key's value.
- state str
- The API key's current state.
- time_created str
- Date and time the ApiKeyobject was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- user_id str
- The OCID of the user.
- fingerprint String
- The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).
- id String
- An Oracle-assigned identifier for the key, in this format: TENANCY_OCID/USER_OCID/KEY_FINGERPRINT.
- inactiveStatus String
- The detailed status of INACTIVE lifecycleState.
- keyValue String
- The key's value.
- state String
- The API key's current state.
- timeCreated String
- Date and time the ApiKeyobject was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- userId String
- The OCID of the user.
GetApiKeysFilter   
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.