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

mongodbatlas.MongodbEmployeeAccessGrant

Explore with Pulumi AI

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

    # Resource: mongodbatlas.MongodbEmployeeAccessGrant

    mongodbatlas.MongodbEmployeeAccessGrant provides a MongoDB Employee Access Grant resource. The resource lets you create, delete, update and import 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}
    

    Create MongodbEmployeeAccessGrant Resource

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

    Constructor syntax

    new MongodbEmployeeAccessGrant(name: string, args: MongodbEmployeeAccessGrantArgs, opts?: CustomResourceOptions);
    @overload
    def MongodbEmployeeAccessGrant(resource_name: str,
                                   args: MongodbEmployeeAccessGrantArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def MongodbEmployeeAccessGrant(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   cluster_name: Optional[str] = None,
                                   expiration_time: Optional[str] = None,
                                   grant_type: Optional[str] = None,
                                   project_id: Optional[str] = None)
    func NewMongodbEmployeeAccessGrant(ctx *Context, name string, args MongodbEmployeeAccessGrantArgs, opts ...ResourceOption) (*MongodbEmployeeAccessGrant, error)
    public MongodbEmployeeAccessGrant(string name, MongodbEmployeeAccessGrantArgs args, CustomResourceOptions? opts = null)
    public MongodbEmployeeAccessGrant(String name, MongodbEmployeeAccessGrantArgs args)
    public MongodbEmployeeAccessGrant(String name, MongodbEmployeeAccessGrantArgs args, CustomResourceOptions options)
    
    type: mongodbatlas:MongodbEmployeeAccessGrant
    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 MongodbEmployeeAccessGrantArgs
    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 MongodbEmployeeAccessGrantArgs
    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 MongodbEmployeeAccessGrantArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MongodbEmployeeAccessGrantArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MongodbEmployeeAccessGrantArgs
    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 mongodbEmployeeAccessGrantResource = new Mongodbatlas.MongodbEmployeeAccessGrant("mongodbEmployeeAccessGrantResource", new()
    {
        ClusterName = "string",
        ExpirationTime = "string",
        GrantType = "string",
        ProjectId = "string",
    });
    
    example, err := mongodbatlas.NewMongodbEmployeeAccessGrant(ctx, "mongodbEmployeeAccessGrantResource", &mongodbatlas.MongodbEmployeeAccessGrantArgs{
    	ClusterName:    pulumi.String("string"),
    	ExpirationTime: pulumi.String("string"),
    	GrantType:      pulumi.String("string"),
    	ProjectId:      pulumi.String("string"),
    })
    
    var mongodbEmployeeAccessGrantResource = new MongodbEmployeeAccessGrant("mongodbEmployeeAccessGrantResource", MongodbEmployeeAccessGrantArgs.builder()
        .clusterName("string")
        .expirationTime("string")
        .grantType("string")
        .projectId("string")
        .build());
    
    mongodb_employee_access_grant_resource = mongodbatlas.MongodbEmployeeAccessGrant("mongodbEmployeeAccessGrantResource",
        cluster_name="string",
        expiration_time="string",
        grant_type="string",
        project_id="string")
    
    const mongodbEmployeeAccessGrantResource = new mongodbatlas.MongodbEmployeeAccessGrant("mongodbEmployeeAccessGrantResource", {
        clusterName: "string",
        expirationTime: "string",
        grantType: "string",
        projectId: "string",
    });
    
    type: mongodbatlas:MongodbEmployeeAccessGrant
    properties:
        clusterName: string
        expirationTime: string
        grantType: string
        projectId: string
    

    MongodbEmployeeAccessGrant 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 MongodbEmployeeAccessGrant resource accepts the following input properties:

    ClusterName string
    Human-readable label that identifies this cluster.
    ExpirationTime string
    Expiration date for the employee access grant.
    GrantType string
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    GrantType string
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grantType String
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grantType string
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grant_type str
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grantType String
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MongodbEmployeeAccessGrant Resource

    Get an existing MongodbEmployeeAccessGrant 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?: MongodbEmployeeAccessGrantState, opts?: CustomResourceOptions): MongodbEmployeeAccessGrant
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_name: Optional[str] = None,
            expiration_time: Optional[str] = None,
            grant_type: Optional[str] = None,
            project_id: Optional[str] = None) -> MongodbEmployeeAccessGrant
    func GetMongodbEmployeeAccessGrant(ctx *Context, name string, id IDInput, state *MongodbEmployeeAccessGrantState, opts ...ResourceOption) (*MongodbEmployeeAccessGrant, error)
    public static MongodbEmployeeAccessGrant Get(string name, Input<string> id, MongodbEmployeeAccessGrantState? state, CustomResourceOptions? opts = null)
    public static MongodbEmployeeAccessGrant get(String name, Output<String> id, MongodbEmployeeAccessGrantState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    ClusterName string
    Human-readable label that identifies this cluster.
    ExpirationTime string
    Expiration date for the employee access grant.
    GrantType string
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    GrantType string
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grantType String
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grantType string
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grant_type str
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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
    Expiration date for the employee access grant.
    grantType String
    Level of access to grant to MongoDB Employees. Possible values are CLUSTERDATABASELOGS, CLUSTERINFRASTRUCTURE or CLUSTERINFRASTRUCTUREANDAPPSERVICESSYNC_DATA.
    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