1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. getSecret
Control Plane v0.0.47 published on Saturday, Nov 9, 2024 by pulumiverse

cpln.getSecret

Explore with Pulumi AI

cpln logo
Control Plane v0.0.47 published on Saturday, Nov 9, 2024 by pulumiverse

    Use this data source to access information about a Secret within Control Plane.

    Required

    • name (String) Name of the secret.

    Outputs

    The following attributes are exported:

    • cpln_id (String) The ID, in GUID format, of the secret.
    • name (String) Name of the secret.
    • description (String) Description of the secret.
    • tags (Map of String) Key-value map of resource tags.
    • self_link (String) Full link to this resource. Can be referenced by other resources.
    • secret_link (String) Output used when linking a secret to an environment variable or volume, in the format: cpln://secret/SECRET_NAME.
    • dictionary_as_envs (Map of String) If a dictionary secret is defined, this output will be a key-value map in the following format: key = cpln://secret/SECRET_NAME.key.
    • aws (Block List, Max: 1) (see below) Reference Page.
    • azure_connector (Block List, Max: 1) (see below) Reference Page.
    • azure_sdk (String, Sensitive) JSON string containing the Docker secret. Reference Page.
    • dictionary (Map of String) List of unique key-value pairs. Reference Page.
    • docker (String, Sensitive) JSON string containing the Docker secret. Reference Page.
    • ecr (Block List, Max: 1) (see below).
    • gcp (String, Sensitive) JSON string containing the GCP secret. Reference Page
    • keypair (Block List, Max: 1) (see below) Reference Page.
    • nats_account (Block List, Max: 1) (see below) Reference Page.
    • opaque (Block List, Max: 1) (see below) Reference Page.
    • tls (Block List, Max: 1) (see below) Reference Page.
    • userpass (Block List, Max: 1) (see below) Reference Page.

    aws

    Optional:

    • access_key (String, Sensitive) Access Key provided by AWS.
    • role_arn (String) Role ARN provided by AWS.
    • secret_key (String, Sensitive) Secret Key provided by AWS.
    • external_id (String) AWS IAM Role External ID.

    azure_connector

    Optional:

    • code (String, Sensitive) Code/Key to authenticate to deployment URL.
    • url (String, Sensitive) Deployment URL.

    ecr

    Reference Page

    Optional:

    • access_key (String) Access Key provided by AWS.
    • repos (Set of String) List of ECR repositories.
    • role_arn (String) Role ARN provided by AWS.
    • secret_key (String, Sensitive) Secret Key provided by AWS.
    • external_id (String) AWS IAM Role External ID. Used when setting up cross-account access to your ECR repositories.

    keypair

    Optional:

    • passphrase (String, Sensitive) Passphrase for private key.
    • public_key (String) Public Key.
    • secret_key (String, Sensitive) Secret/Private Key.

    nats_account

    Required:

    • account_id (String) Account ID.
    • private_key (String) Private Key.

    opaque

    Optional:

    • encoding (String) Available encodings: plain, base64. Default: plain.
    • payload (String, Sensitive) Plain text or base64 encoded string. Use encoding attribute to specify encoding.

    tls

    Optional:

    • cert (String) Public Certificate.
    • chain (String) Chain Certificate.
    • key (String, Sensitive) Private Certificate.

    userpass

    Optional:

    • encoding (String) Available encodings: plain, base64. Default: plain.
    • password (String, Sensitive) Password.
    • username (String) Username.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cpln = Pulumi.Cpln;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Cpln.GetSecret.Invoke(new()
        {
            Name = "example-secret-opaque",
        });
    
        return new Dictionary<string, object?>
        {
            ["example-secret-payload"] = example.Apply(getSecretResult => getSecretResult.Opaque?.Payload),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cpln.LookupSecret(ctx, &cpln.LookupSecretArgs{
    			Name: "example-secret-opaque",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("example-secret-payload", example.Opaque.Payload)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cpln.CplnFunctions;
    import com.pulumi.cpln.inputs.GetSecretArgs;
    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 example = CplnFunctions.getSecret(GetSecretArgs.builder()
                .name("example-secret-opaque")
                .build());
    
            ctx.export("example-secret-payload", example.applyValue(getSecretResult -> getSecretResult.opaque().payload()));
        }
    }
    
    import pulumi
    import pulumi_cpln as cpln
    
    example = cpln.get_secret(name="example-secret-opaque")
    pulumi.export("example-secret-payload", example.opaque.payload)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cpln from "@pulumi/cpln";
    
    export = async () => {
        const example = await cpln.getSecret({
            name: "example-secret-opaque",
        });
        return {
            "example-secret-payload": example.opaque?.payload,
        };
    }
    
    variables:
      example:
        fn::invoke:
          Function: cpln:getSecret
          Arguments:
            name: example-secret-opaque
    outputs:
      example-secret-payload: ${example.opaque.payload}
    

    Using getSecret

    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 getSecret(args: GetSecretArgs, opts?: InvokeOptions): Promise<GetSecretResult>
    function getSecretOutput(args: GetSecretOutputArgs, opts?: InvokeOptions): Output<GetSecretResult>
    def get_secret(aws: Optional[GetSecretAws] = None,
                   azure_connector: Optional[GetSecretAzureConnector] = None,
                   azure_sdk: Optional[str] = None,
                   description: Optional[str] = None,
                   dictionary: Optional[Mapping[str, str]] = None,
                   docker: Optional[str] = None,
                   ecr: Optional[GetSecretEcr] = None,
                   gcp: Optional[str] = None,
                   keypair: Optional[GetSecretKeypair] = None,
                   name: Optional[str] = None,
                   nats_account: Optional[GetSecretNatsAccount] = None,
                   opaque: Optional[GetSecretOpaque] = None,
                   tags: Optional[Mapping[str, str]] = None,
                   tls: Optional[GetSecretTls] = None,
                   userpass: Optional[GetSecretUserpass] = None,
                   opts: Optional[InvokeOptions] = None) -> GetSecretResult
    def get_secret_output(aws: Optional[pulumi.Input[GetSecretAwsArgs]] = None,
                   azure_connector: Optional[pulumi.Input[GetSecretAzureConnectorArgs]] = None,
                   azure_sdk: Optional[pulumi.Input[str]] = None,
                   description: Optional[pulumi.Input[str]] = None,
                   dictionary: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                   docker: Optional[pulumi.Input[str]] = None,
                   ecr: Optional[pulumi.Input[GetSecretEcrArgs]] = None,
                   gcp: Optional[pulumi.Input[str]] = None,
                   keypair: Optional[pulumi.Input[GetSecretKeypairArgs]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   nats_account: Optional[pulumi.Input[GetSecretNatsAccountArgs]] = None,
                   opaque: Optional[pulumi.Input[GetSecretOpaqueArgs]] = None,
                   tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                   tls: Optional[pulumi.Input[GetSecretTlsArgs]] = None,
                   userpass: Optional[pulumi.Input[GetSecretUserpassArgs]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetSecretResult]
    func LookupSecret(ctx *Context, args *LookupSecretArgs, opts ...InvokeOption) (*LookupSecretResult, error)
    func LookupSecretOutput(ctx *Context, args *LookupSecretOutputArgs, opts ...InvokeOption) LookupSecretResultOutput

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

    public static class GetSecret 
    {
        public static Task<GetSecretResult> InvokeAsync(GetSecretArgs args, InvokeOptions? opts = null)
        public static Output<GetSecretResult> Invoke(GetSecretInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecretResult> getSecret(GetSecretArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cpln:index/getSecret:getSecret
      arguments:
        # arguments dictionary

    The following arguments are supported:

    getSecret Result

    The following output properties are available:

    CplnId string
    DictionaryAsEnvs map[string]interface{}
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    SecretLink string
    SelfLink string
    Aws GetSecretAws
    AzureConnector GetSecretAzureConnector
    AzureSdk string
    Description string
    Dictionary map[string]string
    Docker string
    Ecr GetSecretEcr
    Gcp string
    Keypair GetSecretKeypair
    NatsAccount GetSecretNatsAccount
    Opaque GetSecretOpaque
    Tags map[string]string
    Tls GetSecretTls
    Userpass GetSecretUserpass
    cplnId String
    dictionaryAsEnvs Map<String,Object>
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    secretLink String
    selfLink String
    aws GetSecretAws
    azureConnector GetSecretAzureConnector
    azureSdk String
    description String
    dictionary Map<String,String>
    docker String
    ecr GetSecretEcr
    gcp String
    keypair GetSecretKeypair
    natsAccount GetSecretNatsAccount
    opaque GetSecretOpaque
    tags Map<String,String>
    tls GetSecretTls
    userpass GetSecretUserpass
    cplnId string
    dictionaryAsEnvs {[key: string]: any}
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    secretLink string
    selfLink string
    aws GetSecretAws
    azureConnector GetSecretAzureConnector
    azureSdk string
    description string
    dictionary {[key: string]: string}
    docker string
    ecr GetSecretEcr
    gcp string
    keypair GetSecretKeypair
    natsAccount GetSecretNatsAccount
    opaque GetSecretOpaque
    tags {[key: string]: string}
    tls GetSecretTls
    userpass GetSecretUserpass
    cplnId String
    dictionaryAsEnvs Map<Any>
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    secretLink String
    selfLink String
    aws Property Map
    azureConnector Property Map
    azureSdk String
    description String
    dictionary Map<String>
    docker String
    ecr Property Map
    gcp String
    keypair Property Map
    natsAccount Property Map
    opaque Property Map
    tags Map<String>
    tls Property Map
    userpass Property Map

    Supporting Types

    GetSecretAws

    AccessKey string
    SecretKey string
    ExternalId string
    RoleArn string
    AccessKey string
    SecretKey string
    ExternalId string
    RoleArn string
    accessKey String
    secretKey String
    externalId String
    roleArn String
    accessKey string
    secretKey string
    externalId string
    roleArn string
    accessKey String
    secretKey String
    externalId String
    roleArn String

    GetSecretAzureConnector

    Code string
    Url string
    Code string
    Url string
    code String
    url String
    code string
    url string
    code str
    url str
    code String
    url String

    GetSecretEcr

    AccessKey string
    Repos List<string>
    SecretKey string
    ExternalId string
    RoleArn string
    AccessKey string
    Repos []string
    SecretKey string
    ExternalId string
    RoleArn string
    accessKey String
    repos List<String>
    secretKey String
    externalId String
    roleArn String
    accessKey string
    repos string[]
    secretKey string
    externalId string
    roleArn string
    access_key str
    repos Sequence[str]
    secret_key str
    external_id str
    role_arn str
    accessKey String
    repos List<String>
    secretKey String
    externalId String
    roleArn String

    GetSecretKeypair

    SecretKey string
    Passphrase string
    PublicKey string
    SecretKey string
    Passphrase string
    PublicKey string
    secretKey String
    passphrase String
    publicKey String
    secretKey string
    passphrase string
    publicKey string
    secretKey String
    passphrase String
    publicKey String

    GetSecretNatsAccount

    AccountId string
    PrivateKey string
    AccountId string
    PrivateKey string
    accountId String
    privateKey String
    accountId string
    privateKey string
    accountId String
    privateKey String

    GetSecretOpaque

    Payload string
    Encoding string
    Payload string
    Encoding string
    payload String
    encoding String
    payload string
    encoding string
    payload String
    encoding String

    GetSecretTls

    Cert string
    Key string
    Chain string
    Cert string
    Key string
    Chain string
    cert String
    key String
    chain String
    cert string
    key string
    chain string
    cert str
    key str
    chain str
    cert String
    key String
    chain String

    GetSecretUserpass

    Password string
    Username string
    Encoding string
    Password string
    Username string
    Encoding string
    password String
    username String
    encoding String
    password string
    username string
    encoding string
    password String
    username String
    encoding String

    Package Details

    Repository
    cpln pulumiverse/pulumi-cpln
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cpln Terraform Provider.
    cpln logo
    Control Plane v0.0.47 published on Saturday, Nov 9, 2024 by pulumiverse