Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getAuditPolicies

This data source provides the Mongodb Audit Policies of the current Alibaba Cloud user.

NOTE: Available in v1.148.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.MongoDB.GetAuditPolicies.InvokeAsync(new AliCloud.MongoDB.GetAuditPoliciesArgs
        {
            DbInstanceId = "example_value",
        }));
        this.MongodbAuditPolicyId1 = example.Apply(example => example.Policies?[0]?.Id);
    }

    [Output("mongodbAuditPolicyId1")]
    public Output<string> MongodbAuditPolicyId1 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := mongodb.GetAuditPolicies(ctx, &mongodb.GetAuditPoliciesArgs{
			DbInstanceId: "example_value",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("mongodbAuditPolicyId1", example.Policies[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mongodb.MongodbFunctions;
import com.pulumi.alicloud.mongodb.inputs.GetAuditPoliciesArgs;
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 example = MongodbFunctions.getAuditPolicies(GetAuditPoliciesArgs.builder()
            .dbInstanceId("example_value")
            .build());

        ctx.export("mongodbAuditPolicyId1", example.applyValue(getAuditPoliciesResult -> getAuditPoliciesResult.policies()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.mongodb.get_audit_policies(db_instance_id="example_value")
pulumi.export("mongodbAuditPolicyId1", example.policies[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.mongodb.getAuditPolicies({
    dbInstanceId: "example_value",
});
export const mongodbAuditPolicyId1 = example.then(example => example.policies?[0]?.id);
variables:
  example:
    Fn::Invoke:
      Function: alicloud:mongodb:getAuditPolicies
      Arguments:
        dbInstanceId: example_value
outputs:
  mongodbAuditPolicyId1: ${example.policies[0].id}

Using getAuditPolicies

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 getAuditPolicies(args: GetAuditPoliciesArgs, opts?: InvokeOptions): Promise<GetAuditPoliciesResult>
function getAuditPoliciesOutput(args: GetAuditPoliciesOutputArgs, opts?: InvokeOptions): Output<GetAuditPoliciesResult>
def get_audit_policies(db_instance_id: Optional[str] = None,
                       output_file: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetAuditPoliciesResult
def get_audit_policies_output(db_instance_id: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetAuditPoliciesResult]
func GetAuditPolicies(ctx *Context, args *GetAuditPoliciesArgs, opts ...InvokeOption) (*GetAuditPoliciesResult, error)
func GetAuditPoliciesOutput(ctx *Context, args *GetAuditPoliciesOutputArgs, opts ...InvokeOption) GetAuditPoliciesResultOutput

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

public static class GetAuditPolicies 
{
    public static Task<GetAuditPoliciesResult> InvokeAsync(GetAuditPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetAuditPoliciesResult> Invoke(GetAuditPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAuditPoliciesResult> getAuditPolicies(GetAuditPoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:mongodb/getAuditPolicies:getAuditPolicies
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DbInstanceId string

The ID of the instance.

OutputFile string
DbInstanceId string

The ID of the instance.

OutputFile string
dbInstanceId String

The ID of the instance.

outputFile String
dbInstanceId string

The ID of the instance.

outputFile string
db_instance_id str

The ID of the instance.

output_file str
dbInstanceId String

The ID of the instance.

outputFile String

getAuditPolicies Result

The following output properties are available:

DbInstanceId string
Id string

The provider-assigned unique ID for this managed resource.

Policies List<Pulumi.AliCloud.MongoDB.Outputs.GetAuditPoliciesPolicy>
OutputFile string
DbInstanceId string
Id string

The provider-assigned unique ID for this managed resource.

Policies []GetAuditPoliciesPolicy
OutputFile string
dbInstanceId String
id String

The provider-assigned unique ID for this managed resource.

policies List<GetAuditPoliciesPolicy>
outputFile String
dbInstanceId string
id string

The provider-assigned unique ID for this managed resource.

policies GetAuditPoliciesPolicy[]
outputFile string
db_instance_id str
id str

The provider-assigned unique ID for this managed resource.

policies Sequence[GetAuditPoliciesPolicy]
output_file str
dbInstanceId String
id String

The provider-assigned unique ID for this managed resource.

policies List<Property Map>
outputFile String

Supporting Types

GetAuditPoliciesPolicy

AuditStatus string

The status of the log audit feature.

DbInstanceId string

The ID of the instance.

Id string

The ID of the Audit Policy.

AuditStatus string

The status of the log audit feature.

DbInstanceId string

The ID of the instance.

Id string

The ID of the Audit Policy.

auditStatus String

The status of the log audit feature.

dbInstanceId String

The ID of the instance.

id String

The ID of the Audit Policy.

auditStatus string

The status of the log audit feature.

dbInstanceId string

The ID of the instance.

id string

The ID of the Audit Policy.

audit_status str

The status of the log audit feature.

db_instance_id str

The ID of the instance.

id str

The ID of the Audit Policy.

auditStatus String

The status of the log audit feature.

dbInstanceId String

The ID of the instance.

id String

The ID of the Audit Policy.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.