Provides a resource to create a CynosDB 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.CynosdbAuditService("example", {
instanceId: "cynosdbmysql-ins-f9j6sopi",
logExpireDay: 30,
highLogExpireDay: 7,
auditAll: true,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.CynosdbAuditService("example",
instance_id="cynosdbmysql-ins-f9j6sopi",
log_expire_day=30,
high_log_expire_day=7,
audit_all=True)
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.NewCynosdbAuditService(ctx, "example", &tencentcloud.CynosdbAuditServiceArgs{
InstanceId: pulumi.String("cynosdbmysql-ins-f9j6sopi"),
LogExpireDay: pulumi.Float64(30),
HighLogExpireDay: pulumi.Float64(7),
AuditAll: pulumi.Bool(true),
})
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.CynosdbAuditService("example", new()
{
InstanceId = "cynosdbmysql-ins-f9j6sopi",
LogExpireDay = 30,
HighLogExpireDay = 7,
AuditAll = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.CynosdbAuditService;
import com.pulumi.tencentcloud.CynosdbAuditServiceArgs;
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 CynosdbAuditService("example", CynosdbAuditServiceArgs.builder()
.instanceId("cynosdbmysql-ins-f9j6sopi")
.logExpireDay(30.0)
.highLogExpireDay(7.0)
.auditAll(true)
.build());
}
}
resources:
example:
type: tencentcloud:CynosdbAuditService
properties:
instanceId: cynosdbmysql-ins-f9j6sopi
logExpireDay: 30
highLogExpireDay: 7
auditAll: true
If audit_all is false
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.CynosdbAuditService("example", {
instanceId: "cynosdbmysql-ins-f9j6sopi",
logExpireDay: 30,
highLogExpireDay: 7,
ruleTemplateIds: ["cynosdb-art-riwq2vx0"],
auditAll: false,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.CynosdbAuditService("example",
instance_id="cynosdbmysql-ins-f9j6sopi",
log_expire_day=30,
high_log_expire_day=7,
rule_template_ids=["cynosdb-art-riwq2vx0"],
audit_all=False)
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.NewCynosdbAuditService(ctx, "example", &tencentcloud.CynosdbAuditServiceArgs{
InstanceId: pulumi.String("cynosdbmysql-ins-f9j6sopi"),
LogExpireDay: pulumi.Float64(30),
HighLogExpireDay: pulumi.Float64(7),
RuleTemplateIds: pulumi.StringArray{
pulumi.String("cynosdb-art-riwq2vx0"),
},
AuditAll: pulumi.Bool(false),
})
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.CynosdbAuditService("example", new()
{
InstanceId = "cynosdbmysql-ins-f9j6sopi",
LogExpireDay = 30,
HighLogExpireDay = 7,
RuleTemplateIds = new[]
{
"cynosdb-art-riwq2vx0",
},
AuditAll = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.CynosdbAuditService;
import com.pulumi.tencentcloud.CynosdbAuditServiceArgs;
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 CynosdbAuditService("example", CynosdbAuditServiceArgs.builder()
.instanceId("cynosdbmysql-ins-f9j6sopi")
.logExpireDay(30.0)
.highLogExpireDay(7.0)
.ruleTemplateIds("cynosdb-art-riwq2vx0")
.auditAll(false)
.build());
}
}
resources:
example:
type: tencentcloud:CynosdbAuditService
properties:
instanceId: cynosdbmysql-ins-f9j6sopi
logExpireDay: 30
highLogExpireDay: 7
ruleTemplateIds:
- cynosdb-art-riwq2vx0
auditAll: false
Create CynosdbAuditService Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CynosdbAuditService(name: string, args: CynosdbAuditServiceArgs, opts?: CustomResourceOptions);@overload
def CynosdbAuditService(resource_name: str,
args: CynosdbAuditServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CynosdbAuditService(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
log_expire_day: Optional[float] = None,
audit_all: Optional[bool] = None,
cynosdb_audit_service_id: Optional[str] = None,
high_log_expire_day: Optional[float] = None,
rule_template_ids: Optional[Sequence[str]] = None)func NewCynosdbAuditService(ctx *Context, name string, args CynosdbAuditServiceArgs, opts ...ResourceOption) (*CynosdbAuditService, error)public CynosdbAuditService(string name, CynosdbAuditServiceArgs args, CustomResourceOptions? opts = null)
public CynosdbAuditService(String name, CynosdbAuditServiceArgs args)
public CynosdbAuditService(String name, CynosdbAuditServiceArgs args, CustomResourceOptions options)
type: tencentcloud:CynosdbAuditService
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 CynosdbAuditServiceArgs
- 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 CynosdbAuditServiceArgs
- 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 CynosdbAuditServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CynosdbAuditServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CynosdbAuditServiceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CynosdbAuditService 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 CynosdbAuditService resource accepts the following input properties:
- Instance
Id string - Instance ID.
- Log
Expire doubleDay - Log retention period.
- Audit
All bool - Audit type. true - full audit; default false - rule-based audit.
- Cynosdb
Audit stringService Id - ID of the resource.
- High
Log doubleExpire Day - Frequent log retention period.
- Rule
Template List<string>Ids - Rule template ID set.
- Instance
Id string - Instance ID.
- Log
Expire float64Day - Log retention period.
- Audit
All bool - Audit type. true - full audit; default false - rule-based audit.
- Cynosdb
Audit stringService Id - ID of the resource.
- High
Log float64Expire Day - Frequent log retention period.
- Rule
Template []stringIds - Rule template ID set.
- instance
Id String - Instance ID.
- log
Expire DoubleDay - Log retention period.
- audit
All Boolean - Audit type. true - full audit; default false - rule-based audit.
- cynosdb
Audit StringService Id - ID of the resource.
- high
Log DoubleExpire Day - Frequent log retention period.
- rule
Template List<String>Ids - Rule template ID set.
- instance
Id string - Instance ID.
- log
Expire numberDay - Log retention period.
- audit
All boolean - Audit type. true - full audit; default false - rule-based audit.
- cynosdb
Audit stringService Id - ID of the resource.
- high
Log numberExpire Day - Frequent log retention period.
- rule
Template string[]Ids - Rule template ID set.
- instance_
id str - Instance ID.
- log_
expire_ floatday - Log retention period.
- audit_
all bool - Audit type. true - full audit; default false - rule-based audit.
- cynosdb_
audit_ strservice_ id - ID of the resource.
- high_
log_ floatexpire_ day - Frequent log retention period.
- rule_
template_ Sequence[str]ids - Rule template ID set.
- instance
Id String - Instance ID.
- log
Expire NumberDay - Log retention period.
- audit
All Boolean - Audit type. true - full audit; default false - rule-based audit.
- cynosdb
Audit StringService Id - ID of the resource.
- high
Log NumberExpire Day - Frequent log retention period.
- rule
Template List<String>Ids - Rule template ID set.
Outputs
All input properties are implicitly available as output properties. Additionally, the CynosdbAuditService 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 CynosdbAuditService Resource
Get an existing CynosdbAuditService 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?: CynosdbAuditServiceState, opts?: CustomResourceOptions): CynosdbAuditService@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
audit_all: Optional[bool] = None,
cynosdb_audit_service_id: Optional[str] = None,
high_log_expire_day: Optional[float] = None,
instance_id: Optional[str] = None,
log_expire_day: Optional[float] = None,
rule_template_ids: Optional[Sequence[str]] = None) -> CynosdbAuditServicefunc GetCynosdbAuditService(ctx *Context, name string, id IDInput, state *CynosdbAuditServiceState, opts ...ResourceOption) (*CynosdbAuditService, error)public static CynosdbAuditService Get(string name, Input<string> id, CynosdbAuditServiceState? state, CustomResourceOptions? opts = null)public static CynosdbAuditService get(String name, Output<String> id, CynosdbAuditServiceState state, CustomResourceOptions options)resources: _: type: tencentcloud:CynosdbAuditService 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. true - full audit; default false - rule-based audit.
- Cynosdb
Audit stringService Id - ID of the resource.
- High
Log doubleExpire Day - Frequent log retention period.
- Instance
Id string - Instance ID.
- Log
Expire doubleDay - Log retention period.
- Rule
Template List<string>Ids - Rule template ID set.
- Audit
All bool - Audit type. true - full audit; default false - rule-based audit.
- Cynosdb
Audit stringService Id - ID of the resource.
- High
Log float64Expire Day - Frequent log retention period.
- Instance
Id string - Instance ID.
- Log
Expire float64Day - Log retention period.
- Rule
Template []stringIds - Rule template ID set.
- audit
All Boolean - Audit type. true - full audit; default false - rule-based audit.
- cynosdb
Audit StringService Id - ID of the resource.
- high
Log DoubleExpire Day - Frequent log retention period.
- instance
Id String - Instance ID.
- log
Expire DoubleDay - Log retention period.
- rule
Template List<String>Ids - Rule template ID set.
- audit
All boolean - Audit type. true - full audit; default false - rule-based audit.
- cynosdb
Audit stringService Id - ID of the resource.
- high
Log numberExpire Day - Frequent log retention period.
- instance
Id string - Instance ID.
- log
Expire numberDay - Log retention period.
- rule
Template string[]Ids - Rule template ID set.
- audit_
all bool - Audit type. true - full audit; default false - rule-based audit.
- cynosdb_
audit_ strservice_ id - ID of the resource.
- high_
log_ floatexpire_ day - Frequent log retention period.
- instance_
id str - Instance ID.
- log_
expire_ floatday - Log retention period.
- rule_
template_ Sequence[str]ids - Rule template ID set.
- audit
All Boolean - Audit type. true - full audit; default false - rule-based audit.
- cynosdb
Audit StringService Id - ID of the resource.
- high
Log NumberExpire Day - Frequent log retention period.
- instance
Id String - Instance ID.
- log
Expire NumberDay - Log retention period.
- rule
Template List<String>Ids - Rule template ID set.
Import
CynosDB audit service can be imported using the id, e.g.
$ pulumi import tencentcloud:index/cynosdbAuditService:CynosdbAuditService example cynosdbmysql-ins-f9j6sopi
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
tencentcloudTerraform Provider.
