1. Packages
  2. Ibm Provider
  3. API Docs
  4. ResourceKey
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.ResourceKey

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, or delete service credentials for an IAM-enabled service. By default, the ibm.ResourceKey resource creates service credentials that use the public service endpoint of a service. To create service credentials that use the private service endpoint instead, you must explicitly define that by using the parameter argument parameter. Note that your service might not support private service endpoints yet. For more information, about resource key, see adding and viewing credentials.

    Example Usage

    The following example enables to create credentials for a resource without a service ID.

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceInstanceArgs;
    import com.pulumi.ibm.ResourceKey;
    import com.pulumi.ibm.ResourceKeyArgs;
    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 resourceInstance = IbmFunctions.getResourceInstance(GetResourceInstanceArgs.builder()
                .name("myobjectsotrage")
                .build());
    
            var resourceKey = new ResourceKey("resourceKey", ResourceKeyArgs.builder()
                .role("Viewer")
                .resourceInstanceId(resourceInstance.applyValue(getResourceInstanceResult -> getResourceInstanceResult.id()))
                .timeouts(ResourceKeyTimeoutsArgs.builder()
                    .create("15m")
                    .delete("15m")
                    .build())
                .build());
    
        }
    }
    
    resources:
      resourceKey:
        type: ibm:ResourceKey
        properties:
          role: Viewer
          resourceInstanceId: ${resourceInstance.id}
          # User can increase timeouts
          timeouts:
            - create: 15m
              delete: 15m
    variables:
      resourceInstance:
        fn::invoke:
          function: ibm:getResourceInstance
          arguments:
            name: myobjectsotrage
    

    Note The current ibm.ResourceKey resource doesn’t have support for service_id argument but the service_id can be passed as one of the parameter.

    Example to create by using serviceID

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceInstanceArgs;
    import com.pulumi.ibm.IamServiceId;
    import com.pulumi.ibm.IamServiceIdArgs;
    import com.pulumi.ibm.ResourceKey;
    import com.pulumi.ibm.ResourceKeyArgs;
    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 resourceInstance = IbmFunctions.getResourceInstance(GetResourceInstanceArgs.builder()
                .name("myobjectsotrage")
                .build());
    
            var serviceID = new IamServiceId("serviceID", IamServiceIdArgs.builder()
                .description("New ServiceID")
                .build());
    
            var resourceKey = new ResourceKey("resourceKey", ResourceKeyArgs.builder()
                .role("Viewer")
                .resourceInstanceId(resourceInstance.applyValue(getResourceInstanceResult -> getResourceInstanceResult.id()))
                .parameters(Map.of("serviceid_crn", serviceID.crn()))
                .timeouts(ResourceKeyTimeoutsArgs.builder()
                    .create("15m")
                    .delete("15m")
                    .build())
                .build());
    
        }
    }
    
    resources:
      serviceID:
        type: ibm:IamServiceId
        properties:
          description: New ServiceID
      resourceKey:
        type: ibm:ResourceKey
        properties:
          role: Viewer
          resourceInstanceId: ${resourceInstance.id}
          parameters:
            serviceid_crn: ${serviceID.crn}
          # User can increase timeouts
          timeouts:
            - create: 15m
              delete: 15m
    variables:
      resourceInstance:
        fn::invoke:
          function: ibm:getResourceInstance
          arguments:
            name: myobjectsotrage
    

    Example to create by using HMAC

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceGroupArgs;
    import com.pulumi.ibm.ResourceInstance;
    import com.pulumi.ibm.ResourceInstanceArgs;
    import com.pulumi.ibm.ResourceKey;
    import com.pulumi.ibm.ResourceKeyArgs;
    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 group = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
                .name("Default")
                .build());
    
            var resourceInstance = new ResourceInstance("resourceInstance", ResourceInstanceArgs.builder()
                .service("cloud-object-storage")
                .plan("lite")
                .location("global")
                .resourceGroupId(group.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .tags(            
                    "tag1",
                    "tag2")
                .timeouts(ResourceInstanceTimeoutsArgs.builder()
                    .create("15m")
                    .update("15m")
                    .delete("15m")
                    .build())
                .build());
    
            var resourceKey = new ResourceKey("resourceKey", ResourceKeyArgs.builder()
                .resourceInstanceId(resourceInstance.resourceInstanceId())
                .parameters(Map.of("HMAC", true))
                .role("Manager")
                .build());
    
        }
    }
    
    resources:
      resourceInstance:
        type: ibm:ResourceInstance
        properties:
          service: cloud-object-storage
          plan: lite
          location: global
          resourceGroupId: ${group.id}
          tags:
            - tag1
            - tag2
          # User can increase timeouts
          timeouts:
            - create: 15m
              update: 15m
              delete: 15m
      resourceKey:
        type: ibm:ResourceKey
        properties:
          resourceInstanceId: ${resourceInstance.resourceInstanceId}
          parameters:
            HMAC: true
          role: Manager
    variables:
      group:
        fn::invoke:
          function: ibm:getResourceGroup
          arguments:
            name: Default
    

    Example to access resource credentials using credentials attribute:

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const key = new ibm.ResourceKey("key", {
        resourceInstanceId: ibm_resource_instance.resource_instance.id,
        role: "Manager",
    });
    export const accessKeyId = key.credentials["cos_hmac_keys.access_key_id"];
    export const secretAccessKey = key.credentials["cos_hmac_keys.secret_access_key"];
    
    import pulumi
    import pulumi_ibm as ibm
    
    key = ibm.ResourceKey("key",
        resource_instance_id=ibm_resource_instance["resource_instance"]["id"],
        role="Manager")
    pulumi.export("accessKeyId", key.credentials["cos_hmac_keys.access_key_id"])
    pulumi.export("secretAccessKey", key.credentials["cos_hmac_keys.secret_access_key"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		key, err := ibm.NewResourceKey(ctx, "key", &ibm.ResourceKeyArgs{
    			ResourceInstanceId: pulumi.Any(ibm_resource_instance.Resource_instance.Id),
    			Role:               pulumi.String("Manager"),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("accessKeyId", key.Credentials.ApplyT(func(credentials map[string]string) (string, error) {
    			return credentials.Cos_hmac_keys.access_key_id, nil
    		}).(pulumi.StringOutput))
    		ctx.Export("secretAccessKey", key.Credentials.ApplyT(func(credentials map[string]string) (string, error) {
    			return credentials.Cos_hmac_keys.secret_access_key, nil
    		}).(pulumi.StringOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var key = new Ibm.ResourceKey("key", new()
        {
            ResourceInstanceId = ibm_resource_instance.Resource_instance.Id,
            Role = "Manager",
        });
    
        return new Dictionary<string, object?>
        {
            ["accessKeyId"] = key.Credentials.Apply(credentials => credentials.Cos_hmac_keys_access_key_id),
            ["secretAccessKey"] = key.Credentials.Apply(credentials => credentials.Cos_hmac_keys_secret_access_key),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.ResourceKey;
    import com.pulumi.ibm.ResourceKeyArgs;
    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 key = new ResourceKey("key", ResourceKeyArgs.builder()
                .resourceInstanceId(ibm_resource_instance.resource_instance().id())
                .role("Manager")
                .build());
    
            ctx.export("accessKeyId", key.credentials().applyValue(credentials -> credentials.cos_hmac_keys.access_key_id()));
            ctx.export("secretAccessKey", key.credentials().applyValue(credentials -> credentials.cos_hmac_keys.secret_access_key()));
        }
    }
    
    resources:
      key:
        type: ibm:ResourceKey
        properties:
          resourceInstanceId: ${ibm_resource_instance.resource_instance.id}
          role: Manager
    outputs:
      accessKeyId: ${key.credentials"cos_hmac_keys.access_key_id"[%!s(MISSING)]}
      secretAccessKey: ${key.credentials"cos_hmac_keys.secret_access_key"[%!s(MISSING)]}
    

    Create ResourceKey Resource

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

    Constructor syntax

    new ResourceKey(name: string, args?: ResourceKeyArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceKey(resource_name: str,
                    args: Optional[ResourceKeyArgs] = None,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceKey(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    name: Optional[str] = None,
                    parameters: Optional[Mapping[str, str]] = None,
                    resource_alias_id: Optional[str] = None,
                    resource_instance_id: Optional[str] = None,
                    resource_key_id: Optional[str] = None,
                    role: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None,
                    timeouts: Optional[ResourceKeyTimeoutsArgs] = None)
    func NewResourceKey(ctx *Context, name string, args *ResourceKeyArgs, opts ...ResourceOption) (*ResourceKey, error)
    public ResourceKey(string name, ResourceKeyArgs? args = null, CustomResourceOptions? opts = null)
    public ResourceKey(String name, ResourceKeyArgs args)
    public ResourceKey(String name, ResourceKeyArgs args, CustomResourceOptions options)
    
    type: ibm:ResourceKey
    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 ResourceKeyArgs
    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 ResourceKeyArgs
    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 ResourceKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceKeyArgs
    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 resourceKeyResource = new Ibm.ResourceKey("resourceKeyResource", new()
    {
        Name = "string",
        Parameters = 
        {
            { "string", "string" },
        },
        ResourceInstanceId = "string",
        ResourceKeyId = "string",
        Role = "string",
        Tags = new[]
        {
            "string",
        },
        Timeouts = new Ibm.Inputs.ResourceKeyTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
    });
    
    example, err := ibm.NewResourceKey(ctx, "resourceKeyResource", &ibm.ResourceKeyArgs{
    	Name: pulumi.String("string"),
    	Parameters: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ResourceInstanceId: pulumi.String("string"),
    	ResourceKeyId:      pulumi.String("string"),
    	Role:               pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Timeouts: &ibm.ResourceKeyTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    })
    
    var resourceKeyResource = new ResourceKey("resourceKeyResource", ResourceKeyArgs.builder()
        .name("string")
        .parameters(Map.of("string", "string"))
        .resourceInstanceId("string")
        .resourceKeyId("string")
        .role("string")
        .tags("string")
        .timeouts(ResourceKeyTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .build());
    
    resource_key_resource = ibm.ResourceKey("resourceKeyResource",
        name="string",
        parameters={
            "string": "string",
        },
        resource_instance_id="string",
        resource_key_id="string",
        role="string",
        tags=["string"],
        timeouts={
            "create": "string",
            "delete": "string",
        })
    
    const resourceKeyResource = new ibm.ResourceKey("resourceKeyResource", {
        name: "string",
        parameters: {
            string: "string",
        },
        resourceInstanceId: "string",
        resourceKeyId: "string",
        role: "string",
        tags: ["string"],
        timeouts: {
            create: "string",
            "delete": "string",
        },
    });
    
    type: ibm:ResourceKey
    properties:
        name: string
        parameters:
            string: string
        resourceInstanceId: string
        resourceKeyId: string
        role: string
        tags:
            - string
        timeouts:
            create: string
            delete: string
    

    ResourceKey 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 ResourceKey resource accepts the following input properties:

    Name string
    A descriptive name used to identify a resource key.
    Parameters Dictionary<string, string>
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    ResourceAliasId string
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    ResourceInstanceId string
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    ResourceKeyId string
    (String) The unique identifier of the new resource key.
    Role string
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    Tags List<string>
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Timeouts ResourceKeyTimeouts
    Name string
    A descriptive name used to identify a resource key.
    Parameters map[string]string
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    ResourceAliasId string
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    ResourceInstanceId string
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    ResourceKeyId string
    (String) The unique identifier of the new resource key.
    Role string
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    Tags []string
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Timeouts ResourceKeyTimeoutsArgs
    name String
    A descriptive name used to identify a resource key.
    parameters Map<String,String>
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resourceAliasId String
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resourceInstanceId String
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resourceKeyId String
    (String) The unique identifier of the new resource key.
    role String
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    tags List<String>
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts ResourceKeyTimeouts
    name string
    A descriptive name used to identify a resource key.
    parameters {[key: string]: string}
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resourceAliasId string
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resourceInstanceId string
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resourceKeyId string
    (String) The unique identifier of the new resource key.
    role string
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    tags string[]
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts ResourceKeyTimeouts
    name str
    A descriptive name used to identify a resource key.
    parameters Mapping[str, str]
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resource_alias_id str
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resource_instance_id str
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resource_key_id str
    (String) The unique identifier of the new resource key.
    role str
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    tags Sequence[str]
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts ResourceKeyTimeoutsArgs
    name String
    A descriptive name used to identify a resource key.
    parameters Map<String>
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resourceAliasId String
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resourceInstanceId String
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resourceKeyId String
    (String) The unique identifier of the new resource key.
    role String
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    tags List<String>
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts Property Map

    Outputs

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

    AccountId string
    (String) An alpha-numeric value identifying the account ID.
    CreatedAt string
    (Timestamp) The date when the key was created.
    CreatedBy string
    (String) The subject who created the key.
    Credentials Dictionary<string, string>
    (Map) The credentials associated with the key.
    CredentialsJson string
    (String) The credentials associated with the key in json format.
    Crn string
    (String) The full Cloud Resource Name (CRN) associated with the key.
    DeletedAt string
    (Timestamp) The date when the key was deleted.
    DeletedBy string
    (String) The subject who deleted the key.
    Guid string
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    IamCompatible bool
    (String) Specifies whether the key’s credentials support IAM.
    Id string
    The provider-assigned unique ID for this managed resource.
    OnetimeCredentials bool
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    ResourceGroupId string
    (String) The short ID of the resource group.
    ResourceInstanceUrl string
    (String) The relative path to the resource.
    SourceCrn string
    (String) The CRN of resource instance or alias associated to the key.
    State string
    (String) The state of the key.
    Status string
    (String) The status of the resource key.
    UpdatedAt string
    (Timestamp) The date when the key was last updated.
    UpdatedBy string
    (String) The subject who updated the key.
    Url string
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    AccountId string
    (String) An alpha-numeric value identifying the account ID.
    CreatedAt string
    (Timestamp) The date when the key was created.
    CreatedBy string
    (String) The subject who created the key.
    Credentials map[string]string
    (Map) The credentials associated with the key.
    CredentialsJson string
    (String) The credentials associated with the key in json format.
    Crn string
    (String) The full Cloud Resource Name (CRN) associated with the key.
    DeletedAt string
    (Timestamp) The date when the key was deleted.
    DeletedBy string
    (String) The subject who deleted the key.
    Guid string
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    IamCompatible bool
    (String) Specifies whether the key’s credentials support IAM.
    Id string
    The provider-assigned unique ID for this managed resource.
    OnetimeCredentials bool
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    ResourceGroupId string
    (String) The short ID of the resource group.
    ResourceInstanceUrl string
    (String) The relative path to the resource.
    SourceCrn string
    (String) The CRN of resource instance or alias associated to the key.
    State string
    (String) The state of the key.
    Status string
    (String) The status of the resource key.
    UpdatedAt string
    (Timestamp) The date when the key was last updated.
    UpdatedBy string
    (String) The subject who updated the key.
    Url string
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    accountId String
    (String) An alpha-numeric value identifying the account ID.
    createdAt String
    (Timestamp) The date when the key was created.
    createdBy String
    (String) The subject who created the key.
    credentials Map<String,String>
    (Map) The credentials associated with the key.
    credentialsJson String
    (String) The credentials associated with the key in json format.
    crn String
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deletedAt String
    (Timestamp) The date when the key was deleted.
    deletedBy String
    (String) The subject who deleted the key.
    guid String
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iamCompatible Boolean
    (String) Specifies whether the key’s credentials support IAM.
    id String
    The provider-assigned unique ID for this managed resource.
    onetimeCredentials Boolean
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    resourceGroupId String
    (String) The short ID of the resource group.
    resourceInstanceUrl String
    (String) The relative path to the resource.
    sourceCrn String
    (String) The CRN of resource instance or alias associated to the key.
    state String
    (String) The state of the key.
    status String
    (String) The status of the resource key.
    updatedAt String
    (Timestamp) The date when the key was last updated.
    updatedBy String
    (String) The subject who updated the key.
    url String
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    accountId string
    (String) An alpha-numeric value identifying the account ID.
    createdAt string
    (Timestamp) The date when the key was created.
    createdBy string
    (String) The subject who created the key.
    credentials {[key: string]: string}
    (Map) The credentials associated with the key.
    credentialsJson string
    (String) The credentials associated with the key in json format.
    crn string
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deletedAt string
    (Timestamp) The date when the key was deleted.
    deletedBy string
    (String) The subject who deleted the key.
    guid string
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iamCompatible boolean
    (String) Specifies whether the key’s credentials support IAM.
    id string
    The provider-assigned unique ID for this managed resource.
    onetimeCredentials boolean
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    resourceGroupId string
    (String) The short ID of the resource group.
    resourceInstanceUrl string
    (String) The relative path to the resource.
    sourceCrn string
    (String) The CRN of resource instance or alias associated to the key.
    state string
    (String) The state of the key.
    status string
    (String) The status of the resource key.
    updatedAt string
    (Timestamp) The date when the key was last updated.
    updatedBy string
    (String) The subject who updated the key.
    url string
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    account_id str
    (String) An alpha-numeric value identifying the account ID.
    created_at str
    (Timestamp) The date when the key was created.
    created_by str
    (String) The subject who created the key.
    credentials Mapping[str, str]
    (Map) The credentials associated with the key.
    credentials_json str
    (String) The credentials associated with the key in json format.
    crn str
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deleted_at str
    (Timestamp) The date when the key was deleted.
    deleted_by str
    (String) The subject who deleted the key.
    guid str
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iam_compatible bool
    (String) Specifies whether the key’s credentials support IAM.
    id str
    The provider-assigned unique ID for this managed resource.
    onetime_credentials bool
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    resource_group_id str
    (String) The short ID of the resource group.
    resource_instance_url str
    (String) The relative path to the resource.
    source_crn str
    (String) The CRN of resource instance or alias associated to the key.
    state str
    (String) The state of the key.
    status str
    (String) The status of the resource key.
    updated_at str
    (Timestamp) The date when the key was last updated.
    updated_by str
    (String) The subject who updated the key.
    url str
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    accountId String
    (String) An alpha-numeric value identifying the account ID.
    createdAt String
    (Timestamp) The date when the key was created.
    createdBy String
    (String) The subject who created the key.
    credentials Map<String>
    (Map) The credentials associated with the key.
    credentialsJson String
    (String) The credentials associated with the key in json format.
    crn String
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deletedAt String
    (Timestamp) The date when the key was deleted.
    deletedBy String
    (String) The subject who deleted the key.
    guid String
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iamCompatible Boolean
    (String) Specifies whether the key’s credentials support IAM.
    id String
    The provider-assigned unique ID for this managed resource.
    onetimeCredentials Boolean
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    resourceGroupId String
    (String) The short ID of the resource group.
    resourceInstanceUrl String
    (String) The relative path to the resource.
    sourceCrn String
    (String) The CRN of resource instance or alias associated to the key.
    state String
    (String) The state of the key.
    status String
    (String) The status of the resource key.
    updatedAt String
    (Timestamp) The date when the key was last updated.
    updatedBy String
    (String) The subject who updated the key.
    url String
    (String) When you created a new key, a relative URL path is created identifying the location of the key.

    Look up Existing ResourceKey Resource

    Get an existing ResourceKey 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?: ResourceKeyState, opts?: CustomResourceOptions): ResourceKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            created_at: Optional[str] = None,
            created_by: Optional[str] = None,
            credentials: Optional[Mapping[str, str]] = None,
            credentials_json: Optional[str] = None,
            crn: Optional[str] = None,
            deleted_at: Optional[str] = None,
            deleted_by: Optional[str] = None,
            guid: Optional[str] = None,
            iam_compatible: Optional[bool] = None,
            name: Optional[str] = None,
            onetime_credentials: Optional[bool] = None,
            parameters: Optional[Mapping[str, str]] = None,
            resource_alias_id: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            resource_instance_id: Optional[str] = None,
            resource_instance_url: Optional[str] = None,
            resource_key_id: Optional[str] = None,
            role: Optional[str] = None,
            source_crn: Optional[str] = None,
            state: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            timeouts: Optional[ResourceKeyTimeoutsArgs] = None,
            updated_at: Optional[str] = None,
            updated_by: Optional[str] = None,
            url: Optional[str] = None) -> ResourceKey
    func GetResourceKey(ctx *Context, name string, id IDInput, state *ResourceKeyState, opts ...ResourceOption) (*ResourceKey, error)
    public static ResourceKey Get(string name, Input<string> id, ResourceKeyState? state, CustomResourceOptions? opts = null)
    public static ResourceKey get(String name, Output<String> id, ResourceKeyState state, CustomResourceOptions options)
    resources:  _:    type: ibm:ResourceKey    get:      id: ${id}
    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:
    AccountId string
    (String) An alpha-numeric value identifying the account ID.
    CreatedAt string
    (Timestamp) The date when the key was created.
    CreatedBy string
    (String) The subject who created the key.
    Credentials Dictionary<string, string>
    (Map) The credentials associated with the key.
    CredentialsJson string
    (String) The credentials associated with the key in json format.
    Crn string
    (String) The full Cloud Resource Name (CRN) associated with the key.
    DeletedAt string
    (Timestamp) The date when the key was deleted.
    DeletedBy string
    (String) The subject who deleted the key.
    Guid string
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    IamCompatible bool
    (String) Specifies whether the key’s credentials support IAM.
    Name string
    A descriptive name used to identify a resource key.
    OnetimeCredentials bool
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    Parameters Dictionary<string, string>
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    ResourceAliasId string
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    ResourceGroupId string
    (String) The short ID of the resource group.
    ResourceInstanceId string
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    ResourceInstanceUrl string
    (String) The relative path to the resource.
    ResourceKeyId string
    (String) The unique identifier of the new resource key.
    Role string
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    SourceCrn string
    (String) The CRN of resource instance or alias associated to the key.
    State string
    (String) The state of the key.
    Status string
    (String) The status of the resource key.
    Tags List<string>
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Timeouts ResourceKeyTimeouts
    UpdatedAt string
    (Timestamp) The date when the key was last updated.
    UpdatedBy string
    (String) The subject who updated the key.
    Url string
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    AccountId string
    (String) An alpha-numeric value identifying the account ID.
    CreatedAt string
    (Timestamp) The date when the key was created.
    CreatedBy string
    (String) The subject who created the key.
    Credentials map[string]string
    (Map) The credentials associated with the key.
    CredentialsJson string
    (String) The credentials associated with the key in json format.
    Crn string
    (String) The full Cloud Resource Name (CRN) associated with the key.
    DeletedAt string
    (Timestamp) The date when the key was deleted.
    DeletedBy string
    (String) The subject who deleted the key.
    Guid string
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    IamCompatible bool
    (String) Specifies whether the key’s credentials support IAM.
    Name string
    A descriptive name used to identify a resource key.
    OnetimeCredentials bool
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    Parameters map[string]string
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    ResourceAliasId string
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    ResourceGroupId string
    (String) The short ID of the resource group.
    ResourceInstanceId string
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    ResourceInstanceUrl string
    (String) The relative path to the resource.
    ResourceKeyId string
    (String) The unique identifier of the new resource key.
    Role string
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    SourceCrn string
    (String) The CRN of resource instance or alias associated to the key.
    State string
    (String) The state of the key.
    Status string
    (String) The status of the resource key.
    Tags []string
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    Timeouts ResourceKeyTimeoutsArgs
    UpdatedAt string
    (Timestamp) The date when the key was last updated.
    UpdatedBy string
    (String) The subject who updated the key.
    Url string
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    accountId String
    (String) An alpha-numeric value identifying the account ID.
    createdAt String
    (Timestamp) The date when the key was created.
    createdBy String
    (String) The subject who created the key.
    credentials Map<String,String>
    (Map) The credentials associated with the key.
    credentialsJson String
    (String) The credentials associated with the key in json format.
    crn String
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deletedAt String
    (Timestamp) The date when the key was deleted.
    deletedBy String
    (String) The subject who deleted the key.
    guid String
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iamCompatible Boolean
    (String) Specifies whether the key’s credentials support IAM.
    name String
    A descriptive name used to identify a resource key.
    onetimeCredentials Boolean
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    parameters Map<String,String>
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resourceAliasId String
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resourceGroupId String
    (String) The short ID of the resource group.
    resourceInstanceId String
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resourceInstanceUrl String
    (String) The relative path to the resource.
    resourceKeyId String
    (String) The unique identifier of the new resource key.
    role String
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    sourceCrn String
    (String) The CRN of resource instance or alias associated to the key.
    state String
    (String) The state of the key.
    status String
    (String) The status of the resource key.
    tags List<String>
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts ResourceKeyTimeouts
    updatedAt String
    (Timestamp) The date when the key was last updated.
    updatedBy String
    (String) The subject who updated the key.
    url String
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    accountId string
    (String) An alpha-numeric value identifying the account ID.
    createdAt string
    (Timestamp) The date when the key was created.
    createdBy string
    (String) The subject who created the key.
    credentials {[key: string]: string}
    (Map) The credentials associated with the key.
    credentialsJson string
    (String) The credentials associated with the key in json format.
    crn string
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deletedAt string
    (Timestamp) The date when the key was deleted.
    deletedBy string
    (String) The subject who deleted the key.
    guid string
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iamCompatible boolean
    (String) Specifies whether the key’s credentials support IAM.
    name string
    A descriptive name used to identify a resource key.
    onetimeCredentials boolean
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    parameters {[key: string]: string}
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resourceAliasId string
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resourceGroupId string
    (String) The short ID of the resource group.
    resourceInstanceId string
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resourceInstanceUrl string
    (String) The relative path to the resource.
    resourceKeyId string
    (String) The unique identifier of the new resource key.
    role string
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    sourceCrn string
    (String) The CRN of resource instance or alias associated to the key.
    state string
    (String) The state of the key.
    status string
    (String) The status of the resource key.
    tags string[]
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts ResourceKeyTimeouts
    updatedAt string
    (Timestamp) The date when the key was last updated.
    updatedBy string
    (String) The subject who updated the key.
    url string
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    account_id str
    (String) An alpha-numeric value identifying the account ID.
    created_at str
    (Timestamp) The date when the key was created.
    created_by str
    (String) The subject who created the key.
    credentials Mapping[str, str]
    (Map) The credentials associated with the key.
    credentials_json str
    (String) The credentials associated with the key in json format.
    crn str
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deleted_at str
    (Timestamp) The date when the key was deleted.
    deleted_by str
    (String) The subject who deleted the key.
    guid str
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iam_compatible bool
    (String) Specifies whether the key’s credentials support IAM.
    name str
    A descriptive name used to identify a resource key.
    onetime_credentials bool
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    parameters Mapping[str, str]
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resource_alias_id str
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resource_group_id str
    (String) The short ID of the resource group.
    resource_instance_id str
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resource_instance_url str
    (String) The relative path to the resource.
    resource_key_id str
    (String) The unique identifier of the new resource key.
    role str
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    source_crn str
    (String) The CRN of resource instance or alias associated to the key.
    state str
    (String) The state of the key.
    status str
    (String) The status of the resource key.
    tags Sequence[str]
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts ResourceKeyTimeoutsArgs
    updated_at str
    (Timestamp) The date when the key was last updated.
    updated_by str
    (String) The subject who updated the key.
    url str
    (String) When you created a new key, a relative URL path is created identifying the location of the key.
    accountId String
    (String) An alpha-numeric value identifying the account ID.
    createdAt String
    (Timestamp) The date when the key was created.
    createdBy String
    (String) The subject who created the key.
    credentials Map<String>
    (Map) The credentials associated with the key.
    credentialsJson String
    (String) The credentials associated with the key in json format.
    crn String
    (String) The full Cloud Resource Name (CRN) associated with the key.
    deletedAt String
    (Timestamp) The date when the key was deleted.
    deletedBy String
    (String) The subject who deleted the key.
    guid String
    (String) A unique internal identifier GUID managed by the resource controller that corresponds to the key.
    iamCompatible Boolean
    (String) Specifies whether the key’s credentials support IAM.
    name String
    A descriptive name used to identify a resource key.
    onetimeCredentials Boolean
    (Bool) A boolean that dictates if the onetime_credentials is true or false.
    parameters Map<String>
    Arbitrary parameters to pass to the resource in JSON format. If you want to create service credentials by using the private service endpoint, include the service-endpoints = "private" parameter.
    resourceAliasId String
    The ID of the resource alias associated with the resource key. Note Conflicts with resource_instance_id.

    Deprecated: Deprecated

    resourceGroupId String
    (String) The short ID of the resource group.
    resourceInstanceId String
    The ID of the resource instance associated with the resource key. Note Conflicts with resource_alias_id.
    resourceInstanceUrl String
    (String) The relative path to the resource.
    resourceKeyId String
    (String) The unique identifier of the new resource key.
    role String
    The name of the user role. Valid roles are NONE,Writer, Reader, Manager, Administrator, Operator, Viewer, and Editor. This argument is Optional only during creation of service credentials for Cloud Databases and other non-IAM-enabled services and is Required for all other IAM-enabled services.
    sourceCrn String
    (String) The CRN of resource instance or alias associated to the key.
    state String
    (String) The state of the key.
    status String
    (String) The status of the resource key.
    tags List<String>
    Tags associated with the resource key instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.
    timeouts Property Map
    updatedAt String
    (Timestamp) The date when the key was last updated.
    updatedBy String
    (String) The subject who updated the key.
    url String
    (String) When you created a new key, a relative URL path is created identifying the location of the key.

    Supporting Types

    ResourceKeyTimeouts, ResourceKeyTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud