Skip to content

Commit

Permalink
docs: Improves example for fcv3_trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenHanZhang committed Dec 11, 2024
1 parent 4fc0c65 commit cdf2e20
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions website/docs/r/fcv3_trigger.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,62 @@ resource "alicloud_fcv3_trigger" "default" {
}
```

HTTP Trigger

```terraform
variable "name" {
default = "terraform-example"
}
provider "alicloud" {
region = "cn-hangzhou"
}
variable "function_name" {
default = "TerraformTriggerResourceAPI"
}
variable "trigger_name" {
default = "TerraformTrigger_HTTP"
}
resource "alicloud_fcv3_function" "function" {
memory_size = "512"
cpu = 0.5
handler = "index.Handler"
code {
zip_file = "UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA="
}
function_name = var.name
runtime = "python3.9"
disk_size = "512"
log_config {
log_begin_rule = "None"
}
}
data "alicloud_account" "current" {
}
resource "alicloud_fcv3_trigger" "default" {
trigger_type = "http"
trigger_name = var.name
description = "create"
qualifier = "LATEST"
trigger_config = jsonencode({ "authType" : "anonymous", "methods" : ["GET", "POST"] })
function_name = alicloud_fcv3_function.function.function_name
}
output "output_calicloud_fcv3_trigger_internet" {
value = resource.alicloud_fcv3_trigger.default.http_trigger[0].url_internet
}
output "output_calicloud_fcv3_trigger_intranet" {
value = resource.alicloud_fcv3_trigger.default.http_trigger[0].url_intranet
}
```

## Argument Reference

The following arguments are supported:
Expand Down

0 comments on commit cdf2e20

Please sign in to comment.