Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tencentcloud/resource_tc_scf_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func resourceTencentCloudScfFunction() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Indicates whether public net config enabled.",
Description: "Indicates whether public net config enabled. NOTE: only `vpc_id` specified can disable public net config.",
},
"enable_eip_config": {
Type: schema.TypeBool,
Expand Down
29 changes: 19 additions & 10 deletions tencentcloud/resource_tc_scf_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func TestAccTencentCloudScfFunction_basic(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "subnet_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "namespace", "default"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "role", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_logset_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_topic_id", ""),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_logset_id"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_topic_id"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "l5_enable", "false"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "zip_file"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "triggers.#", "0"),
Expand Down Expand Up @@ -122,8 +122,8 @@ func TestAccTencentCloudScfFunction_cos(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "subnet_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "namespace", "default"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "role", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_logset_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_topic_id", ""),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_logset_id"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_topic_id"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "l5_enable", "false"),
resource.TestCheckNoResourceAttr("tencentcloud_scf_function.foo", "zip_file"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cos_bucket_name"),
Expand Down Expand Up @@ -186,8 +186,8 @@ func TestAccTencentCloudScfFunction_role(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "subnet_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "namespace", "default"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "role", "scf-role-test"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_logset_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_topic_id", ""),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_logset_id"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_topic_id"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "l5_enable", "false"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "zip_file"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "modify_time"),
Expand Down Expand Up @@ -246,8 +246,8 @@ func TestAccTencentCloudScfFunction_trigger(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "subnet_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "namespace", "default"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "role", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_logset_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_topic_id", ""),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_logset_id"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_topic_id"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "l5_enable", "false"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "zip_file"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "triggers.#", "2"),
Expand Down Expand Up @@ -316,8 +316,8 @@ func TestAccTencentCloudScfFunction_customNamespace(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "subnet_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "namespace", "ci-test-scf"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "role", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_logset_id", ""),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "cls_topic_id", ""),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_logset_id"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "cls_topic_id"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "l5_enable", "false"),
resource.TestCheckResourceAttrSet("tencentcloud_scf_function.foo", "zip_file"),
resource.TestCheckResourceAttr("tencentcloud_scf_function.foo", "triggers.#", "0"),
Expand Down Expand Up @@ -434,6 +434,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "%s"
handler = "first.do_it_first"
runtime = "Python3.6"
enable_public_net = true

zip_file = "%s"

Expand All @@ -449,6 +450,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "%s"
handler = "second.do_it_second"
runtime = "Python3.6"
enable_public_net = true

description = "test"
mem_size = 1536
Expand Down Expand Up @@ -487,6 +489,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "ci-test-function-cos"
handler = "first.do_it_first"
runtime = "Python3.6"
enable_public_net = true

cos_bucket_name = tencentcloud_cos_bucket.foo.id
cos_object_name = tencentcloud_cos_bucket_object.myobject.key
Expand Down Expand Up @@ -524,6 +527,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "%s"
handler = "first.do_it_first"
runtime = "Python3.6"
enable_public_net = true

cos_bucket_name = tencentcloud_cos_bucket.bar.id
cos_object_name = tencentcloud_cos_bucket_object.bar.key
Expand Down Expand Up @@ -559,6 +563,7 @@ resource "tencentcloud_scf_function" "foo" {
handler = "first.do_it_first"
runtime = "Python3.6"
role = tencentcloud_cam_role.foo.name
enable_public_net = true

zip_file = "%s"
}
Expand Down Expand Up @@ -599,6 +604,7 @@ resource "tencentcloud_scf_function" "foo" {
handler = "first.do_it_first"
runtime = "Python3.6"
role = tencentcloud_cam_role.bar.name
enable_public_net = true

zip_file = "%s"
}
Expand All @@ -614,6 +620,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "%s"
handler = "first.do_it_first"
runtime = "Python3.6"
enable_public_net = true

zip_file = "%s"

Expand Down Expand Up @@ -647,6 +654,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "%s"
handler = "first.do_it_first"
runtime = "Python3.6"
enable_public_net = true

zip_file = "%s"

Expand Down Expand Up @@ -676,6 +684,7 @@ resource "tencentcloud_scf_function" "foo" {
name = "%s"
handler = "first.do_it_first"
runtime = "Python3.6"
enable_public_net = true

zip_file = "%s"
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/scf_function.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following arguments are supported:
* `cos_object_name` - (Optional) Cos object name of the SCF function, should have suffix `.zip` or `.jar`, conflict with `zip_file`.
* `description` - (Optional) Description of the SCF function. Description supports English letters, numbers, spaces, commas, newlines, periods and Chinese, the maximum length is 1000.
* `enable_eip_config` - (Optional) Indicates whether EIP config set to `ENABLE` when `enable_public_net` was true.
* `enable_public_net` - (Optional) Indicates whether public net config enabled.
* `enable_public_net` - (Optional) Indicates whether public net config enabled. NOTE: only `vpc_id` specified can disable public net config.
* `environment` - (Optional) Environment of the SCF function.
* `image_config` - (Optional) Image of the SCF function, conflict with ``.
* `l5_enable` - (Optional) Enable L5 for SCF function, default is `false`.
Expand Down