1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. RdsSqlAudit
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.RdsSqlAudit

Explore with Pulumi AI

Manages RDS SQL audit resource within FlexibleEngine.

NOTE: Only MySQL and PostgreSQL engines are supported.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";

const config = new pulumi.Config();
const instanceId = config.requireObject("instanceId");
const test = new flexibleengine.RdsSqlAudit("test", {
    instanceId: instanceId,
    keepDays: 5,
});
Copy
import pulumi
import pulumi_flexibleengine as flexibleengine

config = pulumi.Config()
instance_id = config.require_object("instanceId")
test = flexibleengine.RdsSqlAudit("test",
    instance_id=instance_id,
    keep_days=5)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		instanceId := cfg.RequireObject("instanceId")
		_, err := flexibleengine.NewRdsSqlAudit(ctx, "test", &flexibleengine.RdsSqlAuditArgs{
			InstanceId: pulumi.Any(instanceId),
			KeepDays:   pulumi.Float64(5),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var instanceId = config.RequireObject<dynamic>("instanceId");
    var test = new Flexibleengine.RdsSqlAudit("test", new()
    {
        InstanceId = instanceId,
        KeepDays = 5,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.RdsSqlAudit;
import com.pulumi.flexibleengine.RdsSqlAuditArgs;
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 config = ctx.config();
        final var instanceId = config.get("instanceId");
        var test = new RdsSqlAudit("test", RdsSqlAuditArgs.builder()
            .instanceId(instanceId)
            .keepDays(5)
            .build());

    }
}
Copy
configuration:
  instanceId:
    type: dynamic
resources:
  test:
    type: flexibleengine:RdsSqlAudit
    properties:
      instanceId: ${instanceId}
      keepDays: 5
Copy

Create RdsSqlAudit Resource

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

Constructor syntax

new RdsSqlAudit(name: string, args: RdsSqlAuditArgs, opts?: CustomResourceOptions);
@overload
def RdsSqlAudit(resource_name: str,
                args: RdsSqlAuditArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def RdsSqlAudit(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                instance_id: Optional[str] = None,
                keep_days: Optional[float] = None,
                audit_types: Optional[Sequence[str]] = None,
                rds_sql_audit_id: Optional[str] = None,
                region: Optional[str] = None,
                reserve_auditlogs: Optional[bool] = None,
                timeouts: Optional[RdsSqlAuditTimeoutsArgs] = None)
func NewRdsSqlAudit(ctx *Context, name string, args RdsSqlAuditArgs, opts ...ResourceOption) (*RdsSqlAudit, error)
public RdsSqlAudit(string name, RdsSqlAuditArgs args, CustomResourceOptions? opts = null)
public RdsSqlAudit(String name, RdsSqlAuditArgs args)
public RdsSqlAudit(String name, RdsSqlAuditArgs args, CustomResourceOptions options)
type: flexibleengine:RdsSqlAudit
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RdsSqlAuditArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RdsSqlAuditArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RdsSqlAuditArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RdsSqlAuditArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RdsSqlAuditArgs
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 rdsSqlAuditResource = new Flexibleengine.RdsSqlAudit("rdsSqlAuditResource", new()
{
    InstanceId = "string",
    KeepDays = 0,
    AuditTypes = new[]
    {
        "string",
    },
    RdsSqlAuditId = "string",
    Region = "string",
    ReserveAuditlogs = false,
    Timeouts = new Flexibleengine.Inputs.RdsSqlAuditTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
});
Copy
example, err := flexibleengine.NewRdsSqlAudit(ctx, "rdsSqlAuditResource", &flexibleengine.RdsSqlAuditArgs{
InstanceId: pulumi.String("string"),
KeepDays: pulumi.Float64(0),
AuditTypes: pulumi.StringArray{
pulumi.String("string"),
},
RdsSqlAuditId: pulumi.String("string"),
Region: pulumi.String("string"),
ReserveAuditlogs: pulumi.Bool(false),
Timeouts: &.RdsSqlAuditTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
Copy
var rdsSqlAuditResource = new RdsSqlAudit("rdsSqlAuditResource", RdsSqlAuditArgs.builder()
    .instanceId("string")
    .keepDays(0)
    .auditTypes("string")
    .rdsSqlAuditId("string")
    .region("string")
    .reserveAuditlogs(false)
    .timeouts(RdsSqlAuditTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .build());
Copy
rds_sql_audit_resource = flexibleengine.RdsSqlAudit("rdsSqlAuditResource",
    instance_id="string",
    keep_days=0,
    audit_types=["string"],
    rds_sql_audit_id="string",
    region="string",
    reserve_auditlogs=False,
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    })
Copy
const rdsSqlAuditResource = new flexibleengine.RdsSqlAudit("rdsSqlAuditResource", {
    instanceId: "string",
    keepDays: 0,
    auditTypes: ["string"],
    rdsSqlAuditId: "string",
    region: "string",
    reserveAuditlogs: false,
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
});
Copy
type: flexibleengine:RdsSqlAudit
properties:
    auditTypes:
        - string
    instanceId: string
    keepDays: 0
    rdsSqlAuditId: string
    region: string
    reserveAuditlogs: false
    timeouts:
        create: string
        delete: string
        update: string
Copy

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

InstanceId This property is required. string
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
KeepDays This property is required. double
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
AuditTypes List<string>
Specifies the list of audit types.
RdsSqlAuditId string
The resource ID.
Region string
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
ReserveAuditlogs bool
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
Timeouts RdsSqlAuditTimeouts
InstanceId This property is required. string
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
KeepDays This property is required. float64
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
AuditTypes []string
Specifies the list of audit types.
RdsSqlAuditId string
The resource ID.
Region string
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
ReserveAuditlogs bool
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
Timeouts RdsSqlAuditTimeoutsArgs
instanceId This property is required. String
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keepDays This property is required. Double
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
auditTypes List<String>
Specifies the list of audit types.
rdsSqlAuditId String
The resource ID.
region String
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserveAuditlogs Boolean
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts RdsSqlAuditTimeouts
instanceId This property is required. string
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keepDays This property is required. number
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
auditTypes string[]
Specifies the list of audit types.
rdsSqlAuditId string
The resource ID.
region string
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserveAuditlogs boolean
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts RdsSqlAuditTimeouts
instance_id This property is required. str
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keep_days This property is required. float
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
audit_types Sequence[str]
Specifies the list of audit types.
rds_sql_audit_id str
The resource ID.
region str
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserve_auditlogs bool
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts RdsSqlAuditTimeoutsArgs
instanceId This property is required. String
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keepDays This property is required. Number
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
auditTypes List<String>
Specifies the list of audit types.
rdsSqlAuditId String
The resource ID.
region String
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserveAuditlogs Boolean
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the RdsSqlAudit 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 RdsSqlAudit Resource

Get an existing RdsSqlAudit 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?: RdsSqlAuditState, opts?: CustomResourceOptions): RdsSqlAudit
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        audit_types: Optional[Sequence[str]] = None,
        instance_id: Optional[str] = None,
        keep_days: Optional[float] = None,
        rds_sql_audit_id: Optional[str] = None,
        region: Optional[str] = None,
        reserve_auditlogs: Optional[bool] = None,
        timeouts: Optional[RdsSqlAuditTimeoutsArgs] = None) -> RdsSqlAudit
func GetRdsSqlAudit(ctx *Context, name string, id IDInput, state *RdsSqlAuditState, opts ...ResourceOption) (*RdsSqlAudit, error)
public static RdsSqlAudit Get(string name, Input<string> id, RdsSqlAuditState? state, CustomResourceOptions? opts = null)
public static RdsSqlAudit get(String name, Output<String> id, RdsSqlAuditState state, CustomResourceOptions options)
resources:  _:    type: flexibleengine:RdsSqlAudit    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AuditTypes List<string>
Specifies the list of audit types.
InstanceId string
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
KeepDays double
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
RdsSqlAuditId string
The resource ID.
Region string
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
ReserveAuditlogs bool
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
Timeouts RdsSqlAuditTimeouts
AuditTypes []string
Specifies the list of audit types.
InstanceId string
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
KeepDays float64
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
RdsSqlAuditId string
The resource ID.
Region string
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
ReserveAuditlogs bool
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
Timeouts RdsSqlAuditTimeoutsArgs
auditTypes List<String>
Specifies the list of audit types.
instanceId String
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keepDays Double
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
rdsSqlAuditId String
The resource ID.
region String
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserveAuditlogs Boolean
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts RdsSqlAuditTimeouts
auditTypes string[]
Specifies the list of audit types.
instanceId string
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keepDays number
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
rdsSqlAuditId string
The resource ID.
region string
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserveAuditlogs boolean
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts RdsSqlAuditTimeouts
audit_types Sequence[str]
Specifies the list of audit types.
instance_id str
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keep_days float
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
rds_sql_audit_id str
The resource ID.
region str
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserve_auditlogs bool
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts RdsSqlAuditTimeoutsArgs
auditTypes List<String>
Specifies the list of audit types.
instanceId String
Specifies the ID of the RDS instance. Changing this parameter will create a new resource.
keepDays Number
Specifies the number of days for storing audit logs. Value ranges from 1 to 732.
rdsSqlAuditId String
The resource ID.
region String
Specifies the region in which to create the resource. If omitted, the provider-level region will be used. Changing this parameter will create a new resource.
reserveAuditlogs Boolean
Specifies whether the historical audit logs will be reserved for some time when SQL audit is disabled. It is valid only when SQL audit is disabled.
timeouts Property Map

Supporting Types

RdsSqlAuditTimeouts
, RdsSqlAuditTimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Import

The RDS SQL audit can be imported using the id, e.g.

$ pulumi import flexibleengine:index/rdsSqlAudit:RdsSqlAudit test <id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
License
Notes
This Pulumi package is based on the flexibleengine Terraform Provider.