Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.mongodb.getAuditPolicies
Explore with Pulumi AI
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:
- Db
Instance stringId - The id of the db instance.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Db
Instance stringId - The id of the db instance.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- db
Instance StringId - The id of the db instance.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- db
Instance stringId - The id of the db instance.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- db_
instance_ strid - The id of the db instance.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- db
Instance StringId - The id of the db instance.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getAuditPolicies Result
The following output properties are available:
- Db
Instance stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Policies
List<Pulumi.
Ali Cloud. Mongo DB. Outputs. Get Audit Policies Policy> - Output
File string
- Db
Instance stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Policies
[]Get
Audit Policies Policy - Output
File string
- db
Instance StringId - id String
- The provider-assigned unique ID for this managed resource.
- policies
List<Get
Audit Policies Policy> - output
File String
- db
Instance stringId - id string
- The provider-assigned unique ID for this managed resource.
- policies
Get
Audit Policies Policy[] - output
File string
- db_
instance_ strid - id str
- The provider-assigned unique ID for this managed resource.
- policies
Sequence[Get
Audit Policies Policy] - output_
file str
- db
Instance StringId - id String
- The provider-assigned unique ID for this managed resource.
- policies List<Property Map>
- output
File String
Supporting Types
GetAuditPoliciesPolicy
- Audit
Status string - The status of the log audit feature.
- Db
Instance stringId - The ID of the instance.
- Id string
- The ID of the Audit Policy.
- Audit
Status string - The status of the log audit feature.
- Db
Instance stringId - The ID of the instance.
- Id string
- The ID of the Audit Policy.
- audit
Status String - The status of the log audit feature.
- db
Instance StringId - The ID of the instance.
- id String
- The ID of the Audit Policy.
- audit
Status string - The status of the log audit feature.
- db
Instance stringId - 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_ strid - The ID of the instance.
- id str
- The ID of the Audit Policy.
- audit
Status String - The status of the log audit feature.
- db
Instance StringId - 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.