1. Packages
  2. Akeyless Provider
  3. API Docs
  4. getStaticSecret
akeyless 1.10.0 published on Sunday, Jun 8, 2025 by akeyless-community

akeyless.getStaticSecret

Explore with Pulumi AI

akeyless logo
akeyless 1.10.0 published on Sunday, Jun 8, 2025 by akeyless-community

    Static secret data source

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as akeyless from "@pulumi/akeyless";
    
    const secret = akeyless.getStaticSecret({
        path: "terraform/MyFirstSecret",
    });
    
    import pulumi
    import pulumi_akeyless as akeyless
    
    secret = akeyless.get_static_secret(path="terraform/MyFirstSecret")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/akeyless/akeyless"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := akeyless.LookupStaticSecret(ctx, &akeyless.LookupStaticSecretArgs{
    			Path: "terraform/MyFirstSecret",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Akeyless = Pulumi.Akeyless;
    
    return await Deployment.RunAsync(() => 
    {
        var secret = Akeyless.GetStaticSecret.Invoke(new()
        {
            Path = "terraform/MyFirstSecret",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.akeyless.AkeylessFunctions;
    import com.pulumi.akeyless.inputs.GetStaticSecretArgs;
    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 secret = AkeylessFunctions.getStaticSecret(GetStaticSecretArgs.builder()
                .path("terraform/MyFirstSecret")
                .build());
    
        }
    }
    
    variables:
      secret:
        fn::invoke:
          function: akeyless:getStaticSecret
          arguments:
            path: terraform/MyFirstSecret
    

    Using getStaticSecret

    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 getStaticSecret(args: GetStaticSecretArgs, opts?: InvokeOptions): Promise<GetStaticSecretResult>
    function getStaticSecretOutput(args: GetStaticSecretOutputArgs, opts?: InvokeOptions): Output<GetStaticSecretResult>
    def get_static_secret(id: Optional[str] = None,
                          path: Optional[str] = None,
                          version: Optional[float] = None,
                          opts: Optional[InvokeOptions] = None) -> GetStaticSecretResult
    def get_static_secret_output(id: Optional[pulumi.Input[str]] = None,
                          path: Optional[pulumi.Input[str]] = None,
                          version: Optional[pulumi.Input[float]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetStaticSecretResult]
    func LookupStaticSecret(ctx *Context, args *LookupStaticSecretArgs, opts ...InvokeOption) (*LookupStaticSecretResult, error)
    func LookupStaticSecretOutput(ctx *Context, args *LookupStaticSecretOutputArgs, opts ...InvokeOption) LookupStaticSecretResultOutput

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

    public static class GetStaticSecret 
    {
        public static Task<GetStaticSecretResult> InvokeAsync(GetStaticSecretArgs args, InvokeOptions? opts = null)
        public static Output<GetStaticSecretResult> Invoke(GetStaticSecretInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStaticSecretResult> getStaticSecret(GetStaticSecretArgs args, InvokeOptions options)
    public static Output<GetStaticSecretResult> getStaticSecret(GetStaticSecretArgs args, InvokeOptions options)
    
    fn::invoke:
      function: akeyless:index/getStaticSecret:getStaticSecret
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Path string
    The path where the secret is stored. Defaults to the latest version.
    Id string
    The ID of this resource.
    Version double
    The version of the secret.
    Path string
    The path where the secret is stored. Defaults to the latest version.
    Id string
    The ID of this resource.
    Version float64
    The version of the secret.
    path String
    The path where the secret is stored. Defaults to the latest version.
    id String
    The ID of this resource.
    version Double
    The version of the secret.
    path string
    The path where the secret is stored. Defaults to the latest version.
    id string
    The ID of this resource.
    version number
    The version of the secret.
    path str
    The path where the secret is stored. Defaults to the latest version.
    id str
    The ID of this resource.
    version float
    The version of the secret.
    path String
    The path where the secret is stored. Defaults to the latest version.
    id String
    The ID of this resource.
    version Number
    The version of the secret.

    getStaticSecret Result

    The following output properties are available:

    CustomField Dictionary<string, string>
    Additional custom fields to associate with the item (e.g fieldName1=value1) (relevant only for type 'password')
    Id string
    The ID of this resource.
    InjectUrls List<string>
    List of URLs associated with the item (relevant only for type 'password')
    KeyValuePairs Dictionary<string, string>
    The key value pairs for key/value secrets.
    Password string
    Password value (relevant only for type 'password')
    Path string
    The path where the secret is stored. Defaults to the latest version.
    Username string
    Username value (relevant only for type 'password')
    Value string
    The secret contents.
    Version double
    The version of the secret.
    CustomField map[string]string
    Additional custom fields to associate with the item (e.g fieldName1=value1) (relevant only for type 'password')
    Id string
    The ID of this resource.
    InjectUrls []string
    List of URLs associated with the item (relevant only for type 'password')
    KeyValuePairs map[string]string
    The key value pairs for key/value secrets.
    Password string
    Password value (relevant only for type 'password')
    Path string
    The path where the secret is stored. Defaults to the latest version.
    Username string
    Username value (relevant only for type 'password')
    Value string
    The secret contents.
    Version float64
    The version of the secret.
    customField Map<String,String>
    Additional custom fields to associate with the item (e.g fieldName1=value1) (relevant only for type 'password')
    id String
    The ID of this resource.
    injectUrls List<String>
    List of URLs associated with the item (relevant only for type 'password')
    keyValuePairs Map<String,String>
    The key value pairs for key/value secrets.
    password String
    Password value (relevant only for type 'password')
    path String
    The path where the secret is stored. Defaults to the latest version.
    username String
    Username value (relevant only for type 'password')
    value String
    The secret contents.
    version Double
    The version of the secret.
    customField {[key: string]: string}
    Additional custom fields to associate with the item (e.g fieldName1=value1) (relevant only for type 'password')
    id string
    The ID of this resource.
    injectUrls string[]
    List of URLs associated with the item (relevant only for type 'password')
    keyValuePairs {[key: string]: string}
    The key value pairs for key/value secrets.
    password string
    Password value (relevant only for type 'password')
    path string
    The path where the secret is stored. Defaults to the latest version.
    username string
    Username value (relevant only for type 'password')
    value string
    The secret contents.
    version number
    The version of the secret.
    custom_field Mapping[str, str]
    Additional custom fields to associate with the item (e.g fieldName1=value1) (relevant only for type 'password')
    id str
    The ID of this resource.
    inject_urls Sequence[str]
    List of URLs associated with the item (relevant only for type 'password')
    key_value_pairs Mapping[str, str]
    The key value pairs for key/value secrets.
    password str
    Password value (relevant only for type 'password')
    path str
    The path where the secret is stored. Defaults to the latest version.
    username str
    Username value (relevant only for type 'password')
    value str
    The secret contents.
    version float
    The version of the secret.
    customField Map<String>
    Additional custom fields to associate with the item (e.g fieldName1=value1) (relevant only for type 'password')
    id String
    The ID of this resource.
    injectUrls List<String>
    List of URLs associated with the item (relevant only for type 'password')
    keyValuePairs Map<String>
    The key value pairs for key/value secrets.
    password String
    Password value (relevant only for type 'password')
    path String
    The path where the secret is stored. Defaults to the latest version.
    username String
    Username value (relevant only for type 'password')
    value String
    The secret contents.
    version Number
    The version of the secret.

    Package Details

    Repository
    akeyless akeyless-community/terraform-provider-akeyless
    License
    Notes
    This Pulumi package is based on the akeyless Terraform Provider.
    akeyless logo
    akeyless 1.10.0 published on Sunday, Jun 8, 2025 by akeyless-community