Skip to content

Commit 080a278

Browse files
committed
add stream live
1 parent 4ddfce3 commit 080a278

File tree

6 files changed

+142
-55
lines changed

6 files changed

+142
-55
lines changed

tencentcloud/provider.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,10 @@ Cloud HDFS(CHDFS)
969969
tencentcloud_chdfs_mount_point
970970
tencentcloud_chdfs_mount_point_attachment
971971
972+
StreamLive(MDL)
973+
Resource
974+
tencentcloud_mdl_stream_live_input
975+
972976
*/
973977
package tencentcloud
974978

@@ -1728,7 +1732,7 @@ func Provider() terraform.ResourceProvider {
17281732
"tencentcloud_chdfs_life_cycle_rule": resourceTencentCloudChdfsLifeCycleRule(),
17291733
"tencentcloud_chdfs_mount_point": resourceTencentCloudChdfsMountPoint(),
17301734
"tencentcloud_chdfs_mount_point_attachment": resourceTencentCloudChdfsMountPointAttachment(),
1731-
"tencentcloud_mdl_streamlive_input": resourceTencentCloudMdlStreamLiveInput(),
1735+
"tencentcloud_mdl_stream_live_input": resourceTencentCloudMdlStreamLiveInput(),
17321736
},
17331737

17341738
ConfigureFunc: providerConfigure,

