1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Kms
  5. getKeyVersions
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.Kms.getKeyVersions

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This data source provides the list of Key Versions in Oracle Cloud Infrastructure Kms service.

    Lists all KeyVersion resources for the specified master encryption key.

    As a management operation, this call is subject to a Key Management limit that applies to the total number of requests across all management read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of management read operations exceeds 10 requests per second for a given tenancy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testKeyVersions = oci.Kms.getKeyVersions({
        keyId: oci_kms_key.test_key.id,
        managementEndpoint: _var.key_version_management_endpoint,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_key_versions = oci.Kms.get_key_versions(key_id=oci_kms_key["test_key"]["id"],
        management_endpoint=var["key_version_management_endpoint"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Kms.GetKeyVersions(ctx, &kms.GetKeyVersionsArgs{
    			KeyId:              oci_kms_key.Test_key.Id,
    			ManagementEndpoint: _var.Key_version_management_endpoint,
    		}, 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 testKeyVersions = Oci.Kms.GetKeyVersions.Invoke(new()
        {
            KeyId = oci_kms_key.Test_key.Id,
            ManagementEndpoint = @var.Key_version_management_endpoint,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Kms.KmsFunctions;
    import com.pulumi.oci.Kms.inputs.GetKeyVersionsArgs;
    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 testKeyVersions = KmsFunctions.getKeyVersions(GetKeyVersionsArgs.builder()
                .keyId(oci_kms_key.test_key().id())
                .managementEndpoint(var_.key_version_management_endpoint())
                .build());
    
        }
    }
    
    variables:
      testKeyVersions:
        fn::invoke:
          Function: oci:Kms:getKeyVersions
          Arguments:
            keyId: ${oci_kms_key.test_key.id}
            managementEndpoint: ${var.key_version_management_endpoint}
    

    Using getKeyVersions

    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 getKeyVersions(args: GetKeyVersionsArgs, opts?: InvokeOptions): Promise<GetKeyVersionsResult>
    function getKeyVersionsOutput(args: GetKeyVersionsOutputArgs, opts?: InvokeOptions): Output<GetKeyVersionsResult>
    def get_key_versions(filters: Optional[Sequence[_kms.GetKeyVersionsFilter]] = None,
                         key_id: Optional[str] = None,
                         management_endpoint: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetKeyVersionsResult
    def get_key_versions_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_kms.GetKeyVersionsFilterArgs]]]] = None,
                         key_id: Optional[pulumi.Input[str]] = None,
                         management_endpoint: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetKeyVersionsResult]
    func GetKeyVersions(ctx *Context, args *GetKeyVersionsArgs, opts ...InvokeOption) (*GetKeyVersionsResult, error)
    func GetKeyVersionsOutput(ctx *Context, args *GetKeyVersionsOutputArgs, opts ...InvokeOption) GetKeyVersionsResultOutput

    > Note: This function is named GetKeyVersions in the Go SDK.

    public static class GetKeyVersions 
    {
        public static Task<GetKeyVersionsResult> InvokeAsync(GetKeyVersionsArgs args, InvokeOptions? opts = null)
        public static Output<GetKeyVersionsResult> Invoke(GetKeyVersionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKeyVersionsResult> getKeyVersions(GetKeyVersionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Kms/getKeyVersions:getKeyVersions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    KeyId string
    The OCID of the key.
    ManagementEndpoint string
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    Filters List<GetKeyVersionsFilter>
    KeyId string
    The OCID of the key.
    ManagementEndpoint string
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    Filters []GetKeyVersionsFilter
    keyId String
    The OCID of the key.
    managementEndpoint String
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    filters List<GetKeyVersionsFilter>
    keyId string
    The OCID of the key.
    managementEndpoint string
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    filters GetKeyVersionsFilter[]
    key_id str
    The OCID of the key.
    management_endpoint str
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    filters Sequence[kms.GetKeyVersionsFilter]
    keyId String
    The OCID of the key.
    managementEndpoint String
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    filters List<Property Map>

    getKeyVersions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The OCID of the master encryption key associated with this key version.
    KeyVersions List<GetKeyVersionsKeyVersion>
    The list of key_versions.
    ManagementEndpoint string
    Filters List<GetKeyVersionsFilter>
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The OCID of the master encryption key associated with this key version.
    KeyVersions []GetKeyVersionsKeyVersion
    The list of key_versions.
    ManagementEndpoint string
    Filters []GetKeyVersionsFilter
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The OCID of the master encryption key associated with this key version.
    keyVersions List<GetKeyVersionsKeyVersion>
    The list of key_versions.
    managementEndpoint String
    filters List<GetKeyVersionsFilter>
    id string
    The provider-assigned unique ID for this managed resource.
    keyId string
    The OCID of the master encryption key associated with this key version.
    keyVersions GetKeyVersionsKeyVersion[]
    The list of key_versions.
    managementEndpoint string
    filters GetKeyVersionsFilter[]
    id str
    The provider-assigned unique ID for this managed resource.
    key_id str
    The OCID of the master encryption key associated with this key version.
    key_versions Sequence[kms.GetKeyVersionsKeyVersion]
    The list of key_versions.
    management_endpoint str
    filters Sequence[kms.GetKeyVersionsFilter]
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The OCID of the master encryption key associated with this key version.
    keyVersions List<Property Map>
    The list of key_versions.
    managementEndpoint String
    filters List<Property Map>

    Supporting Types

    GetKeyVersionsFilter

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

    GetKeyVersionsKeyVersion

    CompartmentId string
    The OCID of the compartment that contains this key version.
    ExternalKeyReferenceDetails List<GetKeyVersionsKeyVersionExternalKeyReferenceDetail>
    Key reference data to be returned to the customer as a response.
    ExternalKeyVersionId string
    Key version ID associated with the external key.
    Id string
    The OCID of the key version.
    IsAutoRotated bool
    An optional property indicating whether this keyversion is generated from auto rotatation.
    IsPrimary bool
    A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault.
    KeyId string
    The OCID of the key.
    KeyVersionId string
    The OCID of the key version.
    ManagementEndpoint string
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    PublicKey string
    The public key in PEM format. (This value pertains only to RSA and ECDSA keys.)
    ReplicaDetails List<GetKeyVersionsKeyVersionReplicaDetail>
    KeyVersion replica details
    RestoredFromKeyId string
    RestoredFromKeyVersionId string
    The OCID of the key version from which this key version was restored.
    State string
    The key version's current lifecycle state. Example: ENABLED
    TimeCreated string
    The date and time this key version was created, expressed in RFC 3339 timestamp format. Example: "2018-04-03T21:10:29.600Z"
    TimeOfDeletion string
    An optional property to indicate when to delete the key version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    VaultId string
    The OCID of the vault that contains this key version.
    CompartmentId string
    The OCID of the compartment that contains this key version.
    ExternalKeyReferenceDetails []GetKeyVersionsKeyVersionExternalKeyReferenceDetail
    Key reference data to be returned to the customer as a response.
    ExternalKeyVersionId string
    Key version ID associated with the external key.
    Id string
    The OCID of the key version.
    IsAutoRotated bool
    An optional property indicating whether this keyversion is generated from auto rotatation.
    IsPrimary bool
    A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault.
    KeyId string
    The OCID of the key.
    KeyVersionId string
    The OCID of the key version.
    ManagementEndpoint string
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    PublicKey string
    The public key in PEM format. (This value pertains only to RSA and ECDSA keys.)
    ReplicaDetails []GetKeyVersionsKeyVersionReplicaDetail
    KeyVersion replica details
    RestoredFromKeyId string
    RestoredFromKeyVersionId string
    The OCID of the key version from which this key version was restored.
    State string
    The key version's current lifecycle state. Example: ENABLED
    TimeCreated string
    The date and time this key version was created, expressed in RFC 3339 timestamp format. Example: "2018-04-03T21:10:29.600Z"
    TimeOfDeletion string
    An optional property to indicate when to delete the key version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    VaultId string
    The OCID of the vault that contains this key version.
    compartmentId String
    The OCID of the compartment that contains this key version.
    externalKeyReferenceDetails List<GetKeyVersionsKeyVersionExternalKeyReferenceDetail>
    Key reference data to be returned to the customer as a response.
    externalKeyVersionId String
    Key version ID associated with the external key.
    id String
    The OCID of the key version.
    isAutoRotated Boolean
    An optional property indicating whether this keyversion is generated from auto rotatation.
    isPrimary Boolean
    A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault.
    keyId String
    The OCID of the key.
    keyVersionId String
    The OCID of the key version.
    managementEndpoint String
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    publicKey String
    The public key in PEM format. (This value pertains only to RSA and ECDSA keys.)
    replicaDetails List<GetKeyVersionsKeyVersionReplicaDetail>
    KeyVersion replica details
    restoredFromKeyId String
    restoredFromKeyVersionId String
    The OCID of the key version from which this key version was restored.
    state String
    The key version's current lifecycle state. Example: ENABLED
    timeCreated String
    The date and time this key version was created, expressed in RFC 3339 timestamp format. Example: "2018-04-03T21:10:29.600Z"
    timeOfDeletion String
    An optional property to indicate when to delete the key version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    vaultId String
    The OCID of the vault that contains this key version.
    compartmentId string
    The OCID of the compartment that contains this key version.
    externalKeyReferenceDetails GetKeyVersionsKeyVersionExternalKeyReferenceDetail[]
    Key reference data to be returned to the customer as a response.
    externalKeyVersionId string
    Key version ID associated with the external key.
    id string
    The OCID of the key version.
    isAutoRotated boolean
    An optional property indicating whether this keyversion is generated from auto rotatation.
    isPrimary boolean
    A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault.
    keyId string
    The OCID of the key.
    keyVersionId string
    The OCID of the key version.
    managementEndpoint string
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    publicKey string
    The public key in PEM format. (This value pertains only to RSA and ECDSA keys.)
    replicaDetails GetKeyVersionsKeyVersionReplicaDetail[]
    KeyVersion replica details
    restoredFromKeyId string
    restoredFromKeyVersionId string
    The OCID of the key version from which this key version was restored.
    state string
    The key version's current lifecycle state. Example: ENABLED
    timeCreated string
    The date and time this key version was created, expressed in RFC 3339 timestamp format. Example: "2018-04-03T21:10:29.600Z"
    timeOfDeletion string
    An optional property to indicate when to delete the key version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    vaultId string
    The OCID of the vault that contains this key version.
    compartment_id str
    The OCID of the compartment that contains this key version.
    external_key_reference_details Sequence[kms.GetKeyVersionsKeyVersionExternalKeyReferenceDetail]
    Key reference data to be returned to the customer as a response.
    external_key_version_id str
    Key version ID associated with the external key.
    id str
    The OCID of the key version.
    is_auto_rotated bool
    An optional property indicating whether this keyversion is generated from auto rotatation.
    is_primary bool
    A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault.
    key_id str
    The OCID of the key.
    key_version_id str
    The OCID of the key version.
    management_endpoint str
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    public_key str
    The public key in PEM format. (This value pertains only to RSA and ECDSA keys.)
    replica_details Sequence[kms.GetKeyVersionsKeyVersionReplicaDetail]
    KeyVersion replica details
    restored_from_key_id str
    restored_from_key_version_id str
    The OCID of the key version from which this key version was restored.
    state str
    The key version's current lifecycle state. Example: ENABLED
    time_created str
    The date and time this key version was created, expressed in RFC 3339 timestamp format. Example: "2018-04-03T21:10:29.600Z"
    time_of_deletion str
    An optional property to indicate when to delete the key version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    vault_id str
    The OCID of the vault that contains this key version.
    compartmentId String
    The OCID of the compartment that contains this key version.
    externalKeyReferenceDetails List<Property Map>
    Key reference data to be returned to the customer as a response.
    externalKeyVersionId String
    Key version ID associated with the external key.
    id String
    The OCID of the key version.
    isAutoRotated Boolean
    An optional property indicating whether this keyversion is generated from auto rotatation.
    isPrimary Boolean
    A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault.
    keyId String
    The OCID of the key.
    keyVersionId String
    The OCID of the key version.
    managementEndpoint String
    The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint.
    publicKey String
    The public key in PEM format. (This value pertains only to RSA and ECDSA keys.)
    replicaDetails List<Property Map>
    KeyVersion replica details
    restoredFromKeyId String
    restoredFromKeyVersionId String
    The OCID of the key version from which this key version was restored.
    state String
    The key version's current lifecycle state. Example: ENABLED
    timeCreated String
    The date and time this key version was created, expressed in RFC 3339 timestamp format. Example: "2018-04-03T21:10:29.600Z"
    timeOfDeletion String
    An optional property to indicate when to delete the key version, expressed in RFC 3339 timestamp format. Example: 2019-04-03T21:10:29.600Z
    vaultId String
    The OCID of the vault that contains this key version.

    GetKeyVersionsKeyVersionExternalKeyReferenceDetail

    ExternalKeyId string
    ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM.
    ExternalKeyVersionId string
    Key version ID associated with the external key.
    ExternalKeyId string
    ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM.
    ExternalKeyVersionId string
    Key version ID associated with the external key.
    externalKeyId String
    ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM.
    externalKeyVersionId String
    Key version ID associated with the external key.
    externalKeyId string
    ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM.
    externalKeyVersionId string
    Key version ID associated with the external key.
    external_key_id str
    ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM.
    external_key_version_id str
    Key version ID associated with the external key.
    externalKeyId String
    ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM.
    externalKeyVersionId String
    Key version ID associated with the external key.

    GetKeyVersionsKeyVersionReplicaDetail

    ReplicationId string
    ReplicationId associated with a key version operation
    ReplicationId string
    ReplicationId associated with a key version operation
    replicationId String
    ReplicationId associated with a key version operation
    replicationId string
    ReplicationId associated with a key version operation
    replication_id str
    ReplicationId associated with a key version operation
    replicationId String
    ReplicationId associated with a key version operation

    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 v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi