MongoDB Atlas v3.16.3 published on Friday, Jun 28, 2024 by Pulumi
mongodbatlas.getPushBasedLogExport
Explore with Pulumi AI
mongodbatlas.PushBasedLogExport describes the configured project level settings for the push-based log export feature.
Example Usage
S
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const project_tf = new mongodbatlas.Project("project-tf", {
    name: atlasProjectName,
    orgId: atlasOrgId,
});
// Set up cloud provider access in Atlas using the created IAM role
const setupOnly = new mongodbatlas.CloudProviderAccessSetup("setup_only", {
    projectId: project_tf.id,
    providerName: "AWS",
});
const authRole = new mongodbatlas.CloudProviderAccessAuthorization("auth_role", {
    projectId: project_tf.id,
    roleId: setupOnly.roleId,
    aws: {
        iamAssumedRoleArn: testRole.arn,
    },
});
// Set up push-based log export with authorized IAM role
const testPushBasedLogExport = new mongodbatlas.PushBasedLogExport("test", {
    projectId: project_tf.id,
    bucketName: logBucket.bucket,
    iamRoleId: authRole.roleId,
    prefixPath: "push-based-log-test",
});
const test = mongodbatlas.getPushBasedLogExportOutput({
    projectId: testPushBasedLogExport.projectId,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
project_tf = mongodbatlas.Project("project-tf",
    name=atlas_project_name,
    org_id=atlas_org_id)
# Set up cloud provider access in Atlas using the created IAM role
setup_only = mongodbatlas.CloudProviderAccessSetup("setup_only",
    project_id=project_tf.id,
    provider_name="AWS")
auth_role = mongodbatlas.CloudProviderAccessAuthorization("auth_role",
    project_id=project_tf.id,
    role_id=setup_only.role_id,
    aws=mongodbatlas.CloudProviderAccessAuthorizationAwsArgs(
        iam_assumed_role_arn=test_role["arn"],
    ))
# Set up push-based log export with authorized IAM role
test_push_based_log_export = mongodbatlas.PushBasedLogExport("test",
    project_id=project_tf.id,
    bucket_name=log_bucket["bucket"],
    iam_role_id=auth_role.role_id,
    prefix_path="push-based-log-test")
test = mongodbatlas.get_push_based_log_export_output(project_id=test_push_based_log_export.project_id)
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.NewProject(ctx, "project-tf", &mongodbatlas.ProjectArgs{
			Name:  pulumi.Any(atlasProjectName),
			OrgId: pulumi.Any(atlasOrgId),
		})
		if err != nil {
			return err
		}
		// Set up cloud provider access in Atlas using the created IAM role
		setupOnly, err := mongodbatlas.NewCloudProviderAccessSetup(ctx, "setup_only", &mongodbatlas.CloudProviderAccessSetupArgs{
			ProjectId:    project_tf.ID(),
			ProviderName: pulumi.String("AWS"),
		})
		if err != nil {
			return err
		}
		authRole, err := mongodbatlas.NewCloudProviderAccessAuthorization(ctx, "auth_role", &mongodbatlas.CloudProviderAccessAuthorizationArgs{
			ProjectId: project_tf.ID(),
			RoleId:    setupOnly.RoleId,
			Aws: &mongodbatlas.CloudProviderAccessAuthorizationAwsArgs{
				IamAssumedRoleArn: pulumi.Any(testRole.Arn),
			},
		})
		if err != nil {
			return err
		}
		// Set up push-based log export with authorized IAM role
		testPushBasedLogExport, err := mongodbatlas.NewPushBasedLogExport(ctx, "test", &mongodbatlas.PushBasedLogExportArgs{
			ProjectId:  project_tf.ID(),
			BucketName: pulumi.Any(logBucket.Bucket),
			IamRoleId:  authRole.RoleId,
			PrefixPath: pulumi.String("push-based-log-test"),
		})
		if err != nil {
			return err
		}
		_ = mongodbatlas.LookupPushBasedLogExportOutput(ctx, mongodbatlas.GetPushBasedLogExportOutputArgs{
			ProjectId: testPushBasedLogExport.ProjectId,
		}, nil)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() => 
{
    var project_tf = new Mongodbatlas.Project("project-tf", new()
    {
        Name = atlasProjectName,
        OrgId = atlasOrgId,
    });
    // Set up cloud provider access in Atlas using the created IAM role
    var setupOnly = new Mongodbatlas.CloudProviderAccessSetup("setup_only", new()
    {
        ProjectId = project_tf.Id,
        ProviderName = "AWS",
    });
    var authRole = new Mongodbatlas.CloudProviderAccessAuthorization("auth_role", new()
    {
        ProjectId = project_tf.Id,
        RoleId = setupOnly.RoleId,
        Aws = new Mongodbatlas.Inputs.CloudProviderAccessAuthorizationAwsArgs
        {
            IamAssumedRoleArn = testRole.Arn,
        },
    });
    // Set up push-based log export with authorized IAM role
    var testPushBasedLogExport = new Mongodbatlas.PushBasedLogExport("test", new()
    {
        ProjectId = project_tf.Id,
        BucketName = logBucket.Bucket,
        IamRoleId = authRole.RoleId,
        PrefixPath = "push-based-log-test",
    });
    var test = Mongodbatlas.GetPushBasedLogExport.Invoke(new()
    {
        ProjectId = testPushBasedLogExport.ProjectId,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.Project;
import com.pulumi.mongodbatlas.ProjectArgs;
import com.pulumi.mongodbatlas.CloudProviderAccessSetup;
import com.pulumi.mongodbatlas.CloudProviderAccessSetupArgs;
import com.pulumi.mongodbatlas.CloudProviderAccessAuthorization;
import com.pulumi.mongodbatlas.CloudProviderAccessAuthorizationArgs;
import com.pulumi.mongodbatlas.inputs.CloudProviderAccessAuthorizationAwsArgs;
import com.pulumi.mongodbatlas.PushBasedLogExport;
import com.pulumi.mongodbatlas.PushBasedLogExportArgs;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetPushBasedLogExportArgs;
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 project_tf = new Project("project-tf", ProjectArgs.builder()
            .name(atlasProjectName)
            .orgId(atlasOrgId)
            .build());
        // Set up cloud provider access in Atlas using the created IAM role
        var setupOnly = new CloudProviderAccessSetup("setupOnly", CloudProviderAccessSetupArgs.builder()
            .projectId(project_tf.id())
            .providerName("AWS")
            .build());
        var authRole = new CloudProviderAccessAuthorization("authRole", CloudProviderAccessAuthorizationArgs.builder()
            .projectId(project_tf.id())
            .roleId(setupOnly.roleId())
            .aws(CloudProviderAccessAuthorizationAwsArgs.builder()
                .iamAssumedRoleArn(testRole.arn())
                .build())
            .build());
        // Set up push-based log export with authorized IAM role
        var testPushBasedLogExport = new PushBasedLogExport("testPushBasedLogExport", PushBasedLogExportArgs.builder()
            .projectId(project_tf.id())
            .bucketName(logBucket.bucket())
            .iamRoleId(authRole.roleId())
            .prefixPath("push-based-log-test")
            .build());
        final var test = MongodbatlasFunctions.getPushBasedLogExport(GetPushBasedLogExportArgs.builder()
            .projectId(testPushBasedLogExport.projectId())
            .build());
    }
}
resources:
  project-tf:
    type: mongodbatlas:Project
    properties:
      name: ${atlasProjectName}
      orgId: ${atlasOrgId}
  # Set up cloud provider access in Atlas using the created IAM role
  setupOnly:
    type: mongodbatlas:CloudProviderAccessSetup
    name: setup_only
    properties:
      projectId: ${["project-tf"].id}
      providerName: AWS
  authRole:
    type: mongodbatlas:CloudProviderAccessAuthorization
    name: auth_role
    properties:
      projectId: ${["project-tf"].id}
      roleId: ${setupOnly.roleId}
      aws:
        iamAssumedRoleArn: ${testRole.arn}
  # Set up push-based log export with authorized IAM role
  testPushBasedLogExport:
    type: mongodbatlas:PushBasedLogExport
    name: test
    properties:
      projectId: ${["project-tf"].id}
      bucketName: ${logBucket.bucket}
      iamRoleId: ${authRole.roleId}
      prefixPath: push-based-log-test
variables:
  test:
    fn::invoke:
      Function: mongodbatlas:getPushBasedLogExport
      Arguments:
        projectId: ${testPushBasedLogExport.projectId}
Using getPushBasedLogExport
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 getPushBasedLogExport(args: GetPushBasedLogExportArgs, opts?: InvokeOptions): Promise<GetPushBasedLogExportResult>
function getPushBasedLogExportOutput(args: GetPushBasedLogExportOutputArgs, opts?: InvokeOptions): Output<GetPushBasedLogExportResult>def get_push_based_log_export(project_id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetPushBasedLogExportResult
def get_push_based_log_export_output(project_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetPushBasedLogExportResult]func LookupPushBasedLogExport(ctx *Context, args *LookupPushBasedLogExportArgs, opts ...InvokeOption) (*LookupPushBasedLogExportResult, error)
func LookupPushBasedLogExportOutput(ctx *Context, args *LookupPushBasedLogExportOutputArgs, opts ...InvokeOption) LookupPushBasedLogExportResultOutput> Note: This function is named LookupPushBasedLogExport in the Go SDK.
public static class GetPushBasedLogExport 
{
    public static Task<GetPushBasedLogExportResult> InvokeAsync(GetPushBasedLogExportArgs args, InvokeOptions? opts = null)
    public static Output<GetPushBasedLogExportResult> Invoke(GetPushBasedLogExportInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPushBasedLogExportResult> getPushBasedLogExport(GetPushBasedLogExportArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: mongodbatlas:index/getPushBasedLogExport:getPushBasedLogExport
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Project
Id 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.
 
- Project
Id 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.
 
- project
Id 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.
 
- project
Id 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.
 
- 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.
 
- project
Id 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.
 
getPushBasedLogExport Result
The following output properties are available:
- Bucket
Name string - Create
Date string - Iam
Role stringId  - Id string
 - The provider-assigned unique ID for this managed resource.
 - Prefix
Path string - Project
Id 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.
 - State string
 
- Bucket
Name string - Create
Date string - Iam
Role stringId  - Id string
 - The provider-assigned unique ID for this managed resource.
 - Prefix
Path string - Project
Id 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.
 - State string
 
- bucket
Name String - create
Date String - iam
Role StringId  - id String
 - The provider-assigned unique ID for this managed resource.
 - prefix
Path String - project
Id 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.
 - state String
 
- bucket
Name string - create
Date string - iam
Role stringId  - id string
 - The provider-assigned unique ID for this managed resource.
 - prefix
Path string - project
Id 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.
 - state string
 
- bucket_
name str - create_
date str - iam_
role_ strid  - id str
 - The provider-assigned unique ID for this managed resource.
 - prefix_
path str - 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.
 - state str
 
- bucket
Name String - create
Date String - iam
Role StringId  - id String
 - The provider-assigned unique ID for this managed resource.
 - prefix
Path String - project
Id 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.
 - state String
 
Package Details
- Repository
 - MongoDB Atlas pulumi/pulumi-mongodbatlas
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
mongodbatlasTerraform Provider.