tencentcloud.EbEventRule
Explore with Pulumi AI
Provides a resource to create a eb event_rule
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const foo = new tencentcloud.EbEventBus("foo", {
eventBusName: "tf-event_bus",
description: "event bus desc",
enableStore: false,
saveDays: 1,
tags: {
createdBy: "terraform",
},
});
const eventRule = new tencentcloud.EbEventRule("eventRule", {
eventBusId: foo.ebEventBusId,
ruleName: "tf-event_rule",
description: "event rule desc",
enable: true,
eventPattern: JSON.stringify({
source: "apigw.cloud.tencent",
type: ["connector:apigw"],
}),
tags: {
createdBy: "terraform",
},
});
import pulumi
import json
import pulumi_tencentcloud as tencentcloud
foo = tencentcloud.EbEventBus("foo",
event_bus_name="tf-event_bus",
description="event bus desc",
enable_store=False,
save_days=1,
tags={
"createdBy": "terraform",
})
event_rule = tencentcloud.EbEventRule("eventRule",
event_bus_id=foo.eb_event_bus_id,
rule_name="tf-event_rule",
description="event rule desc",
enable=True,
event_pattern=json.dumps({
"source": "apigw.cloud.tencent",
"type": ["connector:apigw"],
}),
tags={
"createdBy": "terraform",
})
package main
import (
"encoding/json"
"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 {
foo, err := tencentcloud.NewEbEventBus(ctx, "foo", &tencentcloud.EbEventBusArgs{
EventBusName: pulumi.String("tf-event_bus"),
Description: pulumi.String("event bus desc"),
EnableStore: pulumi.Bool(false),
SaveDays: pulumi.Float64(1),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("terraform"),
},
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"source": "apigw.cloud.tencent",
"type": []string{
"connector:apigw",
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = tencentcloud.NewEbEventRule(ctx, "eventRule", &tencentcloud.EbEventRuleArgs{
EventBusId: foo.EbEventBusId,
RuleName: pulumi.String("tf-event_rule"),
Description: pulumi.String("event rule desc"),
Enable: pulumi.Bool(true),
EventPattern: pulumi.String(json0),
Tags: pulumi.StringMap{
"createdBy": pulumi.String("terraform"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var foo = new Tencentcloud.EbEventBus("foo", new()
{
EventBusName = "tf-event_bus",
Description = "event bus desc",
EnableStore = false,
SaveDays = 1,
Tags =
{
{ "createdBy", "terraform" },
},
});
var eventRule = new Tencentcloud.EbEventRule("eventRule", new()
{
EventBusId = foo.EbEventBusId,
RuleName = "tf-event_rule",
Description = "event rule desc",
Enable = true,
EventPattern = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["source"] = "apigw.cloud.tencent",
["type"] = new[]
{
"connector:apigw",
},
}),
Tags =
{
{ "createdBy", "terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.EbEventBus;
import com.pulumi.tencentcloud.EbEventBusArgs;
import com.pulumi.tencentcloud.EbEventRule;
import com.pulumi.tencentcloud.EbEventRuleArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 foo = new EbEventBus("foo", EbEventBusArgs.builder()
.eventBusName("tf-event_bus")
.description("event bus desc")
.enableStore(false)
.saveDays(1)
.tags(Map.of("createdBy", "terraform"))
.build());
var eventRule = new EbEventRule("eventRule", EbEventRuleArgs.builder()
.eventBusId(foo.ebEventBusId())
.ruleName("tf-event_rule")
.description("event rule desc")
.enable(true)
.eventPattern(serializeJson(
jsonObject(
jsonProperty("source", "apigw.cloud.tencent"),
jsonProperty("type", jsonArray("connector:apigw"))
)))
.tags(Map.of("createdBy", "terraform"))
.build());
}
}
resources:
foo:
type: tencentcloud:EbEventBus
properties:
eventBusName: tf-event_bus
description: event bus desc
enableStore: false
saveDays: 1
tags:
createdBy: terraform
eventRule:
type: tencentcloud:EbEventRule
properties:
eventBusId: ${foo.ebEventBusId}
ruleName: tf-event_rule
description: event rule desc
enable: true
eventPattern:
fn::toJSON:
source: apigw.cloud.tencent
type:
- connector:apigw
tags:
createdBy: terraform
Create EbEventRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EbEventRule(name: string, args: EbEventRuleArgs, opts?: CustomResourceOptions);
@overload
def EbEventRule(resource_name: str,
args: EbEventRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EbEventRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
event_bus_id: Optional[str] = None,
event_pattern: Optional[str] = None,
rule_name: Optional[str] = None,
description: Optional[str] = None,
eb_event_rule_id: Optional[str] = None,
enable: Optional[bool] = None,
tags: Optional[Mapping[str, str]] = None)
func NewEbEventRule(ctx *Context, name string, args EbEventRuleArgs, opts ...ResourceOption) (*EbEventRule, error)
public EbEventRule(string name, EbEventRuleArgs args, CustomResourceOptions? opts = null)
public EbEventRule(String name, EbEventRuleArgs args)
public EbEventRule(String name, EbEventRuleArgs args, CustomResourceOptions options)
type: tencentcloud:EbEventRule
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 EbEventRuleArgs
- 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 EbEventRuleArgs
- 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 EbEventRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EbEventRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EbEventRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
EbEventRule 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 EbEventRule resource accepts the following input properties:
- Event
Bus stringId - event bus Id.
- Event
Pattern string - Reference: Event Mode.
- Rule
Name string - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- Description string
- Event set description, unlimited character type, description within 200 characters.
- Eb
Event stringRule Id - ID of the resource.
- Enable bool
- Enable switch.
- Dictionary<string, string>
- Tag description list.
- Event
Bus stringId - event bus Id.
- Event
Pattern string - Reference: Event Mode.
- Rule
Name string - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- Description string
- Event set description, unlimited character type, description within 200 characters.
- Eb
Event stringRule Id - ID of the resource.
- Enable bool
- Enable switch.
- map[string]string
- Tag description list.
- event
Bus StringId - event bus Id.
- event
Pattern String - Reference: Event Mode.
- rule
Name String - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- description String
- Event set description, unlimited character type, description within 200 characters.
- eb
Event StringRule Id - ID of the resource.
- enable Boolean
- Enable switch.
- Map<String,String>
- Tag description list.
- event
Bus stringId - event bus Id.
- event
Pattern string - Reference: Event Mode.
- rule
Name string - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- description string
- Event set description, unlimited character type, description within 200 characters.
- eb
Event stringRule Id - ID of the resource.
- enable boolean
- Enable switch.
- {[key: string]: string}
- Tag description list.
- event_
bus_ strid - event bus Id.
- event_
pattern str - Reference: Event Mode.
- rule_
name str - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- description str
- Event set description, unlimited character type, description within 200 characters.
- eb_
event_ strrule_ id - ID of the resource.
- enable bool
- Enable switch.
- Mapping[str, str]
- Tag description list.
- event
Bus StringId - event bus Id.
- event
Pattern String - Reference: Event Mode.
- rule
Name String - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- description String
- Event set description, unlimited character type, description within 200 characters.
- eb
Event StringRule Id - ID of the resource.
- enable Boolean
- Enable switch.
- Map<String>
- Tag description list.
Outputs
All input properties are implicitly available as output properties. Additionally, the EbEventRule resource produces the following output properties:
Look up Existing EbEventRule Resource
Get an existing EbEventRule 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?: EbEventRuleState, opts?: CustomResourceOptions): EbEventRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
eb_event_rule_id: Optional[str] = None,
enable: Optional[bool] = None,
event_bus_id: Optional[str] = None,
event_pattern: Optional[str] = None,
rule_id: Optional[str] = None,
rule_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None) -> EbEventRule
func GetEbEventRule(ctx *Context, name string, id IDInput, state *EbEventRuleState, opts ...ResourceOption) (*EbEventRule, error)
public static EbEventRule Get(string name, Input<string> id, EbEventRuleState? state, CustomResourceOptions? opts = null)
public static EbEventRule get(String name, Output<String> id, EbEventRuleState state, CustomResourceOptions options)
resources: _: type: tencentcloud:EbEventRule 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.
- Description string
- Event set description, unlimited character type, description within 200 characters.
- Eb
Event stringRule Id - ID of the resource.
- Enable bool
- Enable switch.
- Event
Bus stringId - event bus Id.
- Event
Pattern string - Reference: Event Mode.
- Rule
Id string - event rule id.
- Rule
Name string - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- Dictionary<string, string>
- Tag description list.
- Description string
- Event set description, unlimited character type, description within 200 characters.
- Eb
Event stringRule Id - ID of the resource.
- Enable bool
- Enable switch.
- Event
Bus stringId - event bus Id.
- Event
Pattern string - Reference: Event Mode.
- Rule
Id string - event rule id.
- Rule
Name string - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- map[string]string
- Tag description list.
- description String
- Event set description, unlimited character type, description within 200 characters.
- eb
Event StringRule Id - ID of the resource.
- enable Boolean
- Enable switch.
- event
Bus StringId - event bus Id.
- event
Pattern String - Reference: Event Mode.
- rule
Id String - event rule id.
- rule
Name String - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- Map<String,String>
- Tag description list.
- description string
- Event set description, unlimited character type, description within 200 characters.
- eb
Event stringRule Id - ID of the resource.
- enable boolean
- Enable switch.
- event
Bus stringId - event bus Id.
- event
Pattern string - Reference: Event Mode.
- rule
Id string - event rule id.
- rule
Name string - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- {[key: string]: string}
- Tag description list.
- description str
- Event set description, unlimited character type, description within 200 characters.
- eb_
event_ strrule_ id - ID of the resource.
- enable bool
- Enable switch.
- event_
bus_ strid - event bus Id.
- event_
pattern str - Reference: Event Mode.
- rule_
id str - event rule id.
- rule_
name str - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- Mapping[str, str]
- Tag description list.
- description String
- Event set description, unlimited character type, description within 200 characters.
- eb
Event StringRule Id - ID of the resource.
- enable Boolean
- Enable switch.
- event
Bus StringId - event bus Id.
- event
Pattern String - Reference: Event Mode.
- rule
Id String - event rule id.
- rule
Name String - Event rule name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a number or letter, 2~60 characters.
- Map<String>
- Tag description list.
Import
eb event_rule can be imported using the id, e.g.
$ pulumi import tencentcloud:index/ebEventRule:EbEventRule event_rule event_rule_id
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.