1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. CustomerSecretKey
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Identity.CustomerSecretKey

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

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

    Creates a new secret key for the specified user. Secret keys are used for authentication with the Object Storage Service’s Amazon S3 compatible API. The secret key consists of an Access Key/Secret Key pair. For information, see Managing User Credentials.

    You must specify a description for the secret key (although it can be an empty string). It does not have to be unique, and you can change it anytime with UpdateCustomerSecretKey.

    Every user has permission to create a secret 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 create a secret key for any user, including themselves.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testCustomerSecretKey = new oci.identity.CustomerSecretKey("test_customer_secret_key", {
        displayName: customerSecretKeyDisplayName,
        userId: testUser.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_customer_secret_key = oci.identity.CustomerSecretKey("test_customer_secret_key",
        display_name=customer_secret_key_display_name,
        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.NewCustomerSecretKey(ctx, "test_customer_secret_key", &Identity.CustomerSecretKeyArgs{
    			DisplayName: pulumi.Any(customerSecretKeyDisplayName),
    			UserId:      pulumi.Any(testUser.Id),
    		})
    		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 testCustomerSecretKey = new Oci.Identity.CustomerSecretKey("test_customer_secret_key", new()
        {
            DisplayName = customerSecretKeyDisplayName,
            UserId = testUser.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Identity.CustomerSecretKey;
    import com.pulumi.oci.Identity.CustomerSecretKeyArgs;
    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 testCustomerSecretKey = new CustomerSecretKey("testCustomerSecretKey", CustomerSecretKeyArgs.builder()
                .displayName(customerSecretKeyDisplayName)
                .userId(testUser.id())
                .build());
    
        }
    }
    
    resources:
      testCustomerSecretKey:
        type: oci:Identity:CustomerSecretKey
        name: test_customer_secret_key
        properties:
          displayName: ${customerSecretKeyDisplayName}
          userId: ${testUser.id}
    

    Create CustomerSecretKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

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

    Parameters

    name string
    The unique name of the resource.
    args CustomerSecretKeyArgs
    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 CustomerSecretKeyArgs
    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 CustomerSecretKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomerSecretKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomerSecretKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var customerSecretKeyResource = new Oci.Identity.CustomerSecretKey("customerSecretKeyResource", new()
    {
        DisplayName = "string",
        UserId = "string",
    });
    
    example, err := Identity.NewCustomerSecretKey(ctx, "customerSecretKeyResource", &Identity.CustomerSecretKeyArgs{
    	DisplayName: pulumi.String("string"),
    	UserId:      pulumi.String("string"),
    })
    
    var customerSecretKeyResource = new CustomerSecretKey("customerSecretKeyResource", CustomerSecretKeyArgs.builder()
        .displayName("string")
        .userId("string")
        .build());
    
    customer_secret_key_resource = oci.identity.CustomerSecretKey("customerSecretKeyResource",
        display_name="string",
        user_id="string")
    
    const customerSecretKeyResource = new oci.identity.CustomerSecretKey("customerSecretKeyResource", {
        displayName: "string",
        userId: "string",
    });
    
    type: oci:Identity:CustomerSecretKey
    properties:
        displayName: string
        userId: string
    

    CustomerSecretKey Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CustomerSecretKey resource accepts the following input properties:

    DisplayName string
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    DisplayName string
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    displayName String
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    displayName string
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    userId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    display_name str
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    user_id str

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    displayName String
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Key string
    The secret key.
    State string
    The secret key's current state.
    TimeCreated string
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires string
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Key string
    The secret key.
    State string
    The secret key's current state.
    TimeCreated string
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires string
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    key String
    The secret key.
    state String
    The secret key's current state.
    timeCreated String
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires String
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    id string
    The provider-assigned unique ID for this managed resource.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    key string
    The secret key.
    state string
    The secret key's current state.
    timeCreated string
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires string
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    id str
    The provider-assigned unique ID for this managed resource.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    key str
    The secret key.
    state str
    The secret key's current state.
    time_created str
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    time_expires str
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    key String
    The secret key.
    state String
    The secret key's current state.
    timeCreated String
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires String
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z

    Look up Existing CustomerSecretKey Resource

    Get an existing CustomerSecretKey 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?: CustomerSecretKeyState, opts?: CustomResourceOptions): CustomerSecretKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            display_name: Optional[str] = None,
            inactive_state: Optional[str] = None,
            key: Optional[str] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None,
            time_expires: Optional[str] = None,
            user_id: Optional[str] = None) -> CustomerSecretKey
    func GetCustomerSecretKey(ctx *Context, name string, id IDInput, state *CustomerSecretKeyState, opts ...ResourceOption) (*CustomerSecretKey, error)
    public static CustomerSecretKey Get(string name, Input<string> id, CustomerSecretKeyState? state, CustomResourceOptions? opts = null)
    public static CustomerSecretKey get(String name, Output<String> id, CustomerSecretKeyState 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:
    DisplayName string
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Key string
    The secret key.
    State string
    The secret key's current state.
    TimeCreated string
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires string
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    DisplayName string
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Key string
    The secret key.
    State string
    The secret key's current state.
    TimeCreated string
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires string
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    displayName String
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    key String
    The secret key.
    state String
    The secret key's current state.
    timeCreated String
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires String
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    displayName string
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    key string
    The secret key.
    state string
    The secret key's current state.
    timeCreated string
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires string
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    userId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    display_name str
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    key str
    The secret key.
    state str
    The secret key's current state.
    time_created str
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    time_expires str
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    user_id str

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    displayName String
    (Updatable) The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    key String
    The secret key.
    state String
    The secret key's current state.
    timeCreated String
    Date and time the CustomerSecretKey object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires String
    Date and time when this password will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Import

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

    $ pulumi import oci:Identity/customerSecretKey:CustomerSecretKey test_customer_secret_key "users/{userId}/customerSecretKeys/{customerSecretKeyId}"
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.17.0 published on Friday, Nov 15, 2024 by Pulumi