1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getApiKeys
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.Identity.getApiKeys

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

    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[_identity.GetApiKeysFilter]] = None,
                     user_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetApiKeysResult
    def get_api_keys_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Identity/getApiKeys:getApiKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UserId string
    The OCID of the user.
    Filters List<GetApiKeysFilter>
    UserId string
    The OCID of the user.
    Filters []GetApiKeysFilter
    userId String
    The OCID of the user.
    filters List<GetApiKeysFilter>
    userId string
    The OCID of the user.
    filters GetApiKeysFilter[]
    userId String
    The OCID of the user.
    filters List<Property Map>

    getApiKeys Result

    The following output properties are available:

    ApiKeys List<GetApiKeysApiKey>
    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<GetApiKeysFilter>
    ApiKeys []GetApiKeysApiKey
    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 []GetApiKeysFilter
    apiKeys List<GetApiKeysApiKey>
    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<GetApiKeysFilter>
    apiKeys GetApiKeysApiKey[]
    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 GetApiKeysFilter[]
    api_keys Sequence[identity.GetApiKeysApiKey]
    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[identity.GetApiKeysFilter]
    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 ApiKey object 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 ApiKey object 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 ApiKey object 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 ApiKey object 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 ApiKey object 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 ApiKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    userId String
    The OCID of the user.

    GetApiKeysFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi