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[_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:
- User
Id string - The OCID of the user.
- Filters
List<Get
Api Keys Filter>
- User
Id string - The OCID of the user.
- Filters
[]Get
Api Keys Filter
- user
Id String - The OCID of the user.
- filters
List<Get
Api Keys Filter>
- user
Id string - The OCID of the user.
- filters
Get
Api Keys Filter[]
- user_
id str - The OCID of the user.
- filters
Sequence[identity.
Get Api Keys Filter]
- user
Id String - The OCID of the user.
- filters List<Property Map>
getApiKeys Result
The following output properties are available:
- Api
Keys List<GetApi Keys Api Key> - The list of api_keys.
- Id string
- The provider-assigned unique ID for this managed resource.
- User
Id string - The OCID of the user the key belongs to.
- Filters
List<Get
Api Keys Filter>
- Api
Keys []GetApi Keys Api Key - The list of api_keys.
- Id string
- The provider-assigned unique ID for this managed resource.
- User
Id string - The OCID of the user the key belongs to.
- Filters
[]Get
Api Keys Filter
- api
Keys List<GetApi Keys Api Key> - The list of api_keys.
- id String
- The provider-assigned unique ID for this managed resource.
- user
Id String - The OCID of the user the key belongs to.
- filters
List<Get
Api Keys Filter>
- api
Keys GetApi Keys Api Key[] - The list of api_keys.
- id string
- The provider-assigned unique ID for this managed resource.
- user
Id string - The OCID of the user the key belongs to.
- filters
Get
Api Keys Filter[]
- api_
keys Sequence[identity.Get Api 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[identity.
Get Api Keys Filter]
- api
Keys List<Property Map> - The list of api_keys.
- id String
- The provider-assigned unique ID for this managed resource.
- user
Id 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.
- Inactive
Status string - The detailed status of INACTIVE lifecycleState.
- Key
Value string - The key's value.
- State string
- The API key's current state.
- Time
Created string - Date and time the
ApiKey
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- User
Id 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.
- Inactive
Status string - The detailed status of INACTIVE lifecycleState.
- Key
Value string - The key's value.
- State string
- The API key's current state.
- Time
Created string - Date and time the
ApiKey
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- User
Id 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.
- inactive
Status String - The detailed status of INACTIVE lifecycleState.
- key
Value String - The key's value.
- state String
- The API key's current state.
- time
Created String - Date and time the
ApiKey
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- user
Id 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.
- inactive
Status string - The detailed status of INACTIVE lifecycleState.
- key
Value string - The key's value.
- state string
- The API key's current state.
- time
Created string - Date and time the
ApiKey
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- user
Id 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.
- inactive
Status String - The detailed status of INACTIVE lifecycleState.
- key
Value String - The key's value.
- state String
- The API key's current state.
- time
Created String - Date and time the
ApiKey
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- user
Id 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
oci
Terraform Provider.