tencentcloud.MysqlAuditService
Explore with Pulumi AI
Provides a resource to create a Mysql audit service
Example Usage
If audit_all is true
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.MysqlAuditService("example", {
auditAll: true,
highLogExpireDay: 7,
instanceId: "cdb-3kwa3gfj",
logExpireDay: 30,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.MysqlAuditService("example",
audit_all=True,
high_log_expire_day=7,
instance_id="cdb-3kwa3gfj",
log_expire_day=30)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewMysqlAuditService(ctx, "example", &tencentcloud.MysqlAuditServiceArgs{
AuditAll: pulumi.Bool(true),
HighLogExpireDay: pulumi.Float64(7),
InstanceId: pulumi.String("cdb-3kwa3gfj"),
LogExpireDay: pulumi.Float64(30),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.MysqlAuditService("example", new()
{
AuditAll = true,
HighLogExpireDay = 7,
InstanceId = "cdb-3kwa3gfj",
LogExpireDay = 30,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.MysqlAuditService;
import com.pulumi.tencentcloud.MysqlAuditServiceArgs;
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 example = new MysqlAuditService("example", MysqlAuditServiceArgs.builder()
.auditAll(true)
.highLogExpireDay(7)
.instanceId("cdb-3kwa3gfj")
.logExpireDay(30)
.build());
}
}
resources:
example:
type: tencentcloud:MysqlAuditService
properties:
auditAll: true
highLogExpireDay: 7
instanceId: cdb-3kwa3gfj
logExpireDay: 30
If audit_all is false
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.MysqlAuditService("example", {
auditAll: false,
highLogExpireDay: 7,
instanceId: "cdb-3kwa3gfj",
logExpireDay: 30,
ruleTemplateIds: ["cdb-art-3a9ww0oj"],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.MysqlAuditService("example",
audit_all=False,
high_log_expire_day=7,
instance_id="cdb-3kwa3gfj",
log_expire_day=30,
rule_template_ids=["cdb-art-3a9ww0oj"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewMysqlAuditService(ctx, "example", &tencentcloud.MysqlAuditServiceArgs{
AuditAll: pulumi.Bool(false),
HighLogExpireDay: pulumi.Float64(7),
InstanceId: pulumi.String("cdb-3kwa3gfj"),
LogExpireDay: pulumi.Float64(30),
RuleTemplateIds: pulumi.StringArray{
pulumi.String("cdb-art-3a9ww0oj"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.MysqlAuditService("example", new()
{
AuditAll = false,
HighLogExpireDay = 7,
InstanceId = "cdb-3kwa3gfj",
LogExpireDay = 30,
RuleTemplateIds = new[]
{
"cdb-art-3a9ww0oj",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.MysqlAuditService;
import com.pulumi.tencentcloud.MysqlAuditServiceArgs;
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 example = new MysqlAuditService("example", MysqlAuditServiceArgs.builder()
.auditAll(false)
.highLogExpireDay(7)
.instanceId("cdb-3kwa3gfj")
.logExpireDay(30)
.ruleTemplateIds("cdb-art-3a9ww0oj")
.build());
}
}
resources:
example:
type: tencentcloud:MysqlAuditService
properties:
auditAll: false
highLogExpireDay: 7
instanceId: cdb-3kwa3gfj
logExpireDay: 30
ruleTemplateIds:
- cdb-art-3a9ww0oj
Create MysqlAuditService Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MysqlAuditService(name: string, args: MysqlAuditServiceArgs, opts?: CustomResourceOptions);
@overload
def MysqlAuditService(resource_name: str,
args: MysqlAuditServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MysqlAuditService(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
log_expire_day: Optional[float] = None,
audit_all: Optional[bool] = None,
high_log_expire_day: Optional[float] = None,
mysql_audit_service_id: Optional[str] = None,
rule_template_ids: Optional[Sequence[str]] = None)
func NewMysqlAuditService(ctx *Context, name string, args MysqlAuditServiceArgs, opts ...ResourceOption) (*MysqlAuditService, error)
public MysqlAuditService(string name, MysqlAuditServiceArgs args, CustomResourceOptions? opts = null)
public MysqlAuditService(String name, MysqlAuditServiceArgs args)
public MysqlAuditService(String name, MysqlAuditServiceArgs args, CustomResourceOptions options)
type: tencentcloud:MysqlAuditService
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MysqlAuditServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args MysqlAuditServiceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MysqlAuditServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MysqlAuditServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MysqlAuditServiceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
MysqlAuditService 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 MysqlAuditService resource accepts the following input properties:
- Instance
Id string - TencentDB for MySQL instance ID.
- Log
Expire doubleDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - Audit
All bool - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- High
Log doubleExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - Mysql
Audit stringService Id - ID of the resource.
- Rule
Template List<string>Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- Instance
Id string - TencentDB for MySQL instance ID.
- Log
Expire float64Day - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - Audit
All bool - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- High
Log float64Expire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - Mysql
Audit stringService Id - ID of the resource.
- Rule
Template []stringIds - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- instance
Id String - TencentDB for MySQL instance ID.
- log
Expire DoubleDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - audit
All Boolean - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high
Log DoubleExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - mysql
Audit StringService Id - ID of the resource.
- rule
Template List<String>Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- instance
Id string - TencentDB for MySQL instance ID.
- log
Expire numberDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - audit
All boolean - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high
Log numberExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - mysql
Audit stringService Id - ID of the resource.
- rule
Template string[]Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- instance_
id str - TencentDB for MySQL instance ID.
- log_
expire_ floatday - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - audit_
all bool - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high_
log_ floatexpire_ day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - mysql_
audit_ strservice_ id - ID of the resource.
- rule_
template_ Sequence[str]ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- instance
Id String - TencentDB for MySQL instance ID.
- log
Expire NumberDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - audit
All Boolean - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high
Log NumberExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - mysql
Audit StringService Id - ID of the resource.
- rule
Template List<String>Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
Outputs
All input properties are implicitly available as output properties. Additionally, the MysqlAuditService 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 MysqlAuditService Resource
Get an existing MysqlAuditService 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?: MysqlAuditServiceState, opts?: CustomResourceOptions): MysqlAuditService
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
audit_all: Optional[bool] = None,
high_log_expire_day: Optional[float] = None,
instance_id: Optional[str] = None,
log_expire_day: Optional[float] = None,
mysql_audit_service_id: Optional[str] = None,
rule_template_ids: Optional[Sequence[str]] = None) -> MysqlAuditService
func GetMysqlAuditService(ctx *Context, name string, id IDInput, state *MysqlAuditServiceState, opts ...ResourceOption) (*MysqlAuditService, error)
public static MysqlAuditService Get(string name, Input<string> id, MysqlAuditServiceState? state, CustomResourceOptions? opts = null)
public static MysqlAuditService get(String name, Output<String> id, MysqlAuditServiceState state, CustomResourceOptions options)
resources: _: type: tencentcloud:MysqlAuditService get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Audit
All bool - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- High
Log doubleExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - Instance
Id string - TencentDB for MySQL instance ID.
- Log
Expire doubleDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - Mysql
Audit stringService Id - ID of the resource.
- Rule
Template List<string>Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- Audit
All bool - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- High
Log float64Expire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - Instance
Id string - TencentDB for MySQL instance ID.
- Log
Expire float64Day - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - Mysql
Audit stringService Id - ID of the resource.
- Rule
Template []stringIds - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- audit
All Boolean - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high
Log DoubleExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - instance
Id String - TencentDB for MySQL instance ID.
- log
Expire DoubleDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - mysql
Audit StringService Id - ID of the resource.
- rule
Template List<String>Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- audit
All boolean - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high
Log numberExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - instance
Id string - TencentDB for MySQL instance ID.
- log
Expire numberDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - mysql
Audit stringService Id - ID of the resource.
- rule
Template string[]Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- audit_
all bool - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high_
log_ floatexpire_ day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - instance_
id str - TencentDB for MySQL instance ID.
- log_
expire_ floatday - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - mysql_
audit_ strservice_ id - ID of the resource.
- rule_
template_ Sequence[str]ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
- audit
All Boolean - Audit type. Valid values: true: Record all; false: Record by rules (default value).
- high
Log NumberExpire Day - Retention period of high-frequency audit logs. Valid values:
7
(one week),30
(one month). - instance
Id String - TencentDB for MySQL instance ID.
- log
Expire NumberDay - Retention period of the audit log. Valid values:
7
(one week),30
(one month),90
(three months),180
(six months),365
(one year),1095
(three years),1825
(five years). - mysql
Audit StringService Id - ID of the resource.
- rule
Template List<String>Ids - Rule template ID. If both this parameter and AuditRuleFilters are not specified, all SQL statements will be recorded.
Import
Mysql audit service can be imported using the id, e.g.
$ pulumi import tencentcloud:index/mysqlAuditService:MysqlAuditService example cdb-3kwa3gfj
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.