Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 09335b8

Browse files
[Partner] Alexander Sokolovalexk53
authored andcommitted
GCLOUD2-6738 faas added
1 parent 4fa8c47 commit 09335b8

19 files changed

+1719
-16
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gcore_faas_function Data Source - terraform-provider-gcorelabs"
4+
subcategory: ""
5+
description: |-
6+
Represent FaaS function
7+
---
8+
9+
# gcore_faas_function (Data Source)
10+
11+
Represent FaaS function
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String)
21+
- `namespace` (String) Namespace of the function
22+
23+
### Optional
24+
25+
- `project_id` (Number)
26+
- `project_name` (String)
27+
- `region_id` (Number)
28+
- `region_name` (String)
29+
30+
### Read-Only
31+
32+
- `build_message` (String)
33+
- `build_status` (String)
34+
- `code_text` (String)
35+
- `created_at` (String)
36+
- `deploy_status` (Map of String)
37+
- `description` (String)
38+
- `endpoint` (String)
39+
- `envs` (Map of String)
40+
- `flavor` (String)
41+
- `id` (String) The ID of this resource.
42+
- `main_method` (String) Main startup method name
43+
- `max_instances` (Number) Autoscaling max number of instances
44+
- `min_instances` (Number) Autoscaling min number of instances
45+
- `runtime` (String)
46+
- `status` (String)
47+
- `timeout` (Number)
48+
49+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gcore_faas_namespace Data Source - terraform-provider-gcorelabs"
4+
subcategory: ""
5+
description: |-
6+
Represent FaaS namespace
7+
---
8+
9+
# gcore_faas_namespace (Data Source)
10+
11+
Represent FaaS namespace
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String)
21+
22+
### Optional
23+
24+
- `project_id` (Number)
25+
- `project_name` (String)
26+
- `region_id` (Number)
27+
- `region_name` (String)
28+
29+
### Read-Only
30+
31+
- `created_at` (String)
32+
- `description` (String)
33+
- `envs` (Map of String)
34+
- `id` (String) The ID of this resource.
35+
- `status` (String)
36+
37+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
```
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gcore_faas_namespace Resource - terraform-provider-gcorelabs"
4+
subcategory: ""
5+
description: |-
6+
Represent FaaS namespace
7+
---
8+
9+
# gcore_faas_namespace (Resource)
10+
11+
Represent FaaS namespace
12+
13+
## Example Usage
14+
15+
```terraform
16+
provider gcore {
17+
permanent_api_token = "251$d3361.............1b35f26d8"
18+
}
19+
20+
resource "gcore_faas_namespace" "ns" {
21+
project_id = 1
22+
region_id = 1
23+
name = "testns"
24+
description = "test description"
25+
envs = {
26+
BIG_ENV = "EXAMPLE"
27+
}
28+
}
29+
```
30+
31+
<!-- schema generated by tfplugindocs -->
32+
## Schema
33+
34+
### Required
35+
36+
- `name` (String)
37+
38+
### Optional
39+
40+
- `description` (String)
41+
- `envs` (Map of String)
42+
- `project_id` (Number)
43+
- `project_name` (String)
44+
- `region_id` (Number)
45+
- `region_name` (String)
46+
47+
### Read-Only
48+
49+
- `created_at` (String)
50+
- `id` (String) The ID of this resource.
51+
- `status` (String)
52+
53+
## Import
54+
55+
Import is supported using the following syntax:
56+
57+
```shell
58+
# import using <project_id>:<region_id>:<namespace_name> format
59+
terraform import gcore_faas_namespace.test 1:6:ns
60+
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# import using <project_id>:<region_id>:<namespace_name><function_name> format
2+
terraform import gcore_faas_function.test 1:6:ns:test_func
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
provider gcore {
2+
permanent_api_token = "251$d3361.............1b35f26d8"
3+
}
4+
5+
resource "gcore_faas_function" "func" {
6+
project_id = 1
7+
region_id = 1
8+
name = "testf"
9+
namespace = "ns4test"
10+
description = "function description"
11+
envs = {
12+
BIG = "EXAMPLE2"
13+
}
14+
runtime = "go1.16.6"
15+
code_text = <<EOF
16+
package kubeless
17+
18+
import (
19+
"github.com/kubeless/kubeless/pkg/functions"
20+
)
21+
22+
func Run(evt functions.Event, ctx functions.Context) (string, error) {
23+
return "Hello World!!", nil
24+
}
25+
EOF
26+
timeout = 5
27+
flavor = "80mCPU-128MB"
28+
main_method = "main"
29+
min_instances = 1
30+
max_instances = 2
31+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# import using <project_id>:<region_id>:<namespace_name> format
2+
terraform import gcore_faas_namespace.test 1:6:ns
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
provider gcore {
2+
permanent_api_token = "251$d3361.............1b35f26d8"
3+
}
4+
5+
resource "gcore_faas_namespace" "ns" {
6+
project_id = 1
7+
region_id = 1
8+
name = "testns"
9+
description = "test description"
10+
envs = {
11+
BIG_ENV = "EXAMPLE"
12+
}
13+
}
14+

0 commit comments

Comments
 (0)