tencentcloud/resource_tc_mdl_streamlive_input.go renamed to tencentcloud/resource_tc_mdl_stream_live_input.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Provides a resource to create a mdl streamlive_input
44
Example Usage
55
66
```hcl
7-
resource "tencentcloud_mdl_streamlive_input" "streamlive_input" {
7+
resource "tencentcloud_mdl_stream_live_input" "stream_live_input" {
88
name = "terraform_test"
99
type = "RTP_PUSH"
1010
security_group_ids = [
@@ -15,10 +15,10 @@ resource "tencentcloud_mdl_streamlive_input" "streamlive_input" {
1515
1616
Import
1717
18-
mdl streamlive_input can be imported using the id, e.g.
18+
mdl stream_live_input can be imported using the id, e.g.
1919
2020
```
21-
terraform import tencentcloud_mdl_streamlive_input.streamlive_input streamlive_input_id
21+
terraform import tencentcloud_mdl_stream_live_input.stream_live_input id
2222
```
2323
*/
2424
package tencentcloud
@@ -105,7 +105,7 @@ func resourceTencentCloudMdlStreamLiveInput() *schema.Resource {
105105
"input_domain": {
106106
Type: schema.TypeString,
107107
Optional: true,
108-
Description: "The domain of an SRT_PUSH address. If this is a request parameter, you don’t need to specify it.Note: This field may return `null`, indicating that no valid value was found.",
108+
Description: "The domain of an SRT_PUSH address. If this is a request parameter, you do not need to specify it.Note: This field may return `null`, indicating that no valid value was found.",
109109
},
110110
"user_name": {
111111
Type: schema.TypeString,
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package tencentcloud
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
7+
)
8+
9+
func TestAccTencentCloudMdlStreamLiveInputResource_basic(t *testing.T) {
10+
t.Parallel()
11+
resource.Test(t, resource.TestCase{
12+
PreCheck: func() { testAccPreCheckCommon(t, ACCOUNT_TYPE_INTERNATIONAL) },
13+
Providers: testAccProviders,
14+
Steps: []resource.TestStep{
15+
{
16+
Config: testAccMdlStreamLiveInput,
17+
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_mdl_stream_live_input.stream_live_input", "id")),
18+
},
19+
{
20+
Config: testAccMdlStreamLiveInputUpdate,
21+
Check: resource.ComposeTestCheckFunc(
22+
resource.TestCheckResourceAttrSet("tencentcloud_mdl_stream_live_input.stream_live_input", "id"),
23+
resource.TestCheckResourceAttr("tencentcloud_mdl_stream_live_input.stream_live_input", "name", "terraform-for-test"),
24+
),
25+
},
26+
{
27+
ResourceName: "tencentcloud_mdl_stream_live_input.stream_live_input",
28+
ImportState: true,
29+
ImportStateVerify: true,
30+
},
31+
},
32+
})
33+
}
34+
35+
const testAccMdlStreamLiveInput = `
36+
37+
resource "tencentcloud_mdl_stream_live_input" "stream_live_input" {
38+
name = "terraform_test"
39+
type = "RTP_PUSH"
40+
security_group_ids = [
41+
"6405DF9D000007DFB4EC"
42+
]
43+
}
44+
45+
`
46+
47+
const testAccMdlStreamLiveInputUpdate = `
48+
49+
resource "tencentcloud_mdl_stream_live_input" "stream_live_input" {
50+
name = "terraform-for-test"
51+
type = "RTP_PUSH"
52+
security_group_ids = [
53+
"6405DF9D000007DFB4EC"
54+
]
55+
}
56+
57+
`

tencentcloud/resource_tc_mdl_streamlive_input_test.go

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
subcategory: "StreamLive(MDL)"
3+
layout: "tencentcloud"
4+
page_title: "TencentCloud: tencentcloud_mdl_stream_live_input"
5+
sidebar_current: "docs-tencentcloud-resource-mdl_stream_live_input"
6+
description: |-
7+
Provides a resource to create a mdl streamlive_input
8+
---
9+
10+
# tencentcloud_mdl_stream_live_input
11+
12+
Provides a resource to create a mdl streamlive_input
13+
14+
## Example Usage
15+
16+
```hcl
17+
resource "tencentcloud_mdl_stream_live_input" "stream_live_input" {
18+
name = "terraform_test"
19+
type = "RTP_PUSH"
20+
security_group_ids = [
21+
"6405DF9D000007DFB4EC"
22+
]
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
The following arguments are supported:
29+
30+
* `name` - (Required, String) Input name, which can contain 1-32 case-sensitive letters, digits, and underscores and must be unique at the region level.
31+
* `type` - (Required, String, ForceNew) Input typeValid values: `RTMP_PUSH`, `RTP_PUSH`, `UDP_PUSH`, `RTMP_PULL`, `HLS_PULL`, `MP4_PULL`.
32+
* `input_settings` - (Optional, List) Input settings. For the type `RTMP_PUSH`, `RTMP_PULL`, `HLS_PULL`, or `MP4_PULL`, 1 or 2 inputs of the corresponding type can be configured.
33+
* `security_group_ids` - (Optional, Set: [`String`]) ID of the input security group to attachYou can attach only one security group to an input.
34+
35+
The `input_settings` object supports the following:
36+
37+
* `app_name` - (Optional, String) Application name, which is valid if `Type` is `RTMP_PUSH` and can contain 1-32 letters and digitsNote: This field may return `null`, indicating that no valid value was found.
38+
* `delay_time` - (Optional, Int) Delayed time (ms) for playback, which is valid if `Type` is `RTMP_PUSH`Value range: 0 (default) or 10000-600000The value must be a multiple of 1,000.Note: This field may return `null`, indicating that no valid value was found.
39+
* `input_address` - (Optional, String) RTP/UDP input address, which does not need to be entered for the input parameter.Note: this field may return null, indicating that no valid values can be obtained.
40+
* `input_domain` - (Optional, String) The domain of an SRT_PUSH address. If this is a request parameter, you do not need to specify it.Note: This field may return `null`, indicating that no valid value was found.
41+
* `password` - (Optional, String) The password, which is used for authentication.Note: This field may return `null`, indicating that no valid value was found.
42+
* `source_type` - (Optional, String) Source type for stream pulling and relaying. To pull content from private-read COS buckets under the current account, set this parameter to `TencentCOS`; otherwise, leave it empty.Note: this field may return `null`, indicating that no valid value was found.
43+
* `source_url` - (Optional, String) Source URL, which is valid if `Type` is `RTMP_PULL`, `HLS_PULL`, or `MP4_PULL` and can contain 1-512 charactersNote: This field may return `null`, indicating that no valid value was found.
44+
* `stream_name` - (Optional, String) Stream name, which is valid if `Type` is `RTMP_PUSH` and can contain 1-32 letters and digitsNote: This field may return `null`, indicating that no valid value was found.
45+
* `user_name` - (Optional, String) The username, which is used for authentication.Note: This field may return `null`, indicating that no valid value was found.
46+
47+
## Attributes Reference
48+
49+
In addition to all arguments above, the following attributes are exported:
50+
51+
* `id` - ID of the resource.
52+
53+
54+
55+
## Import
56+
57+
mdl stream_live_input can be imported using the id, e.g.
58+
59+
```
60+
terraform import tencentcloud_mdl_stream_live_input.stream_live_input id
61+
```
62+

website/tencentcloud.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,20 @@
17751775
</li>
17761776
</ul>
17771777
</li>
1778+
<li>
1779+
<a href="#">StreamLive(MDL)</a>
1780+
<ul class="nav">
1781+
1782+
<li>
1783+
<a href="#">Resources</a>
1784+
<ul class="nav nav-auto-expand">
1785+
<li>
1786+
<a href="/docs/providers/tencentcloud/r/mdl_stream_live_input.html">tencentcloud_mdl_stream_live_input</a>
1787+
</li>
1788+
</ul>
1789+
</li>
1790+
</ul>
1791+
</li>
17781792
<li>
17791793
<a href="#">TDMQ for CMQ</a>
17801794
<ul class="nav">

0 commit comments

Comments
 (0)