1. Packages
  2. Ibm Provider
  3. API Docs
  4. getSmUsernamePasswordSecret
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getSmUsernamePasswordSecret

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a read-only data source for UsernamePasswordSecret. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. The data source can be defined by providing the secret ID or the secret and secret group names.

    Example Usage

    By secret id

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const usernamePasswordSecret = ibm.getSmUsernamePasswordSecret({
        instanceId: ibm_resource_instance.sm_instance.guid,
        region: "us-south",
        secretId: "0b5571f7-21e6-42b7-91c5-3f5ac9793a46",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    username_password_secret = ibm.get_sm_username_password_secret(instance_id=ibm_resource_instance["sm_instance"]["guid"],
        region="us-south",
        secret_id="0b5571f7-21e6-42b7-91c5-3f5ac9793a46")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupSmUsernamePasswordSecret(ctx, &ibm.LookupSmUsernamePasswordSecretArgs{
    			InstanceId: ibm_resource_instance.Sm_instance.Guid,
    			Region:     pulumi.StringRef("us-south"),
    			SecretId:   pulumi.StringRef("0b5571f7-21e6-42b7-91c5-3f5ac9793a46"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var usernamePasswordSecret = Ibm.GetSmUsernamePasswordSecret.Invoke(new()
        {
            InstanceId = ibm_resource_instance.Sm_instance.Guid,
            Region = "us-south",
            SecretId = "0b5571f7-21e6-42b7-91c5-3f5ac9793a46",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetSmUsernamePasswordSecretArgs;
    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 usernamePasswordSecret = IbmFunctions.getSmUsernamePasswordSecret(GetSmUsernamePasswordSecretArgs.builder()
                .instanceId(ibm_resource_instance.sm_instance().guid())
                .region("us-south")
                .secretId("0b5571f7-21e6-42b7-91c5-3f5ac9793a46")
                .build());
    
        }
    }
    
    variables:
      usernamePasswordSecret:
        fn::invoke:
          function: ibm:getSmUsernamePasswordSecret
          arguments:
            instanceId: ${ibm_resource_instance.sm_instance.guid}
            region: us-south
            secretId: 0b5571f7-21e6-42b7-91c5-3f5ac9793a46
    

    By secret name and group name

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const usernamePasswordSecret = ibm.getSmUsernamePasswordSecret({
        instanceId: ibm_resource_instance.sm_instance.guid,
        region: "us-south",
        name: "secret-name",
        secretGroupName: "group-name",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    username_password_secret = ibm.get_sm_username_password_secret(instance_id=ibm_resource_instance["sm_instance"]["guid"],
        region="us-south",
        name="secret-name",
        secret_group_name="group-name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupSmUsernamePasswordSecret(ctx, &ibm.LookupSmUsernamePasswordSecretArgs{
    			InstanceId:      ibm_resource_instance.Sm_instance.Guid,
    			Region:          pulumi.StringRef("us-south"),
    			Name:            pulumi.StringRef("secret-name"),
    			SecretGroupName: pulumi.StringRef("group-name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var usernamePasswordSecret = Ibm.GetSmUsernamePasswordSecret.Invoke(new()
        {
            InstanceId = ibm_resource_instance.Sm_instance.Guid,
            Region = "us-south",
            Name = "secret-name",
            SecretGroupName = "group-name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetSmUsernamePasswordSecretArgs;
    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 usernamePasswordSecret = IbmFunctions.getSmUsernamePasswordSecret(GetSmUsernamePasswordSecretArgs.builder()
                .instanceId(ibm_resource_instance.sm_instance().guid())
                .region("us-south")
                .name("secret-name")
                .secretGroupName("group-name")
                .build());
    
        }
    }
    
    variables:
      usernamePasswordSecret:
        fn::invoke:
          function: ibm:getSmUsernamePasswordSecret
          arguments:
            instanceId: ${ibm_resource_instance.sm_instance.guid}
            region: us-south
            name: secret-name
            secretGroupName: group-name
    

    Using getSmUsernamePasswordSecret

    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 getSmUsernamePasswordSecret(args: GetSmUsernamePasswordSecretArgs, opts?: InvokeOptions): Promise<GetSmUsernamePasswordSecretResult>
    function getSmUsernamePasswordSecretOutput(args: GetSmUsernamePasswordSecretOutputArgs, opts?: InvokeOptions): Output<GetSmUsernamePasswordSecretResult>
    def get_sm_username_password_secret(endpoint_type: Optional[str] = None,
                                        id: Optional[str] = None,
                                        instance_id: Optional[str] = None,
                                        name: Optional[str] = None,
                                        region: Optional[str] = None,
                                        secret_group_name: Optional[str] = None,
                                        secret_id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetSmUsernamePasswordSecretResult
    def get_sm_username_password_secret_output(endpoint_type: Optional[pulumi.Input[str]] = None,
                                        id: Optional[pulumi.Input[str]] = None,
                                        instance_id: Optional[pulumi.Input[str]] = None,
                                        name: Optional[pulumi.Input[str]] = None,
                                        region: Optional[pulumi.Input[str]] = None,
                                        secret_group_name: Optional[pulumi.Input[str]] = None,
                                        secret_id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetSmUsernamePasswordSecretResult]
    func LookupSmUsernamePasswordSecret(ctx *Context, args *LookupSmUsernamePasswordSecretArgs, opts ...InvokeOption) (*LookupSmUsernamePasswordSecretResult, error)
    func LookupSmUsernamePasswordSecretOutput(ctx *Context, args *LookupSmUsernamePasswordSecretOutputArgs, opts ...InvokeOption) LookupSmUsernamePasswordSecretResultOutput

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

    public static class GetSmUsernamePasswordSecret 
    {
        public static Task<GetSmUsernamePasswordSecretResult> InvokeAsync(GetSmUsernamePasswordSecretArgs args, InvokeOptions? opts = null)
        public static Output<GetSmUsernamePasswordSecretResult> Invoke(GetSmUsernamePasswordSecretInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSmUsernamePasswordSecretResult> getSmUsernamePasswordSecret(GetSmUsernamePasswordSecretArgs args, InvokeOptions options)
    public static Output<GetSmUsernamePasswordSecretResult> getSmUsernamePasswordSecret(GetSmUsernamePasswordSecretArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getSmUsernamePasswordSecret:getSmUsernamePasswordSecret
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The GUID of the Secrets Manager instance.
    EndpointType string
    The endpoint type. If not provided the endpoint type is determined by the visibility argument provided in the provider configuration.

    • Constraints: Allowable values are: private, public.
    Id string
    The unique identifier of the UsernamePasswordSecret.
    Name string
    The human-readable name of your secret. To be used in combination with secret_group_name.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters. The value must match regular expression ^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$.
    Region string
    The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration.
    SecretGroupName string
    The name of your existing secret group. To be used in combination with name.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /(.*?)/.
    SecretId string
    The ID of the secret.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.
    InstanceId string
    The GUID of the Secrets Manager instance.
    EndpointType string
    The endpoint type. If not provided the endpoint type is determined by the visibility argument provided in the provider configuration.

    • Constraints: Allowable values are: private, public.
    Id string
    The unique identifier of the UsernamePasswordSecret.
    Name string
    The human-readable name of your secret. To be used in combination with secret_group_name.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters. The value must match regular expression ^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$.
    Region string
    The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration.
    SecretGroupName string
    The name of your existing secret group. To be used in combination with name.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /(.*?)/.
    SecretId string
    The ID of the secret.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.
    instanceId String
    The GUID of the Secrets Manager instance.
    endpointType String
    The endpoint type. If not provided the endpoint type is determined by the visibility argument provided in the provider configuration.

    • Constraints: Allowable values are: private, public.
    id String
    The unique identifier of the UsernamePasswordSecret.
    name String
    The human-readable name of your secret. To be used in combination with secret_group_name.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters. The value must match regular expression ^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$.
    region String
    The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration.
    secretGroupName String
    The name of your existing secret group. To be used in combination with name.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /(.*?)/.
    secretId String
    The ID of the secret.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.
    instanceId string
    The GUID of the Secrets Manager instance.
    endpointType string
    The endpoint type. If not provided the endpoint type is determined by the visibility argument provided in the provider configuration.

    • Constraints: Allowable values are: private, public.
    id string
    The unique identifier of the UsernamePasswordSecret.
    name string
    The human-readable name of your secret. To be used in combination with secret_group_name.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters. The value must match regular expression ^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$.
    region string
    The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration.
    secretGroupName string
    The name of your existing secret group. To be used in combination with name.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /(.*?)/.
    secretId string
    The ID of the secret.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.
    instance_id str
    The GUID of the Secrets Manager instance.
    endpoint_type str
    The endpoint type. If not provided the endpoint type is determined by the visibility argument provided in the provider configuration.

    • Constraints: Allowable values are: private, public.
    id str
    The unique identifier of the UsernamePasswordSecret.
    name str
    The human-readable name of your secret. To be used in combination with secret_group_name.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters. The value must match regular expression ^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$.
    region str
    The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration.
    secret_group_name str
    The name of your existing secret group. To be used in combination with name.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /(.*?)/.
    secret_id str
    The ID of the secret.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.
    instanceId String
    The GUID of the Secrets Manager instance.
    endpointType String
    The endpoint type. If not provided the endpoint type is determined by the visibility argument provided in the provider configuration.

    • Constraints: Allowable values are: private, public.
    id String
    The unique identifier of the UsernamePasswordSecret.
    name String
    The human-readable name of your secret. To be used in combination with secret_group_name.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters. The value must match regular expression ^[A-Za-z0-9][A-Za-z0-9]*(?:_*-*\\.*[A-Za-z0-9]+)*$.
    region String
    The region of the Secrets Manager instance. If not provided defaults to the region defined in the IBM provider configuration.
    secretGroupName String
    The name of your existing secret group. To be used in combination with name.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /(.*?)/.
    secretId String
    The ID of the secret.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.

    getSmUsernamePasswordSecret Result

    The following output properties are available:

    CreatedAt string
    (String) The date when a resource was created. The date format follows RFC 3339.
    CreatedBy string
    (String) The unique identifier that is associated with the entity that created the secret.

    • Constraints: The maximum length is 128 characters. The minimum length is 4 characters.
    Crn string
    (String) A CRN that uniquely identifies an IBM Cloud resource.

    • Constraints: The maximum length is 512 characters. The minimum length is 9 characters. The value must match regular expression /^crn:v0-9*+,;=@\/]|%[0-9A-Z]{2})*){8}$/.
    CustomMetadata Dictionary<string, string>
    (Map) The secret metadata that a user can customize.
    Description string
    (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

    • Constraints: The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.*?)/.
    Downloaded bool
    (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.
    ExpirationDate string
    (String) The date a secret is expired. The date format follows RFC 3339.
    Id string
    The unique identifier of the UsernamePasswordSecret.
    InstanceId string
    Labels List<string>
    (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.

    • Constraints: The list items must match regular expression /(.*?)/. The maximum length is 30 items. The minimum length is 0 items.
    LocksTotal double
    (Integer) The number of locks of the secret.

    • Constraints: The maximum value is 1000. The minimum value is 0.
    Name string
    (String) The human-readable name of your secret.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters.
    NextRotationDate string
    (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.
    Password string
    (String) The password that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 6 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    PasswordGenerationPolicies List<GetSmUsernamePasswordSecretPasswordGenerationPolicy>
    (List) Policy for auto-generated passwords. Nested scheme for password_generation_policy:
    Region string
    Rotations List<GetSmUsernamePasswordSecretRotation>
    (List) Determines whether Secrets Manager rotates your secrets automatically. Nested scheme for rotation:
    SecretGroupId string
    (String) A UUID identifier, or default secret group.

    • Constraints: The maximum length is 36 characters. The minimum length is 7 characters. The value must match regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/.
    SecretId string
    SecretType string
    (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.

    • Constraints: Allowable values are: arbitrary, imported_cert, public_cert, iam_credentials, kv, username_password, private_cert.
    State double
    (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.

    • Constraints: Allowable values are: 0, 1, 2, 3, 5.
    StateDescription string
    (String) A text representation of the secret state.

    • Constraints: Allowable values are: pre_activation, active, suspended, deactivated, destroyed.
    UpdatedAt string
    (String) The date when a resource was recently modified. The date format follows RFC 3339.
    Username string
    (String) The username that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    VersionsTotal double
    (Integer) The number of versions of the secret.

    • Constraints: The maximum value is 50. The minimum value is 0.
    EndpointType string
    SecretGroupName string
    CreatedAt string
    (String) The date when a resource was created. The date format follows RFC 3339.
    CreatedBy string
    (String) The unique identifier that is associated with the entity that created the secret.

    • Constraints: The maximum length is 128 characters. The minimum length is 4 characters.
    Crn string
    (String) A CRN that uniquely identifies an IBM Cloud resource.

    • Constraints: The maximum length is 512 characters. The minimum length is 9 characters. The value must match regular expression /^crn:v0-9*+,;=@\/]|%[0-9A-Z]{2})*){8}$/.
    CustomMetadata map[string]string
    (Map) The secret metadata that a user can customize.
    Description string
    (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

    • Constraints: The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.*?)/.
    Downloaded bool
    (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.
    ExpirationDate string
    (String) The date a secret is expired. The date format follows RFC 3339.
    Id string
    The unique identifier of the UsernamePasswordSecret.
    InstanceId string
    Labels []string
    (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.

    • Constraints: The list items must match regular expression /(.*?)/. The maximum length is 30 items. The minimum length is 0 items.
    LocksTotal float64
    (Integer) The number of locks of the secret.

    • Constraints: The maximum value is 1000. The minimum value is 0.
    Name string
    (String) The human-readable name of your secret.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters.
    NextRotationDate string
    (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.
    Password string
    (String) The password that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 6 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    PasswordGenerationPolicies []GetSmUsernamePasswordSecretPasswordGenerationPolicy
    (List) Policy for auto-generated passwords. Nested scheme for password_generation_policy:
    Region string
    Rotations []GetSmUsernamePasswordSecretRotation
    (List) Determines whether Secrets Manager rotates your secrets automatically. Nested scheme for rotation:
    SecretGroupId string
    (String) A UUID identifier, or default secret group.

    • Constraints: The maximum length is 36 characters. The minimum length is 7 characters. The value must match regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/.
    SecretId string
    SecretType string
    (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.

    • Constraints: Allowable values are: arbitrary, imported_cert, public_cert, iam_credentials, kv, username_password, private_cert.
    State float64
    (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.

    • Constraints: Allowable values are: 0, 1, 2, 3, 5.
    StateDescription string
    (String) A text representation of the secret state.

    • Constraints: Allowable values are: pre_activation, active, suspended, deactivated, destroyed.
    UpdatedAt string
    (String) The date when a resource was recently modified. The date format follows RFC 3339.
    Username string
    (String) The username that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    VersionsTotal float64
    (Integer) The number of versions of the secret.

    • Constraints: The maximum value is 50. The minimum value is 0.
    EndpointType string
    SecretGroupName string
    createdAt String
    (String) The date when a resource was created. The date format follows RFC 3339.
    createdBy String
    (String) The unique identifier that is associated with the entity that created the secret.

    • Constraints: The maximum length is 128 characters. The minimum length is 4 characters.
    crn String
    (String) A CRN that uniquely identifies an IBM Cloud resource.

    • Constraints: The maximum length is 512 characters. The minimum length is 9 characters. The value must match regular expression /^crn:v0-9*+,;=@\/]|%[0-9A-Z]{2})*){8}$/.
    customMetadata Map<String,String>
    (Map) The secret metadata that a user can customize.
    description String
    (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

    • Constraints: The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.*?)/.
    downloaded Boolean
    (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.
    expirationDate String
    (String) The date a secret is expired. The date format follows RFC 3339.
    id String
    The unique identifier of the UsernamePasswordSecret.
    instanceId String
    labels List<String>
    (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.

    • Constraints: The list items must match regular expression /(.*?)/. The maximum length is 30 items. The minimum length is 0 items.
    locksTotal Double
    (Integer) The number of locks of the secret.

    • Constraints: The maximum value is 1000. The minimum value is 0.
    name String
    (String) The human-readable name of your secret.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters.
    nextRotationDate String
    (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.
    password String
    (String) The password that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 6 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    passwordGenerationPolicies List<GetSmUsernamePasswordSecretPasswordGenerationPolicy>
    (List) Policy for auto-generated passwords. Nested scheme for password_generation_policy:
    region String
    rotations List<GetSmUsernamePasswordSecretRotation>
    (List) Determines whether Secrets Manager rotates your secrets automatically. Nested scheme for rotation:
    secretGroupId String
    (String) A UUID identifier, or default secret group.

    • Constraints: The maximum length is 36 characters. The minimum length is 7 characters. The value must match regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/.
    secretId String
    secretType String
    (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.

    • Constraints: Allowable values are: arbitrary, imported_cert, public_cert, iam_credentials, kv, username_password, private_cert.
    state Double
    (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.

    • Constraints: Allowable values are: 0, 1, 2, 3, 5.
    stateDescription String
    (String) A text representation of the secret state.

    • Constraints: Allowable values are: pre_activation, active, suspended, deactivated, destroyed.
    updatedAt String
    (String) The date when a resource was recently modified. The date format follows RFC 3339.
    username String
    (String) The username that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    versionsTotal Double
    (Integer) The number of versions of the secret.

    • Constraints: The maximum value is 50. The minimum value is 0.
    endpointType String
    secretGroupName String
    createdAt string
    (String) The date when a resource was created. The date format follows RFC 3339.
    createdBy string
    (String) The unique identifier that is associated with the entity that created the secret.

    • Constraints: The maximum length is 128 characters. The minimum length is 4 characters.
    crn string
    (String) A CRN that uniquely identifies an IBM Cloud resource.

    • Constraints: The maximum length is 512 characters. The minimum length is 9 characters. The value must match regular expression /^crn:v0-9*+,;=@\/]|%[0-9A-Z]{2})*){8}$/.
    customMetadata {[key: string]: string}
    (Map) The secret metadata that a user can customize.
    description string
    (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

    • Constraints: The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.*?)/.
    downloaded boolean
    (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.
    expirationDate string
    (String) The date a secret is expired. The date format follows RFC 3339.
    id string
    The unique identifier of the UsernamePasswordSecret.
    instanceId string
    labels string[]
    (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.

    • Constraints: The list items must match regular expression /(.*?)/. The maximum length is 30 items. The minimum length is 0 items.
    locksTotal number
    (Integer) The number of locks of the secret.

    • Constraints: The maximum value is 1000. The minimum value is 0.
    name string
    (String) The human-readable name of your secret.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters.
    nextRotationDate string
    (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.
    password string
    (String) The password that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 6 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    passwordGenerationPolicies GetSmUsernamePasswordSecretPasswordGenerationPolicy[]
    (List) Policy for auto-generated passwords. Nested scheme for password_generation_policy:
    region string
    rotations GetSmUsernamePasswordSecretRotation[]
    (List) Determines whether Secrets Manager rotates your secrets automatically. Nested scheme for rotation:
    secretGroupId string
    (String) A UUID identifier, or default secret group.

    • Constraints: The maximum length is 36 characters. The minimum length is 7 characters. The value must match regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/.
    secretId string
    secretType string
    (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.

    • Constraints: Allowable values are: arbitrary, imported_cert, public_cert, iam_credentials, kv, username_password, private_cert.
    state number
    (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.

    • Constraints: Allowable values are: 0, 1, 2, 3, 5.
    stateDescription string
    (String) A text representation of the secret state.

    • Constraints: Allowable values are: pre_activation, active, suspended, deactivated, destroyed.
    updatedAt string
    (String) The date when a resource was recently modified. The date format follows RFC 3339.
    username string
    (String) The username that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    versionsTotal number
    (Integer) The number of versions of the secret.

    • Constraints: The maximum value is 50. The minimum value is 0.
    endpointType string
    secretGroupName string
    created_at str
    (String) The date when a resource was created. The date format follows RFC 3339.
    created_by str
    (String) The unique identifier that is associated with the entity that created the secret.

    • Constraints: The maximum length is 128 characters. The minimum length is 4 characters.
    crn str
    (String) A CRN that uniquely identifies an IBM Cloud resource.

    • Constraints: The maximum length is 512 characters. The minimum length is 9 characters. The value must match regular expression /^crn:v0-9*+,;=@\/]|%[0-9A-Z]{2})*){8}$/.
    custom_metadata Mapping[str, str]
    (Map) The secret metadata that a user can customize.
    description str
    (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

    • Constraints: The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.*?)/.
    downloaded bool
    (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.
    expiration_date str
    (String) The date a secret is expired. The date format follows RFC 3339.
    id str
    The unique identifier of the UsernamePasswordSecret.
    instance_id str
    labels Sequence[str]
    (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.

    • Constraints: The list items must match regular expression /(.*?)/. The maximum length is 30 items. The minimum length is 0 items.
    locks_total float
    (Integer) The number of locks of the secret.

    • Constraints: The maximum value is 1000. The minimum value is 0.
    name str
    (String) The human-readable name of your secret.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters.
    next_rotation_date str
    (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.
    password str
    (String) The password that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 6 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    password_generation_policies Sequence[GetSmUsernamePasswordSecretPasswordGenerationPolicy]
    (List) Policy for auto-generated passwords. Nested scheme for password_generation_policy:
    region str
    rotations Sequence[GetSmUsernamePasswordSecretRotation]
    (List) Determines whether Secrets Manager rotates your secrets automatically. Nested scheme for rotation:
    secret_group_id str
    (String) A UUID identifier, or default secret group.

    • Constraints: The maximum length is 36 characters. The minimum length is 7 characters. The value must match regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/.
    secret_id str
    secret_type str
    (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.

    • Constraints: Allowable values are: arbitrary, imported_cert, public_cert, iam_credentials, kv, username_password, private_cert.
    state float
    (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.

    • Constraints: Allowable values are: 0, 1, 2, 3, 5.
    state_description str
    (String) A text representation of the secret state.

    • Constraints: Allowable values are: pre_activation, active, suspended, deactivated, destroyed.
    updated_at str
    (String) The date when a resource was recently modified. The date format follows RFC 3339.
    username str
    (String) The username that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    versions_total float
    (Integer) The number of versions of the secret.

    • Constraints: The maximum value is 50. The minimum value is 0.
    endpoint_type str
    secret_group_name str
    createdAt String
    (String) The date when a resource was created. The date format follows RFC 3339.
    createdBy String
    (String) The unique identifier that is associated with the entity that created the secret.

    • Constraints: The maximum length is 128 characters. The minimum length is 4 characters.
    crn String
    (String) A CRN that uniquely identifies an IBM Cloud resource.

    • Constraints: The maximum length is 512 characters. The minimum length is 9 characters. The value must match regular expression /^crn:v0-9*+,;=@\/]|%[0-9A-Z]{2})*){8}$/.
    customMetadata Map<String>
    (Map) The secret metadata that a user can customize.
    description String
    (String) An extended description of your secret.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

    • Constraints: The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.*?)/.
    downloaded Boolean
    (Boolean) Indicates whether the secret data that is associated with a secret version was retrieved in a call to the service API.
    expirationDate String
    (String) The date a secret is expired. The date format follows RFC 3339.
    id String
    The unique identifier of the UsernamePasswordSecret.
    instanceId String
    labels List<String>
    (List) Labels that you can use to search for secrets in your instance.Up to 30 labels can be created.

    • Constraints: The list items must match regular expression /(.*?)/. The maximum length is 30 items. The minimum length is 0 items.
    locksTotal Number
    (Integer) The number of locks of the secret.

    • Constraints: The maximum value is 1000. The minimum value is 0.
    name String
    (String) The human-readable name of your secret.

    • Constraints: The maximum length is 256 characters. The minimum length is 2 characters.
    nextRotationDate String
    (String) The date that the secret is scheduled for automatic rotation.The service automatically creates a new version of the secret on its next rotation date. This field exists only for secrets that have an existing rotation policy.
    password String
    (String) The password that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 6 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    passwordGenerationPolicies List<Property Map>
    (List) Policy for auto-generated passwords. Nested scheme for password_generation_policy:
    region String
    rotations List<Property Map>
    (List) Determines whether Secrets Manager rotates your secrets automatically. Nested scheme for rotation:
    secretGroupId String
    (String) A UUID identifier, or default secret group.

    • Constraints: The maximum length is 36 characters. The minimum length is 7 characters. The value must match regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|default)$/.
    secretId String
    secretType String
    (String) The secret type. Supported types are arbitrary, certificates (imported, public, and private), IAM credentials, key-value, and user credentials.

    • Constraints: Allowable values are: arbitrary, imported_cert, public_cert, iam_credentials, kv, username_password, private_cert.
    state Number
    (Integer) The secret state that is based on NIST SP 800-57. States are integers and correspond to the Pre-activation = 0, Active = 1, Suspended = 2, Deactivated = 3, and Destroyed = 5 values.

    • Constraints: Allowable values are: 0, 1, 2, 3, 5.
    stateDescription String
    (String) A text representation of the secret state.

    • Constraints: Allowable values are: pre_activation, active, suspended, deactivated, destroyed.
    updatedAt String
    (String) The date when a resource was recently modified. The date format follows RFC 3339.
    username String
    (String) The username that is assigned to the secret.

    • Constraints: The maximum length is 64 characters. The minimum length is 2 characters. The value must match regular expression /[A-Za-z0-9+-=.]*/.
    versionsTotal Number
    (Integer) The number of versions of the secret.

    • Constraints: The maximum value is 50. The minimum value is 0.
    endpointType String
    secretGroupName String

    Supporting Types

    GetSmUsernamePasswordSecretPasswordGenerationPolicy

    IncludeDigits bool
    (Boolean) Include digits in auto-generated passwords.
    IncludeSymbols bool
    (Boolean) Include symbols in auto-generated passwords.
    IncludeUppercase bool
    (Boolean) Include uppercase letters in auto-generated passwords.
    Length double
    (Integer) The length of auto-generated passwords.
    IncludeDigits bool
    (Boolean) Include digits in auto-generated passwords.
    IncludeSymbols bool
    (Boolean) Include symbols in auto-generated passwords.
    IncludeUppercase bool
    (Boolean) Include uppercase letters in auto-generated passwords.
    Length float64
    (Integer) The length of auto-generated passwords.
    includeDigits Boolean
    (Boolean) Include digits in auto-generated passwords.
    includeSymbols Boolean
    (Boolean) Include symbols in auto-generated passwords.
    includeUppercase Boolean
    (Boolean) Include uppercase letters in auto-generated passwords.
    length Double
    (Integer) The length of auto-generated passwords.
    includeDigits boolean
    (Boolean) Include digits in auto-generated passwords.
    includeSymbols boolean
    (Boolean) Include symbols in auto-generated passwords.
    includeUppercase boolean
    (Boolean) Include uppercase letters in auto-generated passwords.
    length number
    (Integer) The length of auto-generated passwords.
    include_digits bool
    (Boolean) Include digits in auto-generated passwords.
    include_symbols bool
    (Boolean) Include symbols in auto-generated passwords.
    include_uppercase bool
    (Boolean) Include uppercase letters in auto-generated passwords.
    length float
    (Integer) The length of auto-generated passwords.
    includeDigits Boolean
    (Boolean) Include digits in auto-generated passwords.
    includeSymbols Boolean
    (Boolean) Include symbols in auto-generated passwords.
    includeUppercase Boolean
    (Boolean) Include uppercase letters in auto-generated passwords.
    length Number
    (Integer) The length of auto-generated passwords.

    GetSmUsernamePasswordSecretRotation

    AutoRotate bool
    (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is false. If auto_rotate is set to true the service rotates your secret based on the defined interval.
    Interval double
    (Integer) The length of the secret rotation time interval.

    • Constraints: The minimum value is 1.
    Unit string
    (String) The units for the secret rotation time interval.

    • Constraints: Allowable values are: day, month.
    AutoRotate bool
    (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is false. If auto_rotate is set to true the service rotates your secret based on the defined interval.
    Interval float64
    (Integer) The length of the secret rotation time interval.

    • Constraints: The minimum value is 1.
    Unit string
    (String) The units for the secret rotation time interval.

    • Constraints: Allowable values are: day, month.
    autoRotate Boolean
    (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is false. If auto_rotate is set to true the service rotates your secret based on the defined interval.
    interval Double
    (Integer) The length of the secret rotation time interval.

    • Constraints: The minimum value is 1.
    unit String
    (String) The units for the secret rotation time interval.

    • Constraints: Allowable values are: day, month.
    autoRotate boolean
    (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is false. If auto_rotate is set to true the service rotates your secret based on the defined interval.
    interval number
    (Integer) The length of the secret rotation time interval.

    • Constraints: The minimum value is 1.
    unit string
    (String) The units for the secret rotation time interval.

    • Constraints: Allowable values are: day, month.
    auto_rotate bool
    (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is false. If auto_rotate is set to true the service rotates your secret based on the defined interval.
    interval float
    (Integer) The length of the secret rotation time interval.

    • Constraints: The minimum value is 1.
    unit str
    (String) The units for the secret rotation time interval.

    • Constraints: Allowable values are: day, month.
    autoRotate Boolean
    (Boolean) Determines whether Secrets Manager rotates your secret automatically.Default is false. If auto_rotate is set to true the service rotates your secret based on the defined interval.
    interval Number
    (Integer) The length of the secret rotation time interval.

    • Constraints: The minimum value is 1.
    unit String
    (String) The units for the secret rotation time interval.

    • Constraints: Allowable values are: day, month.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud