oci logo
Oracle Cloud Infrastructure v0.12.0, Mar 17 23

oci.Identity.ApiKey

This resource provides the Api Key resource in Oracle Cloud Infrastructure Identity service.

Uploads an API signing key for the specified user.

Every user has permission to use this operation to upload a key for their own user ID. An administrator in your organization does not need to write a policy to give users this ability. To compare, administrators who have permission to the tenancy can use this operation to upload a key for any user, including themselves.

Important: Even though you have permission to upload an API key, you might not yet have permission to do much else. If you try calling an operation unrelated to your own credential management (e.g., ListUsers, LaunchInstance) and receive an “unauthorized” error, check with an administrator to confirm which IAM Service group(s) you’re in and what access you have. Also confirm you’re working in the correct compartment.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testApiKey = new Oci.Identity.ApiKey("testApiKey", new()
    {
        KeyValue = @var.Api_key_key_value,
        UserId = oci_identity_user.Test_user.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/go/oci/Identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Identity.NewApiKey(ctx, "testApiKey", &Identity.ApiKeyArgs{
			KeyValue: pulumi.Any(_var.Api_key_key_value),
			UserId:   pulumi.Any(oci_identity_user.Test_user.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.ApiKey;
import com.pulumi.oci.Identity.ApiKeyArgs;
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) {
        var testApiKey = new ApiKey("testApiKey", ApiKeyArgs.builder()        
            .keyValue(var_.api_key_key_value())
            .userId(oci_identity_user.test_user().id())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_api_key = oci.identity.ApiKey("testApiKey",
    key_value=var["api_key_key_value"],
    user_id=oci_identity_user["test_user"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testApiKey = new oci.identity.ApiKey("testApiKey", {
    keyValue: _var.api_key_key_value,
    userId: oci_identity_user.test_user.id,
});
resources:
  testApiKey:
    type: oci:Identity:ApiKey
    properties:
      #Required
      keyValue: ${var.api_key_key_value}
      userId: ${oci_identity_user.test_user.id}

Create ApiKey Resource

new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);
@overload
def ApiKey(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           key_value: Optional[str] = None,
           user_id: Optional[str] = None)
@overload
def ApiKey(resource_name: str,
           args: ApiKeyArgs,
           opts: Optional[ResourceOptions] = None)
func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)
public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: oci:Identity:ApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ApiKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ApiKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ApiKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApiKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ApiKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ApiKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ApiKey resource accepts the following input properties:

KeyValue string

The public key. Must be an RSA key in PEM format.

UserId string

The OCID of the user.

KeyValue string

The public key. Must be an RSA key in PEM format.

UserId string

The OCID of the user.

keyValue String

The public key. Must be an RSA key in PEM format.

userId String

The OCID of the user.

keyValue string

The public key. Must be an RSA key in PEM format.

userId string

The OCID of the user.

key_value str

The public key. Must be an RSA key in PEM format.

user_id str

The OCID of the user.

keyValue String

The public key. Must be an RSA key in PEM format.

userId String

The OCID of the user.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:

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

The provider-assigned unique ID for this managed resource.

InactiveStatus string

The detailed status of INACTIVE lifecycleState.

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

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

The provider-assigned unique ID for this managed resource.

InactiveStatus string

The detailed status of INACTIVE lifecycleState.

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

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

The provider-assigned unique ID for this managed resource.

inactiveStatus String

The detailed status of INACTIVE lifecycleState.

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

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

The provider-assigned unique ID for this managed resource.

inactiveStatus string

The detailed status of INACTIVE lifecycleState.

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

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

The provider-assigned unique ID for this managed resource.

inactive_status str

The detailed status of INACTIVE lifecycleState.

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

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

The provider-assigned unique ID for this managed resource.

inactiveStatus String

The detailed status of INACTIVE lifecycleState.

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

Look up Existing ApiKey Resource

Get an existing ApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApiKeyState, opts?: CustomResourceOptions): ApiKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        fingerprint: Optional[str] = None,
        inactive_status: Optional[str] = None,
        key_value: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None,
        user_id: Optional[str] = None) -> ApiKey
func GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)
public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)
public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Fingerprint string

The key's fingerprint (e.g., 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef).

InactiveStatus string

The detailed status of INACTIVE lifecycleState.

KeyValue string

The public key. Must be an RSA key in PEM format.

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).

InactiveStatus string

The detailed status of INACTIVE lifecycleState.

KeyValue string

The public key. Must be an RSA key in PEM format.

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).

inactiveStatus String

The detailed status of INACTIVE lifecycleState.

keyValue String

The public key. Must be an RSA key in PEM format.

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).

inactiveStatus string

The detailed status of INACTIVE lifecycleState.

keyValue string

The public key. Must be an RSA key in PEM format.

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).

inactive_status str

The detailed status of INACTIVE lifecycleState.

key_value str

The public key. Must be an RSA key in PEM format.

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).

inactiveStatus String

The detailed status of INACTIVE lifecycleState.

keyValue String

The public key. Must be an RSA key in PEM format.

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.

Import

ApiKeys can be imported using the id, e.g.

 $ pulumi import oci:Identity/apiKey:ApiKey test_api_key "users/{userId}/apiKeys/{fingerprint}"

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.