1. Packages
  2. Scaleway
  3. API Docs
  4. getSecret
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

scaleway.getSecret

Explore with Pulumi AI

scaleway logo
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

    Gets information about Scaleway Secrets. For more information, see the documentation.

    Examples

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = new scaleway.Secret("main", {description: "barr"});
    const mySecret = scaleway.getSecret({
        secretId: "11111111-1111-1111-1111-111111111111",
    });
    const byName = scaleway.getSecret({
        name: "your_secret_name",
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.Secret("main", description="barr")
    my_secret = scaleway.get_secret(secret_id="11111111-1111-1111-1111-111111111111")
    by_name = scaleway.get_secret(name="your_secret_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.NewSecret(ctx, "main", &scaleway.SecretArgs{
    			Description: pulumi.String("barr"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupSecret(ctx, &scaleway.LookupSecretArgs{
    			SecretId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupSecret(ctx, &scaleway.LookupSecretArgs{
    			Name: pulumi.StringRef("your_secret_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.Secret("main", new()
        {
            Description = "barr",
        });
    
        var mySecret = Scaleway.GetSecret.Invoke(new()
        {
            SecretId = "11111111-1111-1111-1111-111111111111",
        });
    
        var byName = Scaleway.GetSecret.Invoke(new()
        {
            Name = "your_secret_name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.Secret;
    import com.pulumi.scaleway.SecretArgs;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.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) {
            var main = new Secret("main", SecretArgs.builder()        
                .description("barr")
                .build());
    
            final var mySecret = ScalewayFunctions.getSecret(GetSecretArgs.builder()
                .secretId("11111111-1111-1111-1111-111111111111")
                .build());
    
            final var byName = ScalewayFunctions.getSecret(GetSecretArgs.builder()
                .name("your_secret_name")
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:Secret
        properties:
          description: barr
    variables:
      mySecret:
        fn::invoke:
          Function: scaleway:getSecret
          Arguments:
            secretId: 11111111-1111-1111-1111-111111111111
      byName:
        fn::invoke:
          Function: scaleway:getSecret
          Arguments:
            name: your_secret_name
    

    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(name: Optional[str] = None,
                   organization_id: Optional[str] = None,
                   path: Optional[str] = None,
                   project_id: Optional[str] = None,
                   region: Optional[str] = None,
                   secret_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetSecretResult
    def get_secret_output(name: Optional[pulumi.Input[str]] = None,
                   organization_id: Optional[pulumi.Input[str]] = None,
                   path: Optional[pulumi.Input[str]] = None,
                   project_id: Optional[pulumi.Input[str]] = None,
                   region: Optional[pulumi.Input[str]] = None,
                   secret_id: Optional[pulumi.Input[str]] = 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: scaleway:index/getSecret:getSecret
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The secret name. Only one of name and secret_id should be specified.
    OrganizationId string
    The organization ID the Project is associated with. If no default organization_id is set, one must be set explicitly in this datasource
    Path string
    The secret path. Conflicts with secret_id.
    ProjectId string
    project_id) The ID of the project the secret is associated with.
    Region string
    region) The region in which the secret exists.
    SecretId string
    The secret id. Only one of name and secret_id should be specified.
    Name string
    The secret name. Only one of name and secret_id should be specified.
    OrganizationId string
    The organization ID the Project is associated with. If no default organization_id is set, one must be set explicitly in this datasource
    Path string
    The secret path. Conflicts with secret_id.
    ProjectId string
    project_id) The ID of the project the secret is associated with.
    Region string
    region) The region in which the secret exists.
    SecretId string
    The secret id. Only one of name and secret_id should be specified.
    name String
    The secret name. Only one of name and secret_id should be specified.
    organizationId String
    The organization ID the Project is associated with. If no default organization_id is set, one must be set explicitly in this datasource
    path String
    The secret path. Conflicts with secret_id.
    projectId String
    project_id) The ID of the project the secret is associated with.
    region String
    region) The region in which the secret exists.
    secretId String
    The secret id. Only one of name and secret_id should be specified.
    name string
    The secret name. Only one of name and secret_id should be specified.
    organizationId string
    The organization ID the Project is associated with. If no default organization_id is set, one must be set explicitly in this datasource
    path string
    The secret path. Conflicts with secret_id.
    projectId string
    project_id) The ID of the project the secret is associated with.
    region string
    region) The region in which the secret exists.
    secretId string
    The secret id. Only one of name and secret_id should be specified.
    name str
    The secret name. Only one of name and secret_id should be specified.
    organization_id str
    The organization ID the Project is associated with. If no default organization_id is set, one must be set explicitly in this datasource
    path str
    The secret path. Conflicts with secret_id.
    project_id str
    project_id) The ID of the project the secret is associated with.
    region str
    region) The region in which the secret exists.
    secret_id str
    The secret id. Only one of name and secret_id should be specified.
    name String
    The secret name. Only one of name and secret_id should be specified.
    organizationId String
    The organization ID the Project is associated with. If no default organization_id is set, one must be set explicitly in this datasource
    path String
    The secret path. Conflicts with secret_id.
    projectId String
    project_id) The ID of the project the secret is associated with.
    region String
    region) The region in which the secret exists.
    secretId String
    The secret id. Only one of name and secret_id should be specified.

    getSecret Result

    The following output properties are available:

    CreatedAt string
    Description string
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    Status string
    Tags List<string>
    UpdatedAt string
    VersionCount int
    Name string
    Path string
    ProjectId string
    Region string
    SecretId string
    CreatedAt string
    Description string
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    Status string
    Tags []string
    UpdatedAt string
    VersionCount int
    Name string
    Path string
    ProjectId string
    Region string
    SecretId string
    createdAt String
    description String
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    status String
    tags List<String>
    updatedAt String
    versionCount Integer
    name String
    path String
    projectId String
    region String
    secretId String
    createdAt string
    description string
    id string
    The provider-assigned unique ID for this managed resource.
    organizationId string
    status string
    tags string[]
    updatedAt string
    versionCount number
    name string
    path string
    projectId string
    region string
    secretId string
    created_at str
    description str
    id str
    The provider-assigned unique ID for this managed resource.
    organization_id str
    status str
    tags Sequence[str]
    updated_at str
    version_count int
    name str
    path str
    project_id str
    region str
    secret_id str
    createdAt String
    description String
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    status String
    tags List<String>
    updatedAt String
    versionCount Number
    name String
    path String
    projectId String
    region String
    secretId String

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse