|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gcore_faas_function Resource - terraform-provider-gcorelabs" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Represent FaaS function |
| 7 | +--- |
| 8 | + |
| 9 | +# gcore_faas_function (Resource) |
| 10 | + |
| 11 | +Represent FaaS function |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +provider gcore { |
| 17 | + permanent_api_token = "251$d3361.............1b35f26d8" |
| 18 | +} |
| 19 | +
|
| 20 | +resource "gcore_faas_function" "func" { |
| 21 | + project_id = 1 |
| 22 | + region_id = 1 |
| 23 | + name = "testf" |
| 24 | + namespace = "ns4test" |
| 25 | + description = "function description" |
| 26 | + envs = { |
| 27 | + BIG = "EXAMPLE2" |
| 28 | + } |
| 29 | + runtime = "go1.16.6" |
| 30 | + code_text = <<EOF |
| 31 | +package kubeless |
| 32 | +
|
| 33 | +import ( |
| 34 | + "github.com/kubeless/kubeless/pkg/functions" |
| 35 | +) |
| 36 | +
|
| 37 | +func Run(evt functions.Event, ctx functions.Context) (string, error) { |
| 38 | + return "Hello World!!", nil |
| 39 | +} |
| 40 | +EOF |
| 41 | + timeout = 5 |
| 42 | + flavor = "80mCPU-128MB" |
| 43 | + main_method = "main" |
| 44 | + min_instances = 1 |
| 45 | + max_instances = 2 |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +<!-- schema generated by tfplugindocs --> |
| 50 | +## Schema |
| 51 | + |
| 52 | +### Required |
| 53 | + |
| 54 | +- `code_text` (String) |
| 55 | +- `flavor` (String) |
| 56 | +- `main_method` (String) Main startup method name |
| 57 | +- `max_instances` (Number) Autoscaling max number of instances |
| 58 | +- `min_instances` (Number) Autoscaling min number of instances |
| 59 | +- `name` (String) |
| 60 | +- `namespace` (String) Namespace of the function |
| 61 | +- `runtime` (String) |
| 62 | +- `timeout` (Number) |
| 63 | + |
| 64 | +### Optional |
| 65 | + |
| 66 | +- `description` (String) |
| 67 | +- `envs` (Map of String) |
| 68 | +- `project_id` (Number) |
| 69 | +- `project_name` (String) |
| 70 | +- `region_id` (Number) |
| 71 | +- `region_name` (String) |
| 72 | + |
| 73 | +### Read-Only |
| 74 | + |
| 75 | +- `build_message` (String) |
| 76 | +- `build_status` (String) |
| 77 | +- `created_at` (String) |
| 78 | +- `deploy_status` (Map of Number) |
| 79 | +- `endpoint` (String) |
| 80 | +- `id` (String) The ID of this resource. |
| 81 | +- `status` (String) |
| 82 | + |
| 83 | +## Import |
| 84 | + |
| 85 | +Import is supported using the following syntax: |
| 86 | + |
| 87 | +```shell |
| 88 | +# import using <project_id>:<region_id>:<namespace_name><function_name> format |
| 89 | +terraform import gcore_faas_function.test 1:6:ns:test_func |
| 90 | +``` |
0 commit comments