1. Packages
  2. Akeyless Provider
  3. API Docs
  4. getStaticSecret
akeyless 1.9.0 published on Monday, Apr 14, 2025 by akeyless-community

akeyless.getStaticSecret

Explore with Pulumi AI

akeyless logo
akeyless 1.9.0 published on Monday, Apr 14, 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:

    Id string
    The ID of this resource.
    Path string
    The path where the secret is stored. Defaults to the latest version.
    Value string
    The secret contents.
    Version double
    The version of the secret.
    Id string
    The ID of this resource.
    Path string
    The path where the secret is stored. Defaults to the latest version.
    Value string
    The secret contents.
    Version float64
    The version of the secret.
    id String
    The ID of this resource.
    path String
    The path where the secret is stored. Defaults to the latest version.
    value String
    The secret contents.
    version Double
    The version of the secret.
    id string
    The ID of this resource.
    path string
    The path where the secret is stored. Defaults to the latest version.
    value string
    The secret contents.
    version number
    The version of the secret.
    id str
    The ID of this resource.
    path str
    The path where the secret is stored. Defaults to the latest version.
    value str
    The secret contents.
    version float
    The version of the secret.
    id String
    The ID of this resource.
    path String
    The path where the secret is stored. Defaults to the latest version.
    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.9.0 published on Monday, Apr 14, 2025 by akeyless-community