1. Packages
  2. Alicloud Provider
  3. API Docs
  4. mongodb
  5. getAuditPolicies
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.mongodb.getAuditPolicies

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

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

    NOTE: Available in v1.148.0+.

    Example Usage

    Basic Usage

    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);
    
    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)
    
    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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.MongoDB.GetAuditPolicies.Invoke(new()
        {
            DbInstanceId = "example_value",
        });
    
        return new Dictionary<string, object?>
        {
            ["mongodbAuditPolicyId1"] = example.Apply(getAuditPoliciesResult => getAuditPoliciesResult.Policies[0]?.Id),
        };
    });
    
    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()));
        }
    }
    
    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 db instance.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    DbInstanceId string
    The id of the db instance.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    dbInstanceId String
    The id of the db instance.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    dbInstanceId string
    The id of the db instance.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    db_instance_id str
    The id of the db instance.
    output_file str
    File name where to save data source results (after running pulumi preview).
    dbInstanceId String
    The id of the db instance.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    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
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi