tencentcloud.EbPutEvents
Explore with Pulumi AI
Provides a resource to create a EB put events
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleEbEventBus = new tencentcloud.EbEventBus("exampleEbEventBus", {
eventBusName: "tf-example",
description: "Event bus description.",
enableStore: false,
saveDays: 1,
tags: {
createdBy: "terraform",
},
});
const exampleEbPutEvents = new tencentcloud.EbPutEvents("exampleEbPutEvents", {
eventBusId: exampleEbEventBus.ebEventBusId,
eventLists: [{
source: "ckafka.cloud.tencent",
data: JSON.stringify({
topic: "test-topic",
Partition: 1,
offset: 37,
msgKey: "test",
msgBody: "Hello from Ckafka again!",
}),
type: "connector:ckafka",
subject: "qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456",
time: 1691572461939,
}],
});
import pulumi
import json
import pulumi_tencentcloud as tencentcloud
example_eb_event_bus = tencentcloud.EbEventBus("exampleEbEventBus",
event_bus_name="tf-example",
description="Event bus description.",
enable_store=False,
save_days=1,
tags={
"createdBy": "terraform",
})
example_eb_put_events = tencentcloud.EbPutEvents("exampleEbPutEvents",
event_bus_id=example_eb_event_bus.eb_event_bus_id,
event_lists=[{
"source": "ckafka.cloud.tencent",
"data": json.dumps({
"topic": "test-topic",
"Partition": 1,
"offset": 37,
"msgKey": "test",
"msgBody": "Hello from Ckafka again!",
}),
"type": "connector:ckafka",
"subject": "qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456",
"time": 1691572461939,
}])
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 {
exampleEbEventBus, err := tencentcloud.NewEbEventBus(ctx, "exampleEbEventBus", &tencentcloud.EbEventBusArgs{
EventBusName: pulumi.String("tf-example"),
Description: pulumi.String("Event bus description."),
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{}{
"topic": "test-topic",
"Partition": 1,
"offset": 37,
"msgKey": "test",
"msgBody": "Hello from Ckafka again!",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = tencentcloud.NewEbPutEvents(ctx, "exampleEbPutEvents", &tencentcloud.EbPutEventsArgs{
EventBusId: exampleEbEventBus.EbEventBusId,
EventLists: tencentcloud.EbPutEventsEventListArray{
&tencentcloud.EbPutEventsEventListArgs{
Source: pulumi.String("ckafka.cloud.tencent"),
Data: pulumi.String(json0),
Type: pulumi.String("connector:ckafka"),
Subject: pulumi.String("qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456"),
Time: pulumi.Float64(1691572461939),
},
},
})
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 exampleEbEventBus = new Tencentcloud.EbEventBus("exampleEbEventBus", new()
{
EventBusName = "tf-example",
Description = "Event bus description.",
EnableStore = false,
SaveDays = 1,
Tags =
{
{ "createdBy", "terraform" },
},
});
var exampleEbPutEvents = new Tencentcloud.EbPutEvents("exampleEbPutEvents", new()
{
EventBusId = exampleEbEventBus.EbEventBusId,
EventLists = new[]
{
new Tencentcloud.Inputs.EbPutEventsEventListArgs
{
Source = "ckafka.cloud.tencent",
Data = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["topic"] = "test-topic",
["Partition"] = 1,
["offset"] = 37,
["msgKey"] = "test",
["msgBody"] = "Hello from Ckafka again!",
}),
Type = "connector:ckafka",
Subject = "qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456",
Time = 1691572461939,
},
},
});
});
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.EbPutEvents;
import com.pulumi.tencentcloud.EbPutEventsArgs;
import com.pulumi.tencentcloud.inputs.EbPutEventsEventListArgs;
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 exampleEbEventBus = new EbEventBus("exampleEbEventBus", EbEventBusArgs.builder()
.eventBusName("tf-example")
.description("Event bus description.")
.enableStore(false)
.saveDays(1)
.tags(Map.of("createdBy", "terraform"))
.build());
var exampleEbPutEvents = new EbPutEvents("exampleEbPutEvents", EbPutEventsArgs.builder()
.eventBusId(exampleEbEventBus.ebEventBusId())
.eventLists(EbPutEventsEventListArgs.builder()
.source("ckafka.cloud.tencent")
.data(serializeJson(
jsonObject(
jsonProperty("topic", "test-topic"),
jsonProperty("Partition", 1),
jsonProperty("offset", 37),
jsonProperty("msgKey", "test"),
jsonProperty("msgBody", "Hello from Ckafka again!")
)))
.type("connector:ckafka")
.subject("qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456")
.time(1691572461939)
.build())
.build());
}
}
resources:
exampleEbEventBus:
type: tencentcloud:EbEventBus
properties:
eventBusName: tf-example
description: Event bus description.
enableStore: false
saveDays: 1
tags:
createdBy: terraform
exampleEbPutEvents:
type: tencentcloud:EbPutEvents
properties:
eventBusId: ${exampleEbEventBus.ebEventBusId}
eventLists:
- source: ckafka.cloud.tencent
data:
fn::toJSON:
topic: test-topic
Partition: 1
offset: 37
msgKey: test
msgBody: Hello from Ckafka again!
type: connector:ckafka
subject: qcs::ckafka:ap-guangzhou:uin/1250000000:ckafkaId/uin/1250000000/ckafka-123456
time: 1.691572461939e+12
Create EbPutEvents Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EbPutEvents(name: string, args: EbPutEventsArgs, opts?: CustomResourceOptions);
@overload
def EbPutEvents(resource_name: str,
args: EbPutEventsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EbPutEvents(resource_name: str,
opts: Optional[ResourceOptions] = None,
event_bus_id: Optional[str] = None,
event_lists: Optional[Sequence[EbPutEventsEventListArgs]] = None,
eb_put_events_id: Optional[str] = None)
func NewEbPutEvents(ctx *Context, name string, args EbPutEventsArgs, opts ...ResourceOption) (*EbPutEvents, error)
public EbPutEvents(string name, EbPutEventsArgs args, CustomResourceOptions? opts = null)
public EbPutEvents(String name, EbPutEventsArgs args)
public EbPutEvents(String name, EbPutEventsArgs args, CustomResourceOptions options)
type: tencentcloud:EbPutEvents
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 EbPutEventsArgs
- 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 EbPutEventsArgs
- 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 EbPutEventsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EbPutEventsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EbPutEventsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
EbPutEvents 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 EbPutEvents resource accepts the following input properties:
- Event
Bus stringId - event bus Id.
- Event
Lists List<EbPut Events Event List> - event list.
- Eb
Put stringEvents Id - ID of the resource.
- Event
Bus stringId - event bus Id.
- Event
Lists []EbPut Events Event List Args - event list.
- Eb
Put stringEvents Id - ID of the resource.
- event
Bus StringId - event bus Id.
- event
Lists List<EbPut Events Event List> - event list.
- eb
Put StringEvents Id - ID of the resource.
- event
Bus stringId - event bus Id.
- event
Lists EbPut Events Event List[] - event list.
- eb
Put stringEvents Id - ID of the resource.
- event_
bus_ strid - event bus Id.
- event_
lists Sequence[EbPut Events Event List Args] - event list.
- eb_
put_ strevents_ id - ID of the resource.
- event
Bus StringId - event bus Id.
- event
Lists List<Property Map> - event list.
- eb
Put StringEvents Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the EbPutEvents 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 EbPutEvents Resource
Get an existing EbPutEvents 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?: EbPutEventsState, opts?: CustomResourceOptions): EbPutEvents
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
eb_put_events_id: Optional[str] = None,
event_bus_id: Optional[str] = None,
event_lists: Optional[Sequence[EbPutEventsEventListArgs]] = None) -> EbPutEvents
func GetEbPutEvents(ctx *Context, name string, id IDInput, state *EbPutEventsState, opts ...ResourceOption) (*EbPutEvents, error)
public static EbPutEvents Get(string name, Input<string> id, EbPutEventsState? state, CustomResourceOptions? opts = null)
public static EbPutEvents get(String name, Output<String> id, EbPutEventsState state, CustomResourceOptions options)
resources: _: type: tencentcloud:EbPutEvents 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.
- Eb
Put stringEvents Id - ID of the resource.
- Event
Bus stringId - event bus Id.
- Event
Lists List<EbPut Events Event List> - event list.
- Eb
Put stringEvents Id - ID of the resource.
- Event
Bus stringId - event bus Id.
- Event
Lists []EbPut Events Event List Args - event list.
- eb
Put StringEvents Id - ID of the resource.
- event
Bus StringId - event bus Id.
- event
Lists List<EbPut Events Event List> - event list.
- eb
Put stringEvents Id - ID of the resource.
- event
Bus stringId - event bus Id.
- event
Lists EbPut Events Event List[] - event list.
- eb_
put_ strevents_ id - ID of the resource.
- event_
bus_ strid - event bus Id.
- event_
lists Sequence[EbPut Events Event List Args] - event list.
- eb
Put StringEvents Id - ID of the resource.
- event
Bus StringId - event bus Id.
- event
Lists List<Property Map> - event list.
Supporting Types
EbPutEventsEventList, EbPutEventsEventListArgs
- Data string
- Event data, the content is controlled by the system that created the event, the current datacontenttype only supports application/json;charset=utf-8, so this field is a json string.
- Source string
- Event source information, new product reporting must comply with EB specifications.
- Subject string
- Detailed description of the event source, customizable, optional. The cloud service defaults to the standard qcs resource representation syntax: qcs::dts:ap-guangzhou:appid/uin:xxx.
- Type string
- Event type, customizable, optional. The cloud service writes COS:Created:PostObject by default, use: to separate the type field.
- Time double
- The timestamp in milliseconds when the event occurred,time.Now().UnixNano()/1e6.
- Data string
- Event data, the content is controlled by the system that created the event, the current datacontenttype only supports application/json;charset=utf-8, so this field is a json string.
- Source string
- Event source information, new product reporting must comply with EB specifications.
- Subject string
- Detailed description of the event source, customizable, optional. The cloud service defaults to the standard qcs resource representation syntax: qcs::dts:ap-guangzhou:appid/uin:xxx.
- Type string
- Event type, customizable, optional. The cloud service writes COS:Created:PostObject by default, use: to separate the type field.
- Time float64
- The timestamp in milliseconds when the event occurred,time.Now().UnixNano()/1e6.
- data String
- Event data, the content is controlled by the system that created the event, the current datacontenttype only supports application/json;charset=utf-8, so this field is a json string.
- source String
- Event source information, new product reporting must comply with EB specifications.
- subject String
- Detailed description of the event source, customizable, optional. The cloud service defaults to the standard qcs resource representation syntax: qcs::dts:ap-guangzhou:appid/uin:xxx.
- type String
- Event type, customizable, optional. The cloud service writes COS:Created:PostObject by default, use: to separate the type field.
- time Double
- The timestamp in milliseconds when the event occurred,time.Now().UnixNano()/1e6.
- data string
- Event data, the content is controlled by the system that created the event, the current datacontenttype only supports application/json;charset=utf-8, so this field is a json string.
- source string
- Event source information, new product reporting must comply with EB specifications.
- subject string
- Detailed description of the event source, customizable, optional. The cloud service defaults to the standard qcs resource representation syntax: qcs::dts:ap-guangzhou:appid/uin:xxx.
- type string
- Event type, customizable, optional. The cloud service writes COS:Created:PostObject by default, use: to separate the type field.
- time number
- The timestamp in milliseconds when the event occurred,time.Now().UnixNano()/1e6.
- data str
- Event data, the content is controlled by the system that created the event, the current datacontenttype only supports application/json;charset=utf-8, so this field is a json string.
- source str
- Event source information, new product reporting must comply with EB specifications.
- subject str
- Detailed description of the event source, customizable, optional. The cloud service defaults to the standard qcs resource representation syntax: qcs::dts:ap-guangzhou:appid/uin:xxx.
- type str
- Event type, customizable, optional. The cloud service writes COS:Created:PostObject by default, use: to separate the type field.
- time float
- The timestamp in milliseconds when the event occurred,time.Now().UnixNano()/1e6.
- data String
- Event data, the content is controlled by the system that created the event, the current datacontenttype only supports application/json;charset=utf-8, so this field is a json string.
- source String
- Event source information, new product reporting must comply with EB specifications.
- subject String
- Detailed description of the event source, customizable, optional. The cloud service defaults to the standard qcs resource representation syntax: qcs::dts:ap-guangzhou:appid/uin:xxx.
- type String
- Event type, customizable, optional. The cloud service writes COS:Created:PostObject by default, use: to separate the type field.
- time Number
- The timestamp in milliseconds when the event occurred,time.Now().UnixNano()/1e6.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.