1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getMongodbEmployeeAccessGrant
MongoDB Atlas v3.20.4 published on Wednesday, Oct 30, 2024 by Pulumi

mongodbatlas.getMongodbEmployeeAccessGrant

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.20.4 published on Wednesday, Oct 30, 2024 by Pulumi

    # Data Source: mongodbatlas.MongodbEmployeeAccessGrant

    mongodbatlas.MongodbEmployeeAccessGrant describes a MongoDB employee access grant.

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const example = new mongodbatlas.MongodbEmployeeAccessGrant("example", {
        projectId: projectId,
        clusterName: clusterName,
        grantType: "CLUSTER_INFRASTRUCTURE_AND_APP_SERVICES_SYNC_DATA",
        expirationTime: "2025-01-01T12:00:00Z",
    });
    const dsExample = mongodbatlas.getMongodbEmployeeAccessGrant({
        projectId: projectId,
        clusterName: clusterName,
    });
    export const grantType = dsExample.then(dsExample => dsExample.grantType);
    export const expirationTime = dsExample.then(dsExample => dsExample.expirationTime);
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    example = mongodbatlas.MongodbEmployeeAccessGrant("example",
        project_id=project_id,
        cluster_name=cluster_name,
        grant_type="CLUSTER_INFRASTRUCTURE_AND_APP_SERVICES_SYNC_DATA",
        expiration_time="2025-01-01T12:00:00Z")
    ds_example = mongodbatlas.get_mongodb_employee_access_grant(project_id=project_id,
        cluster_name=cluster_name)
    pulumi.export("grantType", ds_example.grant_type)
    pulumi.export("expirationTime", ds_example.expiration_time)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := mongodbatlas.NewMongodbEmployeeAccessGrant(ctx, "example", &mongodbatlas.MongodbEmployeeAccessGrantArgs{
    			ProjectId:      pulumi.Any(projectId),
    			ClusterName:    pulumi.Any(clusterName),
    			GrantType:      pulumi.String("CLUSTER_INFRASTRUCTURE_AND_APP_SERVICES_SYNC_DATA"),
    			ExpirationTime: pulumi.String("2025-01-01T12:00:00Z"),
    		})
    		if err != nil {
    			return err
    		}
    		dsExample, err := mongodbatlas.LookupMongodbEmployeeAccessGrant(ctx, &mongodbatlas.LookupMongodbEmployeeAccessGrantArgs{
    			ProjectId:   projectId,
    			ClusterName: clusterName,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("grantType", dsExample.GrantType)
    		ctx.Export("expirationTime", dsExample.ExpirationTime)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Mongodbatlas.MongodbEmployeeAccessGrant("example", new()
        {
            ProjectId = projectId,
            ClusterName = clusterName,
            GrantType = "CLUSTER_INFRASTRUCTURE_AND_APP_SERVICES_SYNC_DATA",
            ExpirationTime = "2025-01-01T12:00:00Z",
        });
    
        var dsExample = Mongodbatlas.GetMongodbEmployeeAccessGrant.Invoke(new()
        {
            ProjectId = projectId,
            ClusterName = clusterName,
        });
    
        return new Dictionary<string, object?>
        {
            ["grantType"] = dsExample.Apply(getMongodbEmployeeAccessGrantResult => getMongodbEmployeeAccessGrantResult.GrantType),
            ["expirationTime"] = dsExample.Apply(getMongodbEmployeeAccessGrantResult => getMongodbEmployeeAccessGrantResult.ExpirationTime),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.MongodbEmployeeAccessGrant;
    import com.pulumi.mongodbatlas.MongodbEmployeeAccessGrantArgs;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetMongodbEmployeeAccessGrantArgs;
    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 example = new MongodbEmployeeAccessGrant("example", MongodbEmployeeAccessGrantArgs.builder()
                .projectId(projectId)
                .clusterName(clusterName)
                .grantType("CLUSTER_INFRASTRUCTURE_AND_APP_SERVICES_SYNC_DATA")
                .expirationTime("2025-01-01T12:00:00Z")
                .build());
    
            final var dsExample = MongodbatlasFunctions.getMongodbEmployeeAccessGrant(GetMongodbEmployeeAccessGrantArgs.builder()
                .projectId(projectId)
                .clusterName(clusterName)
                .build());
    
            ctx.export("grantType", dsExample.applyValue(getMongodbEmployeeAccessGrantResult -> getMongodbEmployeeAccessGrantResult.grantType()));
            ctx.export("expirationTime", dsExample.applyValue(getMongodbEmployeeAccessGrantResult -> getMongodbEmployeeAccessGrantResult.expirationTime()));
        }
    }
    
    resources:
      example:
        type: mongodbatlas:MongodbEmployeeAccessGrant
        properties:
          projectId: ${projectId}
          clusterName: ${clusterName}
          grantType: CLUSTER_INFRASTRUCTURE_AND_APP_SERVICES_SYNC_DATA
          expirationTime: 2025-01-01T12:00:00Z
    variables:
      dsExample:
        fn::invoke:
          Function: mongodbatlas:getMongodbEmployeeAccessGrant
          Arguments:
            projectId: ${projectId}
            clusterName: ${clusterName}
    outputs:
      grantType: ${dsExample.grantType}
      expirationTime: ${dsExample.expirationTime}
    

    Using getMongodbEmployeeAccessGrant

    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 getMongodbEmployeeAccessGrant(args: GetMongodbEmployeeAccessGrantArgs, opts?: InvokeOptions): Promise<GetMongodbEmployeeAccessGrantResult>
    function getMongodbEmployeeAccessGrantOutput(args: GetMongodbEmployeeAccessGrantOutputArgs, opts?: InvokeOptions): Output<GetMongodbEmployeeAccessGrantResult>
    def get_mongodb_employee_access_grant(cluster_name: Optional[str] = None,
                                          project_id: Optional[str] = None,
                                          opts: Optional[InvokeOptions] = None) -> GetMongodbEmployeeAccessGrantResult
    def get_mongodb_employee_access_grant_output(cluster_name: Optional[pulumi.Input[str]] = None,
                                          project_id: Optional[pulumi.Input[str]] = None,
                                          opts: Optional[InvokeOptions] = None) -> Output[GetMongodbEmployeeAccessGrantResult]
    func LookupMongodbEmployeeAccessGrant(ctx *Context, args *LookupMongodbEmployeeAccessGrantArgs, opts ...InvokeOption) (*LookupMongodbEmployeeAccessGrantResult, error)
    func LookupMongodbEmployeeAccessGrantOutput(ctx *Context, args *LookupMongodbEmployeeAccessGrantOutputArgs, opts ...InvokeOption) LookupMongodbEmployeeAccessGrantResultOutput

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

    public static class GetMongodbEmployeeAccessGrant 
    {
        public static Task<GetMongodbEmployeeAccessGrantResult> InvokeAsync(GetMongodbEmployeeAccessGrantArgs args, InvokeOptions? opts = null)
        public static Output<GetMongodbEmployeeAccessGrantResult> Invoke(GetMongodbEmployeeAccessGrantInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMongodbEmployeeAccessGrantResult> getMongodbEmployeeAccessGrant(GetMongodbEmployeeAccessGrantArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mongodbatlas:index/getMongodbEmployeeAccessGrant:getMongodbEmployeeAccessGrant
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterName string
    Human-readable label that identifies this cluster.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    ClusterName string
    Human-readable label that identifies this cluster.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    clusterName String
    Human-readable label that identifies this cluster.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    clusterName string
    Human-readable label that identifies this cluster.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    cluster_name str
    Human-readable label that identifies this cluster.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    clusterName String
    Human-readable label that identifies this cluster.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.

    getMongodbEmployeeAccessGrant Result

    The following output properties are available:

    ClusterName string
    Human-readable label that identifies this cluster.
    ExpirationTime string
    GrantType string
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    ClusterName string
    Human-readable label that identifies this cluster.
    ExpirationTime string
    GrantType string
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    clusterName String
    Human-readable label that identifies this cluster.
    expirationTime String
    grantType String
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    clusterName string
    Human-readable label that identifies this cluster.
    expirationTime string
    grantType string
    id string
    The provider-assigned unique ID for this managed resource.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    cluster_name str
    Human-readable label that identifies this cluster.
    expiration_time str
    grant_type str
    id str
    The provider-assigned unique ID for this managed resource.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    clusterName String
    Human-readable label that identifies this cluster.
    expirationTime String
    grantType String
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.

    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 v3.20.4 published on Wednesday, Oct 30, 2024 by Pulumi