1. Packages
  2. OVH
  3. API Docs
  4. getOkmsSecret
OVHCloud v2.9.0 published on Friday, Nov 7, 2025 by OVHcloud
ovh logo
OVHCloud v2.9.0 published on Friday, Nov 7, 2025 by OVHcloud

    Example Usage

    Get the latest secret version (metadata only):

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const latest = ovh.getOkmsSecret({
        okmsId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        path: "app/api_credentials",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    latest = ovh.get_okms_secret(okms_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        path="app/api_credentials")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ovh.GetOkmsSecret(ctx, &ovh.GetOkmsSecretArgs{
    			OkmsId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    			Path:   "app/api_credentials",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var latest = Ovh.GetOkmsSecret.Invoke(new()
        {
            OkmsId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            Path = "app/api_credentials",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.OvhFunctions;
    import com.pulumi.ovh.inputs.GetOkmsSecretArgs;
    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 latest = OvhFunctions.getOkmsSecret(GetOkmsSecretArgs.builder()
                .okmsId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
                .path("app/api_credentials")
                .build());
    
        }
    }
    
    variables:
      latest:
        fn::invoke:
          function: ovh:getOkmsSecret
          arguments:
            okmsId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
            path: app/api_credentials
    

    Get the latest secret version including its data:

    Using getOkmsSecret

    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 getOkmsSecret(args: GetOkmsSecretArgs, opts?: InvokeOptions): Promise<GetOkmsSecretResult>
    function getOkmsSecretOutput(args: GetOkmsSecretOutputArgs, opts?: InvokeOptions): Output<GetOkmsSecretResult>
    def get_okms_secret(include_data: Optional[bool] = None,
                        okms_id: Optional[str] = None,
                        path: Optional[str] = None,
                        version: Optional[float] = None,
                        opts: Optional[InvokeOptions] = None) -> GetOkmsSecretResult
    def get_okms_secret_output(include_data: Optional[pulumi.Input[bool]] = None,
                        okms_id: Optional[pulumi.Input[str]] = None,
                        path: Optional[pulumi.Input[str]] = None,
                        version: Optional[pulumi.Input[float]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetOkmsSecretResult]
    func GetOkmsSecret(ctx *Context, args *GetOkmsSecretArgs, opts ...InvokeOption) (*GetOkmsSecretResult, error)
    func GetOkmsSecretOutput(ctx *Context, args *GetOkmsSecretOutputArgs, opts ...InvokeOption) GetOkmsSecretResultOutput

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

    public static class GetOkmsSecret 
    {
        public static Task<GetOkmsSecretResult> InvokeAsync(GetOkmsSecretArgs args, InvokeOptions? opts = null)
        public static Output<GetOkmsSecretResult> Invoke(GetOkmsSecretInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOkmsSecretResult> getOkmsSecret(GetOkmsSecretArgs args, InvokeOptions options)
    public static Output<GetOkmsSecretResult> getOkmsSecret(GetOkmsSecretArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ovh:index/getOkmsSecret:getOkmsSecret
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OkmsId string
    Path string
    IncludeData bool
    Version double
    OkmsId string
    Path string
    IncludeData bool
    Version float64
    okmsId String
    path String
    includeData Boolean
    version Double
    okmsId string
    path string
    includeData boolean
    version number
    okmsId String
    path String
    includeData Boolean
    version Number

    getOkmsSecret Result

    The following output properties are available:

    Data string
    Iam GetOkmsSecretIam
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata GetOkmsSecretMetadata
    OkmsId string
    Path string
    Version double
    IncludeData bool
    Data string
    Iam GetOkmsSecretIam
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata GetOkmsSecretMetadata
    OkmsId string
    Path string
    Version float64
    IncludeData bool
    data String
    iam GetOkmsSecretIam
    id String
    The provider-assigned unique ID for this managed resource.
    metadata GetOkmsSecretMetadata
    okmsId String
    path String
    version Double
    includeData Boolean
    data string
    iam GetOkmsSecretIam
    id string
    The provider-assigned unique ID for this managed resource.
    metadata GetOkmsSecretMetadata
    okmsId string
    path string
    version number
    includeData boolean
    data str
    iam GetOkmsSecretIam
    id str
    The provider-assigned unique ID for this managed resource.
    metadata GetOkmsSecretMetadata
    okms_id str
    path str
    version float
    include_data bool
    data String
    iam Property Map
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Property Map
    okmsId String
    path String
    version Number
    includeData Boolean

    Supporting Types

    GetOkmsSecretIam

    DisplayName string
    Resource display name
    Id string
    Unique identifier of the resource
    Tags Dictionary<string, string>
    Resource tags. Tags that were internally computed are prefixed with ovh:
    Urn string
    Unique resource name used in policies
    DisplayName string
    Resource display name
    Id string
    Unique identifier of the resource
    Tags map[string]string
    Resource tags. Tags that were internally computed are prefixed with ovh:
    Urn string
    Unique resource name used in policies
    displayName String
    Resource display name
    id String
    Unique identifier of the resource
    tags Map<String,String>
    Resource tags. Tags that were internally computed are prefixed with ovh:
    urn String
    Unique resource name used in policies
    displayName string
    Resource display name
    id string
    Unique identifier of the resource
    tags {[key: string]: string}
    Resource tags. Tags that were internally computed are prefixed with ovh:
    urn string
    Unique resource name used in policies
    display_name str
    Resource display name
    id str
    Unique identifier of the resource
    tags Mapping[str, str]
    Resource tags. Tags that were internally computed are prefixed with ovh:
    urn str
    Unique resource name used in policies
    displayName String
    Resource display name
    id String
    Unique identifier of the resource
    tags Map<String>
    Resource tags. Tags that were internally computed are prefixed with ovh:
    urn String
    Unique resource name used in policies

    GetOkmsSecretMetadata

    CasRequired bool
    The “Cas” parameter will be required for each write request if set to true. When the “cas” (Check and set) is specified, the current version of the secret is verified before updating it.
    CreatedAt string
    Time of creation of the secret
    CurrentVersion double
    The secret version
    CustomMetadata Dictionary<string, string>
    Custom metadata
    DeactivateVersionAfter string
    Time duration before a version is deactivated
    MaxVersions double
    The number of versions to keep (10 default)
    OldestVersion double
    The secret oldest version
    UpdatedAt string
    Time of the last update of the secret
    CasRequired bool
    The “Cas” parameter will be required for each write request if set to true. When the “cas” (Check and set) is specified, the current version of the secret is verified before updating it.
    CreatedAt string
    Time of creation of the secret
    CurrentVersion float64
    The secret version
    CustomMetadata map[string]string
    Custom metadata
    DeactivateVersionAfter string
    Time duration before a version is deactivated
    MaxVersions float64
    The number of versions to keep (10 default)
    OldestVersion float64
    The secret oldest version
    UpdatedAt string
    Time of the last update of the secret
    casRequired Boolean
    The “Cas” parameter will be required for each write request if set to true. When the “cas” (Check and set) is specified, the current version of the secret is verified before updating it.
    createdAt String
    Time of creation of the secret
    currentVersion Double
    The secret version
    customMetadata Map<String,String>
    Custom metadata
    deactivateVersionAfter String
    Time duration before a version is deactivated
    maxVersions Double
    The number of versions to keep (10 default)
    oldestVersion Double
    The secret oldest version
    updatedAt String
    Time of the last update of the secret
    casRequired boolean
    The “Cas” parameter will be required for each write request if set to true. When the “cas” (Check and set) is specified, the current version of the secret is verified before updating it.
    createdAt string
    Time of creation of the secret
    currentVersion number
    The secret version
    customMetadata {[key: string]: string}
    Custom metadata
    deactivateVersionAfter string
    Time duration before a version is deactivated
    maxVersions number
    The number of versions to keep (10 default)
    oldestVersion number
    The secret oldest version
    updatedAt string
    Time of the last update of the secret
    cas_required bool
    The “Cas” parameter will be required for each write request if set to true. When the “cas” (Check and set) is specified, the current version of the secret is verified before updating it.
    created_at str
    Time of creation of the secret
    current_version float
    The secret version
    custom_metadata Mapping[str, str]
    Custom metadata
    deactivate_version_after str
    Time duration before a version is deactivated
    max_versions float
    The number of versions to keep (10 default)
    oldest_version float
    The secret oldest version
    updated_at str
    Time of the last update of the secret
    casRequired Boolean
    The “Cas” parameter will be required for each write request if set to true. When the “cas” (Check and set) is specified, the current version of the secret is verified before updating it.
    createdAt String
    Time of creation of the secret
    currentVersion Number
    The secret version
    customMetadata Map<String>
    Custom metadata
    deactivateVersionAfter String
    Time duration before a version is deactivated
    maxVersions Number
    The number of versions to keep (10 default)
    oldestVersion Number
    The secret oldest version
    updatedAt String
    Time of the last update of the secret

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v2.9.0 published on Friday, Nov 7, 2025 by OVHcloud
      Meet Neo: Your AI Platform Teammate