1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. ProjectServiceAccountSecret
MongoDB Atlas v4.2.0 published on Friday, Jan 23, 2026 by Pulumi
mongodbatlas logo
MongoDB Atlas v4.2.0 published on Friday, Jan 23, 2026 by Pulumi

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const thisProjectServiceAccount = new mongodbatlas.ProjectServiceAccount("this", {
        projectId: projectId,
        name: "example-project-service-account",
        description: "Example Project Service Account",
        roles: ["GROUP_READ_ONLY"],
        secretExpiresAfterHours: 2160,
    });
    const thisProjectServiceAccountSecret = new mongodbatlas.ProjectServiceAccountSecret("this", {
        projectId: projectId,
        clientId: thisProjectServiceAccount.clientId,
        secretExpiresAfterHours: 2160,
    });
    const _this = pulumi.all([thisProjectServiceAccount.clientId, thisProjectServiceAccountSecret.secretId]).apply(([clientId, secretId]) => mongodbatlas.getProjectServiceAccountSecretOutput({
        projectId: projectId,
        clientId: clientId,
        secretId: secretId,
    }));
    export const secretId = thisProjectServiceAccountSecret.secretId;
    export const secret = thisProjectServiceAccountSecret.secret;
    export const secretExpiresAt = _this.apply(_this => _this.expiresAt);
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    this_project_service_account = mongodbatlas.ProjectServiceAccount("this",
        project_id=project_id,
        name="example-project-service-account",
        description="Example Project Service Account",
        roles=["GROUP_READ_ONLY"],
        secret_expires_after_hours=2160)
    this_project_service_account_secret = mongodbatlas.ProjectServiceAccountSecret("this",
        project_id=project_id,
        client_id=this_project_service_account.client_id,
        secret_expires_after_hours=2160)
    this = pulumi.Output.all(
        client_id=this_project_service_account.client_id,
        secret_id=this_project_service_account_secret.secret_id
    ).apply(lambda resolved_outputs: mongodbatlas.get_project_service_account_secret_output(project_id=project_id,
        client_id=resolved_outputs['client_id'],
        secret_id=resolved_outputs['secret_id']))
    
    pulumi.export("secretId", this_project_service_account_secret.secret_id)
    pulumi.export("secret", this_project_service_account_secret.secret)
    pulumi.export("secretExpiresAt", this.expires_at)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-mongodbatlas/sdk/v4/go/mongodbatlas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		thisProjectServiceAccount, err := mongodbatlas.NewProjectServiceAccount(ctx, "this", &mongodbatlas.ProjectServiceAccountArgs{
    			ProjectId:   pulumi.Any(projectId),
    			Name:        pulumi.String("example-project-service-account"),
    			Description: pulumi.String("Example Project Service Account"),
    			Roles: pulumi.StringArray{
    				pulumi.String("GROUP_READ_ONLY"),
    			},
    			SecretExpiresAfterHours: pulumi.Int(2160),
    		})
    		if err != nil {
    			return err
    		}
    		thisProjectServiceAccountSecret, err := mongodbatlas.NewProjectServiceAccountSecret(ctx, "this", &mongodbatlas.ProjectServiceAccountSecretArgs{
    			ProjectId:               pulumi.Any(projectId),
    			ClientId:                thisProjectServiceAccount.ClientId,
    			SecretExpiresAfterHours: pulumi.Int(2160),
    		})
    		if err != nil {
    			return err
    		}
    		this := pulumi.All(thisProjectServiceAccount.ClientId, thisProjectServiceAccountSecret.SecretId).ApplyT(func(_args []interface{}) (mongodbatlas.GetProjectServiceAccountSecretResult, error) {
    			clientId := _args[0].(string)
    			secretId := _args[1].(string)
    			return mongodbatlas.GetProjectServiceAccountSecretResult(interface{}(mongodbatlas.LookupProjectServiceAccountSecret(ctx, &mongodbatlas.LookupProjectServiceAccountSecretArgs{
    				ProjectId: projectId,
    				ClientId:  clientId,
    				SecretId:  secretId,
    			}, nil))), nil
    		}).(mongodbatlas.GetProjectServiceAccountSecretResultOutput)
    		ctx.Export("secretId", thisProjectServiceAccountSecret.SecretId)
    		ctx.Export("secret", thisProjectServiceAccountSecret.Secret)
    		ctx.Export("secretExpiresAt", this.ApplyT(func(this mongodbatlas.GetProjectServiceAccountSecretResult) (*string, error) {
    			return &this.ExpiresAt, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var thisProjectServiceAccount = new Mongodbatlas.ProjectServiceAccount("this", new()
        {
            ProjectId = projectId,
            Name = "example-project-service-account",
            Description = "Example Project Service Account",
            Roles = new[]
            {
                "GROUP_READ_ONLY",
            },
            SecretExpiresAfterHours = 2160,
        });
    
        var thisProjectServiceAccountSecret = new Mongodbatlas.ProjectServiceAccountSecret("this", new()
        {
            ProjectId = projectId,
            ClientId = thisProjectServiceAccount.ClientId,
            SecretExpiresAfterHours = 2160,
        });
    
        var @this = Mongodbatlas.GetProjectServiceAccountSecret.Invoke(new()
        {
            ProjectId = projectId,
            ClientId = thisProjectServiceAccount.ClientId,
            SecretId = thisProjectServiceAccountSecret.SecretId,
        });
    
        return new Dictionary<string, object?>
        {
            ["secretId"] = thisProjectServiceAccountSecret.SecretId,
            ["secret"] = thisProjectServiceAccountSecret.Secret,
            ["secretExpiresAt"] = @this.Apply(@this => @this.Apply(getProjectServiceAccountSecretResult => getProjectServiceAccountSecretResult.ExpiresAt)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.ProjectServiceAccount;
    import com.pulumi.mongodbatlas.ProjectServiceAccountArgs;
    import com.pulumi.mongodbatlas.ProjectServiceAccountSecret;
    import com.pulumi.mongodbatlas.ProjectServiceAccountSecretArgs;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetProjectServiceAccountSecretArgs;
    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 thisProjectServiceAccount = new ProjectServiceAccount("thisProjectServiceAccount", ProjectServiceAccountArgs.builder()
                .projectId(projectId)
                .name("example-project-service-account")
                .description("Example Project Service Account")
                .roles("GROUP_READ_ONLY")
                .secretExpiresAfterHours(2160)
                .build());
    
            var thisProjectServiceAccountSecret = new ProjectServiceAccountSecret("thisProjectServiceAccountSecret", ProjectServiceAccountSecretArgs.builder()
                .projectId(projectId)
                .clientId(thisProjectServiceAccount.clientId())
                .secretExpiresAfterHours(2160)
                .build());
    
            final var this = Output.tuple(thisProjectServiceAccount.clientId(), thisProjectServiceAccountSecret.secretId()).applyValue(values -> {
                var clientId = values.t1;
                var secretId = values.t2;
                return MongodbatlasFunctions.getProjectServiceAccountSecret(GetProjectServiceAccountSecretArgs.builder()
                    .projectId(projectId)
                    .clientId(clientId)
                    .secretId(secretId)
                    .build());
            });
    
            ctx.export("secretId", thisProjectServiceAccountSecret.secretId());
            ctx.export("secret", thisProjectServiceAccountSecret.secret());
            ctx.export("secretExpiresAt", this_.applyValue(_this_ -> _this_.expiresAt()));
        }
    }
    
    resources:
      thisProjectServiceAccount:
        type: mongodbatlas:ProjectServiceAccount
        name: this
        properties:
          projectId: ${projectId}
          name: example-project-service-account
          description: Example Project Service Account
          roles:
            - GROUP_READ_ONLY
          secretExpiresAfterHours: 2160 # 90 days
      thisProjectServiceAccountSecret:
        type: mongodbatlas:ProjectServiceAccountSecret
        name: this
        properties:
          projectId: ${projectId}
          clientId: ${thisProjectServiceAccount.clientId}
          secretExpiresAfterHours: 2160 # 90 days
    variables:
      this:
        fn::invoke:
          function: mongodbatlas:getProjectServiceAccountSecret
          arguments:
            projectId: ${projectId}
            clientId: ${thisProjectServiceAccount.clientId}
            secretId: ${thisProjectServiceAccountSecret.secretId}
    outputs:
      secretId: ${thisProjectServiceAccountSecret.secretId}
      secret: ${thisProjectServiceAccountSecret.secret}
      secretExpiresAt: ${this.expiresAt}
    

    Create ProjectServiceAccountSecret Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ProjectServiceAccountSecret(name: string, args: ProjectServiceAccountSecretArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectServiceAccountSecret(resource_name: str,
                                    args: ProjectServiceAccountSecretInitArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectServiceAccountSecret(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    client_id: Optional[str] = None,
                                    project_id: Optional[str] = None,
                                    secret_expires_after_hours: Optional[int] = None)
    func NewProjectServiceAccountSecret(ctx *Context, name string, args ProjectServiceAccountSecretArgs, opts ...ResourceOption) (*ProjectServiceAccountSecret, error)
    public ProjectServiceAccountSecret(string name, ProjectServiceAccountSecretArgs args, CustomResourceOptions? opts = null)
    public ProjectServiceAccountSecret(String name, ProjectServiceAccountSecretArgs args)
    public ProjectServiceAccountSecret(String name, ProjectServiceAccountSecretArgs args, CustomResourceOptions options)
    
    type: mongodbatlas:ProjectServiceAccountSecret
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ProjectServiceAccountSecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ProjectServiceAccountSecretInitArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ProjectServiceAccountSecretArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectServiceAccountSecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectServiceAccountSecretArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var projectServiceAccountSecretResource = new Mongodbatlas.ProjectServiceAccountSecret("projectServiceAccountSecretResource", new()
    {
        ClientId = "string",
        ProjectId = "string",
        SecretExpiresAfterHours = 0,
    });
    
    example, err := mongodbatlas.NewProjectServiceAccountSecret(ctx, "projectServiceAccountSecretResource", &mongodbatlas.ProjectServiceAccountSecretArgs{
    	ClientId:                pulumi.String("string"),
    	ProjectId:               pulumi.String("string"),
    	SecretExpiresAfterHours: pulumi.Int(0),
    })
    
    var projectServiceAccountSecretResource = new ProjectServiceAccountSecret("projectServiceAccountSecretResource", ProjectServiceAccountSecretArgs.builder()
        .clientId("string")
        .projectId("string")
        .secretExpiresAfterHours(0)
        .build());
    
    project_service_account_secret_resource = mongodbatlas.ProjectServiceAccountSecret("projectServiceAccountSecretResource",
        client_id="string",
        project_id="string",
        secret_expires_after_hours=0)
    
    const projectServiceAccountSecretResource = new mongodbatlas.ProjectServiceAccountSecret("projectServiceAccountSecretResource", {
        clientId: "string",
        projectId: "string",
        secretExpiresAfterHours: 0,
    });
    
    type: mongodbatlas:ProjectServiceAccountSecret
    properties:
        clientId: string
        projectId: string
        secretExpiresAfterHours: 0
    

    ProjectServiceAccountSecret Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ProjectServiceAccountSecret resource accepts the following input properties:

    ClientId string
    The Client ID of the Service Account.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project.
    SecretExpiresAfterHours int
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    ClientId string
    The Client ID of the Service Account.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project.
    SecretExpiresAfterHours int
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    clientId String
    The Client ID of the Service Account.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project.
    secretExpiresAfterHours Integer
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    clientId string
    The Client ID of the Service Account.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project.
    secretExpiresAfterHours number
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    client_id str
    The Client ID of the Service Account.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project.
    secret_expires_after_hours int
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    clientId String
    The Client ID of the Service Account.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project.
    secretExpiresAfterHours Number
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectServiceAccountSecret resource produces the following output properties:

    CreatedAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    ExpiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    MaskedSecretValue string
    The masked Service Account secret.
    Secret string
    The secret for the Service Account. It will be returned only the first time after creation.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    CreatedAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    ExpiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    MaskedSecretValue string
    The masked Service Account secret.
    Secret string
    The secret for the Service Account. It will be returned only the first time after creation.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    createdAt String
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt String
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUsedAt String
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue String
    The masked Service Account secret.
    secret String
    The secret for the Service Account. It will be returned only the first time after creation.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.
    createdAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue string
    The masked Service Account secret.
    secret string
    The secret for the Service Account. It will be returned only the first time after creation.
    secretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    created_at str
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expires_at str
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    id str
    The provider-assigned unique ID for this managed resource.
    last_used_at str
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    masked_secret_value str
    The masked Service Account secret.
    secret str
    The secret for the Service Account. It will be returned only the first time after creation.
    secret_id str
    Unique 24-hexadecimal digit string that identifies the secret.
    createdAt String
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt String
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUsedAt String
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue String
    The masked Service Account secret.
    secret String
    The secret for the Service Account. It will be returned only the first time after creation.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.

    Look up Existing ProjectServiceAccountSecret Resource

    Get an existing ProjectServiceAccountSecret resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ProjectServiceAccountSecretState, opts?: CustomResourceOptions): ProjectServiceAccountSecret
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            client_id: Optional[str] = None,
            created_at: Optional[str] = None,
            expires_at: Optional[str] = None,
            last_used_at: Optional[str] = None,
            masked_secret_value: Optional[str] = None,
            project_id: Optional[str] = None,
            secret: Optional[str] = None,
            secret_expires_after_hours: Optional[int] = None,
            secret_id: Optional[str] = None) -> ProjectServiceAccountSecret
    func GetProjectServiceAccountSecret(ctx *Context, name string, id IDInput, state *ProjectServiceAccountSecretState, opts ...ResourceOption) (*ProjectServiceAccountSecret, error)
    public static ProjectServiceAccountSecret Get(string name, Input<string> id, ProjectServiceAccountSecretState? state, CustomResourceOptions? opts = null)
    public static ProjectServiceAccountSecret get(String name, Output<String> id, ProjectServiceAccountSecretState state, CustomResourceOptions options)
    resources:  _:    type: mongodbatlas:ProjectServiceAccountSecret    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ClientId string
    The Client ID of the Service Account.
    CreatedAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    ExpiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    LastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    MaskedSecretValue string
    The masked Service Account secret.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project.
    Secret string
    The secret for the Service Account. It will be returned only the first time after creation.
    SecretExpiresAfterHours int
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    ClientId string
    The Client ID of the Service Account.
    CreatedAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    ExpiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    LastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    MaskedSecretValue string
    The masked Service Account secret.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project.
    Secret string
    The secret for the Service Account. It will be returned only the first time after creation.
    SecretExpiresAfterHours int
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    SecretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    clientId String
    The Client ID of the Service Account.
    createdAt String
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt String
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    lastUsedAt String
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue String
    The masked Service Account secret.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project.
    secret String
    The secret for the Service Account. It will be returned only the first time after creation.
    secretExpiresAfterHours Integer
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.
    clientId string
    The Client ID of the Service Account.
    createdAt string
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt string
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    lastUsedAt string
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue string
    The masked Service Account secret.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project.
    secret string
    The secret for the Service Account. It will be returned only the first time after creation.
    secretExpiresAfterHours number
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    secretId string
    Unique 24-hexadecimal digit string that identifies the secret.
    client_id str
    The Client ID of the Service Account.
    created_at str
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expires_at str
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    last_used_at str
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    masked_secret_value str
    The masked Service Account secret.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project.
    secret str
    The secret for the Service Account. It will be returned only the first time after creation.
    secret_expires_after_hours int
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    secret_id str
    Unique 24-hexadecimal digit string that identifies the secret.
    clientId String
    The Client ID of the Service Account.
    createdAt String
    The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    expiresAt String
    The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    lastUsedAt String
    The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
    maskedSecretValue String
    The masked Service Account secret.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project.
    secret String
    The secret for the Service Account. It will be returned only the first time after creation.
    secretExpiresAfterHours Number
    The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. This attribute is required when creating the Service Account Secret and you cannot update it later.
    secretId String
    Unique 24-hexadecimal digit string that identifies the secret.

    Import

    Import the Project Service Account Secret resource by using the Project ID, Client ID, and Secret ID in the format PROJECT_ID/CLIENT_ID/SECRET_ID, e.g.

    $ pulumi import mongodbatlas:index/projectServiceAccountSecret:ProjectServiceAccountSecret test 6117ac2fe2a3d04ed27a987v/mdb_sa_id_1234567890abcdef12345678/04ed271234abcde2a3da123a
    

    For more information, see Create One Project Service Account Secret in the MongoDB Atlas API documentation.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v4.2.0 published on Friday, Jan 23, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate