flexibleengine.FgsFunction
Explore with Pulumi AI
Manages a Function resource within FlexibleEngine.
Example Usage
With base64 func code
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const f1 = new flexibleengine.FgsFunction("f1", {
agency: "test",
app: "default",
codeType: "inline",
description: "fuction test",
funcCode: "aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=",
handler: "test.handler",
memorySize: 128,
runtime: "Python2.7",
timeout: 3,
});
import pulumi
import pulumi_flexibleengine as flexibleengine
f1 = flexibleengine.FgsFunction("f1",
agency="test",
app="default",
code_type="inline",
description="fuction test",
func_code="aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=",
handler="test.handler",
memory_size=128,
runtime="Python2.7",
timeout=3)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewFgsFunction(ctx, "f1", &flexibleengine.FgsFunctionArgs{
Agency: pulumi.String("test"),
App: pulumi.String("default"),
CodeType: pulumi.String("inline"),
Description: pulumi.String("fuction test"),
FuncCode: pulumi.String("aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ="),
Handler: pulumi.String("test.handler"),
MemorySize: pulumi.Float64(128),
Runtime: pulumi.String("Python2.7"),
Timeout: pulumi.Float64(3),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var f1 = new Flexibleengine.FgsFunction("f1", new()
{
Agency = "test",
App = "default",
CodeType = "inline",
Description = "fuction test",
FuncCode = "aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=",
Handler = "test.handler",
MemorySize = 128,
Runtime = "Python2.7",
Timeout = 3,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.FgsFunction;
import com.pulumi.flexibleengine.FgsFunctionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var f1 = new FgsFunction("f1", FgsFunctionArgs.builder()
.agency("test")
.app("default")
.codeType("inline")
.description("fuction test")
.funcCode("aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=")
.handler("test.handler")
.memorySize(128)
.runtime("Python2.7")
.timeout(3)
.build());
}
}
resources:
f1:
type: flexibleengine:FgsFunction
properties:
agency: test
app: default
codeType: inline
description: fuction test
funcCode: aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=
handler: test.handler
memorySize: 128
runtime: Python2.7
timeout: 3
With text code
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const f1 = new flexibleengine.FgsFunction("f1", {
agency: "test",
app: "default",
codeType: "inline",
description: "fuction test",
funcCode: `# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
"statusCode": 200,
"isBase64Encoded": False,
"body": json.dumps(event),
"headers": {
"Content-Type": "application/json"
}
}
`,
handler: "test.handler",
memorySize: 128,
runtime: "Python2.7",
timeout: 3,
});
import pulumi
import pulumi_flexibleengine as flexibleengine
f1 = flexibleengine.FgsFunction("f1",
agency="test",
app="default",
code_type="inline",
description="fuction test",
func_code="""# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
"statusCode": 200,
"isBase64Encoded": False,
"body": json.dumps(event),
"headers": {
"Content-Type": "application/json"
}
}
""",
handler="test.handler",
memory_size=128,
runtime="Python2.7",
timeout=3)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewFgsFunction(ctx, "f1", &flexibleengine.FgsFunctionArgs{
Agency: pulumi.String("test"),
App: pulumi.String("default"),
CodeType: pulumi.String("inline"),
Description: pulumi.String("fuction test"),
FuncCode: pulumi.String(`# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
"statusCode": 200,
"isBase64Encoded": False,
"body": json.dumps(event),
"headers": {
"Content-Type": "application/json"
}
}
`),
Handler: pulumi.String("test.handler"),
MemorySize: pulumi.Float64(128),
Runtime: pulumi.String("Python2.7"),
Timeout: pulumi.Float64(3),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var f1 = new Flexibleengine.FgsFunction("f1", new()
{
Agency = "test",
App = "default",
CodeType = "inline",
Description = "fuction test",
FuncCode = @"# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
""statusCode"": 200,
""isBase64Encoded"": False,
""body"": json.dumps(event),
""headers"": {
""Content-Type"": ""application/json""
}
}
",
Handler = "test.handler",
MemorySize = 128,
Runtime = "Python2.7",
Timeout = 3,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.FgsFunction;
import com.pulumi.flexibleengine.FgsFunctionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var f1 = new FgsFunction("f1", FgsFunctionArgs.builder()
.agency("test")
.app("default")
.codeType("inline")
.description("fuction test")
.funcCode("""
# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
"statusCode": 200,
"isBase64Encoded": False,
"body": json.dumps(event),
"headers": {
"Content-Type": "application/json"
}
}
""")
.handler("test.handler")
.memorySize(128)
.runtime("Python2.7")
.timeout(3)
.build());
}
}
resources:
f1:
type: flexibleengine:FgsFunction
properties:
agency: test
app: default
codeType: inline
description: fuction test
funcCode: |+
# -*- coding:utf-8 -*-
import json
def handler (event, context):
return {
"statusCode": 200,
"isBase64Encoded": False,
"body": json.dumps(event),
"headers": {
"Content-Type": "application/json"
}
}
handler: test.handler
memorySize: 128
runtime: Python2.7
timeout: 3
With agency, vpc, subnet and func_mounts
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const exampleVpc = new flexibleengine.VpcV1("exampleVpc", {cidr: "192.168.0.0/16"});
const exampleSubnet = new flexibleengine.VpcSubnetV1("exampleSubnet", {
cidr: "192.168.1.0/24",
gatewayIp: "192.168.1.1",
vpcId: flexibleengine_vpc_v1.test.id,
});
const testSfsFileSystemV2 = new flexibleengine.SfsFileSystemV2("testSfsFileSystemV2", {
shareProto: "NFS",
size: 10,
description: "test sfs for fgs",
});
const testIdentityAgencyV3 = new flexibleengine.IdentityAgencyV3("testIdentityAgencyV3", {
description: "test agency for fgs",
delegatedServiceName: "op_svc_cff",
projectRoles: [{
project: "eu-west-0",
roles: [
"VPC Administrator",
"SFS Administrator",
],
}],
});
const testFgsFunction = new flexibleengine.FgsFunction("testFgsFunction", {
"package": "default",
description: "fuction test",
handler: "test.handler",
memorySize: 128,
timeout: 3,
runtime: "Python2.7",
codeType: "inline",
funcCode: "aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=",
agency: testIdentityAgencyV3.name,
vpcId: flexibleengine_vpc_v1.test.id,
networkId: flexibleengine_vpc_subnet_v1.test.id,
funcMounts: [{
mountType: "sfs",
mountResource: testSfsFileSystemV2.sfsFileSystemV2Id,
mountSharePath: testSfsFileSystemV2.exportLocation,
localMountPath: "/mnt",
}],
});
import pulumi
import pulumi_flexibleengine as flexibleengine
example_vpc = flexibleengine.VpcV1("exampleVpc", cidr="192.168.0.0/16")
example_subnet = flexibleengine.VpcSubnetV1("exampleSubnet",
cidr="192.168.1.0/24",
gateway_ip="192.168.1.1",
vpc_id=flexibleengine_vpc_v1["test"]["id"])
test_sfs_file_system_v2 = flexibleengine.SfsFileSystemV2("testSfsFileSystemV2",
share_proto="NFS",
size=10,
description="test sfs for fgs")
test_identity_agency_v3 = flexibleengine.IdentityAgencyV3("testIdentityAgencyV3",
description="test agency for fgs",
delegated_service_name="op_svc_cff",
project_roles=[{
"project": "eu-west-0",
"roles": [
"VPC Administrator",
"SFS Administrator",
],
}])
test_fgs_function = flexibleengine.FgsFunction("testFgsFunction",
package="default",
description="fuction test",
handler="test.handler",
memory_size=128,
timeout=3,
runtime="Python2.7",
code_type="inline",
func_code="aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=",
agency=test_identity_agency_v3.name,
vpc_id=flexibleengine_vpc_v1["test"]["id"],
network_id=flexibleengine_vpc_subnet_v1["test"]["id"],
func_mounts=[{
"mount_type": "sfs",
"mount_resource": test_sfs_file_system_v2.sfs_file_system_v2_id,
"mount_share_path": test_sfs_file_system_v2.export_location,
"local_mount_path": "/mnt",
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewVpcV1(ctx, "exampleVpc", &flexibleengine.VpcV1Args{
Cidr: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
_, err = flexibleengine.NewVpcSubnetV1(ctx, "exampleSubnet", &flexibleengine.VpcSubnetV1Args{
Cidr: pulumi.String("192.168.1.0/24"),
GatewayIp: pulumi.String("192.168.1.1"),
VpcId: pulumi.Any(flexibleengine_vpc_v1.Test.Id),
})
if err != nil {
return err
}
testSfsFileSystemV2, err := flexibleengine.NewSfsFileSystemV2(ctx, "testSfsFileSystemV2", &flexibleengine.SfsFileSystemV2Args{
ShareProto: pulumi.String("NFS"),
Size: pulumi.Float64(10),
Description: pulumi.String("test sfs for fgs"),
})
if err != nil {
return err
}
testIdentityAgencyV3, err := flexibleengine.NewIdentityAgencyV3(ctx, "testIdentityAgencyV3", &flexibleengine.IdentityAgencyV3Args{
Description: pulumi.String("test agency for fgs"),
DelegatedServiceName: pulumi.String("op_svc_cff"),
ProjectRoles: flexibleengine.IdentityAgencyV3ProjectRoleArray{
&flexibleengine.IdentityAgencyV3ProjectRoleArgs{
Project: pulumi.String("eu-west-0"),
Roles: pulumi.StringArray{
pulumi.String("VPC Administrator"),
pulumi.String("SFS Administrator"),
},
},
},
})
if err != nil {
return err
}
_, err = flexibleengine.NewFgsFunction(ctx, "testFgsFunction", &flexibleengine.FgsFunctionArgs{
Package: pulumi.String("default"),
Description: pulumi.String("fuction test"),
Handler: pulumi.String("test.handler"),
MemorySize: pulumi.Float64(128),
Timeout: pulumi.Float64(3),
Runtime: pulumi.String("Python2.7"),
CodeType: pulumi.String("inline"),
FuncCode: pulumi.String("aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ="),
Agency: testIdentityAgencyV3.Name,
VpcId: pulumi.Any(flexibleengine_vpc_v1.Test.Id),
NetworkId: pulumi.Any(flexibleengine_vpc_subnet_v1.Test.Id),
FuncMounts: flexibleengine.FgsFunctionFuncMountArray{
&flexibleengine.FgsFunctionFuncMountArgs{
MountType: pulumi.String("sfs"),
MountResource: testSfsFileSystemV2.SfsFileSystemV2Id,
MountSharePath: testSfsFileSystemV2.ExportLocation,
LocalMountPath: pulumi.String("/mnt"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var exampleVpc = new Flexibleengine.VpcV1("exampleVpc", new()
{
Cidr = "192.168.0.0/16",
});
var exampleSubnet = new Flexibleengine.VpcSubnetV1("exampleSubnet", new()
{
Cidr = "192.168.1.0/24",
GatewayIp = "192.168.1.1",
VpcId = flexibleengine_vpc_v1.Test.Id,
});
var testSfsFileSystemV2 = new Flexibleengine.SfsFileSystemV2("testSfsFileSystemV2", new()
{
ShareProto = "NFS",
Size = 10,
Description = "test sfs for fgs",
});
var testIdentityAgencyV3 = new Flexibleengine.IdentityAgencyV3("testIdentityAgencyV3", new()
{
Description = "test agency for fgs",
DelegatedServiceName = "op_svc_cff",
ProjectRoles = new[]
{
new Flexibleengine.Inputs.IdentityAgencyV3ProjectRoleArgs
{
Project = "eu-west-0",
Roles = new[]
{
"VPC Administrator",
"SFS Administrator",
},
},
},
});
var testFgsFunction = new Flexibleengine.FgsFunction("testFgsFunction", new()
{
Package = "default",
Description = "fuction test",
Handler = "test.handler",
MemorySize = 128,
Timeout = 3,
Runtime = "Python2.7",
CodeType = "inline",
FuncCode = "aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=",
Agency = testIdentityAgencyV3.Name,
VpcId = flexibleengine_vpc_v1.Test.Id,
NetworkId = flexibleengine_vpc_subnet_v1.Test.Id,
FuncMounts = new[]
{
new Flexibleengine.Inputs.FgsFunctionFuncMountArgs
{
MountType = "sfs",
MountResource = testSfsFileSystemV2.SfsFileSystemV2Id,
MountSharePath = testSfsFileSystemV2.ExportLocation,
LocalMountPath = "/mnt",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.VpcV1;
import com.pulumi.flexibleengine.VpcV1Args;
import com.pulumi.flexibleengine.VpcSubnetV1;
import com.pulumi.flexibleengine.VpcSubnetV1Args;
import com.pulumi.flexibleengine.SfsFileSystemV2;
import com.pulumi.flexibleengine.SfsFileSystemV2Args;
import com.pulumi.flexibleengine.IdentityAgencyV3;
import com.pulumi.flexibleengine.IdentityAgencyV3Args;
import com.pulumi.flexibleengine.inputs.IdentityAgencyV3ProjectRoleArgs;
import com.pulumi.flexibleengine.FgsFunction;
import com.pulumi.flexibleengine.FgsFunctionArgs;
import com.pulumi.flexibleengine.inputs.FgsFunctionFuncMountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleVpc = new VpcV1("exampleVpc", VpcV1Args.builder()
.cidr("192.168.0.0/16")
.build());
var exampleSubnet = new VpcSubnetV1("exampleSubnet", VpcSubnetV1Args.builder()
.cidr("192.168.1.0/24")
.gatewayIp("192.168.1.1")
.vpcId(flexibleengine_vpc_v1.test().id())
.build());
var testSfsFileSystemV2 = new SfsFileSystemV2("testSfsFileSystemV2", SfsFileSystemV2Args.builder()
.shareProto("NFS")
.size(10)
.description("test sfs for fgs")
.build());
var testIdentityAgencyV3 = new IdentityAgencyV3("testIdentityAgencyV3", IdentityAgencyV3Args.builder()
.description("test agency for fgs")
.delegatedServiceName("op_svc_cff")
.projectRoles(IdentityAgencyV3ProjectRoleArgs.builder()
.project("eu-west-0")
.roles(
"VPC Administrator",
"SFS Administrator")
.build())
.build());
var testFgsFunction = new FgsFunction("testFgsFunction", FgsFunctionArgs.builder()
.package_("default")
.description("fuction test")
.handler("test.handler")
.memorySize(128)
.timeout(3)
.runtime("Python2.7")
.codeType("inline")
.funcCode("aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=")
.agency(testIdentityAgencyV3.name())
.vpcId(flexibleengine_vpc_v1.test().id())
.networkId(flexibleengine_vpc_subnet_v1.test().id())
.funcMounts(FgsFunctionFuncMountArgs.builder()
.mountType("sfs")
.mountResource(testSfsFileSystemV2.sfsFileSystemV2Id())
.mountSharePath(testSfsFileSystemV2.exportLocation())
.localMountPath("/mnt")
.build())
.build());
}
}
resources:
exampleVpc:
type: flexibleengine:VpcV1
properties:
cidr: 192.168.0.0/16
exampleSubnet:
type: flexibleengine:VpcSubnetV1
properties:
cidr: 192.168.1.0/24
gatewayIp: 192.168.1.1
vpcId: ${flexibleengine_vpc_v1.test.id}
testSfsFileSystemV2:
type: flexibleengine:SfsFileSystemV2
properties:
shareProto: NFS
size: 10
description: test sfs for fgs
testIdentityAgencyV3:
type: flexibleengine:IdentityAgencyV3
properties:
description: test agency for fgs
delegatedServiceName: op_svc_cff
projectRoles:
- project: eu-west-0
roles:
- VPC Administrator
- SFS Administrator
testFgsFunction:
type: flexibleengine:FgsFunction
properties:
package: default
description: fuction test
handler: test.handler
memorySize: 128
timeout: 3
runtime: Python2.7
codeType: inline
funcCode: aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIgKGV2ZW50LCBjb250ZXh0KToKICAgIG91dHB1dCA9ICdIZWxsbyBtZXNzYWdlOiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIHJldHVybiBvdXRwdXQ=
agency: ${testIdentityAgencyV3.name}
vpcId: ${flexibleengine_vpc_v1.test.id}
networkId: ${flexibleengine_vpc_subnet_v1.test.id}
funcMounts:
- mountType: sfs
mountResource: ${testSfsFileSystemV2.sfsFileSystemV2Id}
mountSharePath: ${testSfsFileSystemV2.exportLocation}
localMountPath: /mnt
With agency, user_data for environment variables and OBS for code storage
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const config = new pulumi.Config();
const codeUrl = config.requireObject("codeUrl");
const agency = new flexibleengine.IdentityAgencyV3("agency", {
description: "Delegate OBS access to FGS",
delegatedServiceName: "op_svc_cff",
domainRoles: ["OBS OperateAccess"],
});
const _function = new flexibleengine.FgsFunction("function", {
app: "default",
description: "test function",
handler: "index.handler",
agency: agency.name,
memorySize: 128,
timeout: 3,
runtime: "Node.js6.10",
codeType: "obs",
codeUrl: codeUrl,
userData: JSON.stringify({
environmentVariable1: "someValue",
environmentVariable2: "5",
}),
encryptedUserData: JSON.stringify({
secret_key: "xxxxxxx",
}),
});
import pulumi
import json
import pulumi_flexibleengine as flexibleengine
config = pulumi.Config()
code_url = config.require_object("codeUrl")
agency = flexibleengine.IdentityAgencyV3("agency",
description="Delegate OBS access to FGS",
delegated_service_name="op_svc_cff",
domain_roles=["OBS OperateAccess"])
function = flexibleengine.FgsFunction("function",
app="default",
description="test function",
handler="index.handler",
agency=agency.name,
memory_size=128,
timeout=3,
runtime="Node.js6.10",
code_type="obs",
code_url=code_url,
user_data=json.dumps({
"environmentVariable1": "someValue",
"environmentVariable2": "5",
}),
encrypted_user_data=json.dumps({
"secret_key": "xxxxxxx",
}))
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
codeUrl := cfg.RequireObject("codeUrl")
agency, err := flexibleengine.NewIdentityAgencyV3(ctx, "agency", &flexibleengine.IdentityAgencyV3Args{
Description: pulumi.String("Delegate OBS access to FGS"),
DelegatedServiceName: pulumi.String("op_svc_cff"),
DomainRoles: pulumi.StringArray{
pulumi.String("OBS OperateAccess"),
},
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"environmentVariable1": "someValue",
"environmentVariable2": "5",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
tmpJSON1, err := json.Marshal(map[string]interface{}{
"secret_key": "xxxxxxx",
})
if err != nil {
return err
}
json1 := string(tmpJSON1)
_, err = flexibleengine.NewFgsFunction(ctx, "function", &flexibleengine.FgsFunctionArgs{
App: pulumi.String("default"),
Description: pulumi.String("test function"),
Handler: pulumi.String("index.handler"),
Agency: agency.Name,
MemorySize: pulumi.Float64(128),
Timeout: pulumi.Float64(3),
Runtime: pulumi.String("Node.js6.10"),
CodeType: pulumi.String("obs"),
CodeUrl: pulumi.Any(codeUrl),
UserData: pulumi.String(json0),
EncryptedUserData: pulumi.String(json1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var codeUrl = config.RequireObject<dynamic>("codeUrl");
var agency = new Flexibleengine.IdentityAgencyV3("agency", new()
{
Description = "Delegate OBS access to FGS",
DelegatedServiceName = "op_svc_cff",
DomainRoles = new[]
{
"OBS OperateAccess",
},
});
var function = new Flexibleengine.FgsFunction("function", new()
{
App = "default",
Description = "test function",
Handler = "index.handler",
Agency = agency.Name,
MemorySize = 128,
Timeout = 3,
Runtime = "Node.js6.10",
CodeType = "obs",
CodeUrl = codeUrl,
UserData = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["environmentVariable1"] = "someValue",
["environmentVariable2"] = "5",
}),
EncryptedUserData = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["secret_key"] = "xxxxxxx",
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.IdentityAgencyV3;
import com.pulumi.flexibleengine.IdentityAgencyV3Args;
import com.pulumi.flexibleengine.FgsFunction;
import com.pulumi.flexibleengine.FgsFunctionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var codeUrl = config.get("codeUrl");
var agency = new IdentityAgencyV3("agency", IdentityAgencyV3Args.builder()
.description("Delegate OBS access to FGS")
.delegatedServiceName("op_svc_cff")
.domainRoles("OBS OperateAccess")
.build());
var function = new FgsFunction("function", FgsFunctionArgs.builder()
.app("default")
.description("test function")
.handler("index.handler")
.agency(agency.name())
.memorySize(128)
.timeout(3)
.runtime("Node.js6.10")
.codeType("obs")
.codeUrl(codeUrl)
.userData(serializeJson(
jsonObject(
jsonProperty("environmentVariable1", "someValue"),
jsonProperty("environmentVariable2", "5")
)))
.encryptedUserData(serializeJson(
jsonObject(
jsonProperty("secret_key", "xxxxxxx")
)))
.build());
}
}
configuration:
codeUrl:
type: dynamic
resources:
agency:
type: flexibleengine:IdentityAgencyV3
properties:
description: Delegate OBS access to FGS
delegatedServiceName: op_svc_cff
domainRoles:
- OBS OperateAccess
function:
type: flexibleengine:FgsFunction
properties:
app: default
description: test function
handler: index.handler
agency: ${agency.name}
memorySize: 128
timeout: 3
runtime: Node.js6.10
codeType: obs
codeUrl: ${codeUrl}
userData:
fn::toJSON:
environmentVariable1: someValue
environmentVariable2: '5'
encryptedUserData:
fn::toJSON:
secret_key: xxxxxxx
Create FgsFunction Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FgsFunction(name: string, args: FgsFunctionArgs, opts?: CustomResourceOptions);
@overload
def FgsFunction(resource_name: str,
args: FgsFunctionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FgsFunction(resource_name: str,
opts: Optional[ResourceOptions] = None,
memory_size: Optional[float] = None,
timeout: Optional[float] = None,
runtime: Optional[str] = None,
initializer_timeout: Optional[float] = None,
code_type: Optional[str] = None,
code_url: Optional[str] = None,
custom_image: Optional[FgsFunctionCustomImageArgs] = None,
depend_lists: Optional[Sequence[str]] = None,
description: Optional[str] = None,
dns_list: Optional[str] = None,
encrypted_user_data: Optional[str] = None,
enterprise_project_id: Optional[str] = None,
fgs_function_id: Optional[str] = None,
func_code: Optional[str] = None,
func_mounts: Optional[Sequence[FgsFunctionFuncMountArgs]] = None,
functiongraph_version: Optional[str] = None,
handler: Optional[str] = None,
initializer_handler: Optional[str] = None,
agency: Optional[str] = None,
log_group_name: Optional[str] = None,
log_group_id: Optional[str] = None,
app_agency: Optional[str] = None,
log_stream_name: Optional[str] = None,
max_instance_num: Optional[str] = None,
code_filename: Optional[str] = None,
mount_user_group_id: Optional[float] = None,
mount_user_id: Optional[float] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
package: Optional[str] = None,
region: Optional[str] = None,
log_stream_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
app: Optional[str] = None,
timeouts: Optional[FgsFunctionTimeoutsArgs] = None,
user_data: Optional[str] = None,
versions: Optional[Sequence[FgsFunctionVersionArgs]] = None,
vpc_id: Optional[str] = None,
xrole: Optional[str] = None)
func NewFgsFunction(ctx *Context, name string, args FgsFunctionArgs, opts ...ResourceOption) (*FgsFunction, error)
public FgsFunction(string name, FgsFunctionArgs args, CustomResourceOptions? opts = null)
public FgsFunction(String name, FgsFunctionArgs args)
public FgsFunction(String name, FgsFunctionArgs args, CustomResourceOptions options)
type: flexibleengine:FgsFunction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FgsFunctionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FgsFunctionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FgsFunctionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FgsFunctionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FgsFunctionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var fgsFunctionResource = new Flexibleengine.FgsFunction("fgsFunctionResource", new()
{
MemorySize = 0,
Timeout = 0,
Runtime = "string",
InitializerTimeout = 0,
CodeType = "string",
CodeUrl = "string",
CustomImage = new Flexibleengine.Inputs.FgsFunctionCustomImageArgs
{
Url = "string",
},
DependLists = new[]
{
"string",
},
Description = "string",
DnsList = "string",
EncryptedUserData = "string",
EnterpriseProjectId = "string",
FgsFunctionId = "string",
FuncCode = "string",
FuncMounts = new[]
{
new Flexibleengine.Inputs.FgsFunctionFuncMountArgs
{
LocalMountPath = "string",
MountResource = "string",
MountSharePath = "string",
MountType = "string",
Status = "string",
},
},
FunctiongraphVersion = "string",
Handler = "string",
InitializerHandler = "string",
Agency = "string",
LogGroupName = "string",
LogGroupId = "string",
AppAgency = "string",
LogStreamName = "string",
MaxInstanceNum = "string",
CodeFilename = "string",
MountUserGroupId = 0,
MountUserId = 0,
Name = "string",
NetworkId = "string",
Region = "string",
LogStreamId = "string",
Tags =
{
{ "string", "string" },
},
App = "string",
Timeouts = new Flexibleengine.Inputs.FgsFunctionTimeoutsArgs
{
Create = "string",
Delete = "string",
},
UserData = "string",
Versions = new[]
{
new Flexibleengine.Inputs.FgsFunctionVersionArgs
{
Name = "string",
Aliases = new Flexibleengine.Inputs.FgsFunctionVersionAliasesArgs
{
Name = "string",
Description = "string",
},
},
},
VpcId = "string",
});
example, err := flexibleengine.NewFgsFunction(ctx, "fgsFunctionResource", &flexibleengine.FgsFunctionArgs{
MemorySize: pulumi.Float64(0),
Timeout: pulumi.Float64(0),
Runtime: pulumi.String("string"),
InitializerTimeout: pulumi.Float64(0),
CodeType: pulumi.String("string"),
CodeUrl: pulumi.String("string"),
CustomImage: &flexibleengine.FgsFunctionCustomImageArgs{
Url: pulumi.String("string"),
},
DependLists: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
DnsList: pulumi.String("string"),
EncryptedUserData: pulumi.String("string"),
EnterpriseProjectId: pulumi.String("string"),
FgsFunctionId: pulumi.String("string"),
FuncCode: pulumi.String("string"),
FuncMounts: flexibleengine.FgsFunctionFuncMountArray{
&flexibleengine.FgsFunctionFuncMountArgs{
LocalMountPath: pulumi.String("string"),
MountResource: pulumi.String("string"),
MountSharePath: pulumi.String("string"),
MountType: pulumi.String("string"),
Status: pulumi.String("string"),
},
},
FunctiongraphVersion: pulumi.String("string"),
Handler: pulumi.String("string"),
InitializerHandler: pulumi.String("string"),
Agency: pulumi.String("string"),
LogGroupName: pulumi.String("string"),
LogGroupId: pulumi.String("string"),
AppAgency: pulumi.String("string"),
LogStreamName: pulumi.String("string"),
MaxInstanceNum: pulumi.String("string"),
CodeFilename: pulumi.String("string"),
MountUserGroupId: pulumi.Float64(0),
MountUserId: pulumi.Float64(0),
Name: pulumi.String("string"),
NetworkId: pulumi.String("string"),
Region: pulumi.String("string"),
LogStreamId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
App: pulumi.String("string"),
Timeouts: &flexibleengine.FgsFunctionTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
UserData: pulumi.String("string"),
Versions: flexibleengine.FgsFunctionVersionArray{
&flexibleengine.FgsFunctionVersionArgs{
Name: pulumi.String("string"),
Aliases: &flexibleengine.FgsFunctionVersionAliasesArgs{
Name: pulumi.String("string"),
Description: pulumi.String("string"),
},
},
},
VpcId: pulumi.String("string"),
})
var fgsFunctionResource = new FgsFunction("fgsFunctionResource", FgsFunctionArgs.builder()
.memorySize(0)
.timeout(0)
.runtime("string")
.initializerTimeout(0)
.codeType("string")
.codeUrl("string")
.customImage(FgsFunctionCustomImageArgs.builder()
.url("string")
.build())
.dependLists("string")
.description("string")
.dnsList("string")
.encryptedUserData("string")
.enterpriseProjectId("string")
.fgsFunctionId("string")
.funcCode("string")
.funcMounts(FgsFunctionFuncMountArgs.builder()
.localMountPath("string")
.mountResource("string")
.mountSharePath("string")
.mountType("string")
.status("string")
.build())
.functiongraphVersion("string")
.handler("string")
.initializerHandler("string")
.agency("string")
.logGroupName("string")
.logGroupId("string")
.appAgency("string")
.logStreamName("string")
.maxInstanceNum("string")
.codeFilename("string")
.mountUserGroupId(0)
.mountUserId(0)
.name("string")
.networkId("string")
.region("string")
.logStreamId("string")
.tags(Map.of("string", "string"))
.app("string")
.timeouts(FgsFunctionTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.userData("string")
.versions(FgsFunctionVersionArgs.builder()
.name("string")
.aliases(FgsFunctionVersionAliasesArgs.builder()
.name("string")
.description("string")
.build())
.build())
.vpcId("string")
.build());
fgs_function_resource = flexibleengine.FgsFunction("fgsFunctionResource",
memory_size=0,
timeout=0,
runtime="string",
initializer_timeout=0,
code_type="string",
code_url="string",
custom_image={
"url": "string",
},
depend_lists=["string"],
description="string",
dns_list="string",
encrypted_user_data="string",
enterprise_project_id="string",
fgs_function_id="string",
func_code="string",
func_mounts=[{
"local_mount_path": "string",
"mount_resource": "string",
"mount_share_path": "string",
"mount_type": "string",
"status": "string",
}],
functiongraph_version="string",
handler="string",
initializer_handler="string",
agency="string",
log_group_name="string",
log_group_id="string",
app_agency="string",
log_stream_name="string",
max_instance_num="string",
code_filename="string",
mount_user_group_id=0,
mount_user_id=0,
name="string",
network_id="string",
region="string",
log_stream_id="string",
tags={
"string": "string",
},
app="string",
timeouts={
"create": "string",
"delete": "string",
},
user_data="string",
versions=[{
"name": "string",
"aliases": {
"name": "string",
"description": "string",
},
}],
vpc_id="string")
const fgsFunctionResource = new flexibleengine.FgsFunction("fgsFunctionResource", {
memorySize: 0,
timeout: 0,
runtime: "string",
initializerTimeout: 0,
codeType: "string",
codeUrl: "string",
customImage: {
url: "string",
},
dependLists: ["string"],
description: "string",
dnsList: "string",
encryptedUserData: "string",
enterpriseProjectId: "string",
fgsFunctionId: "string",
funcCode: "string",
funcMounts: [{
localMountPath: "string",
mountResource: "string",
mountSharePath: "string",
mountType: "string",
status: "string",
}],
functiongraphVersion: "string",
handler: "string",
initializerHandler: "string",
agency: "string",
logGroupName: "string",
logGroupId: "string",
appAgency: "string",
logStreamName: "string",
maxInstanceNum: "string",
codeFilename: "string",
mountUserGroupId: 0,
mountUserId: 0,
name: "string",
networkId: "string",
region: "string",
logStreamId: "string",
tags: {
string: "string",
},
app: "string",
timeouts: {
create: "string",
"delete": "string",
},
userData: "string",
versions: [{
name: "string",
aliases: {
name: "string",
description: "string",
},
}],
vpcId: "string",
});
type: flexibleengine:FgsFunction
properties:
agency: string
app: string
appAgency: string
codeFilename: string
codeType: string
codeUrl: string
customImage:
url: string
dependLists:
- string
description: string
dnsList: string
encryptedUserData: string
enterpriseProjectId: string
fgsFunctionId: string
funcCode: string
funcMounts:
- localMountPath: string
mountResource: string
mountSharePath: string
mountType: string
status: string
functiongraphVersion: string
handler: string
initializerHandler: string
initializerTimeout: 0
logGroupId: string
logGroupName: string
logStreamId: string
logStreamName: string
maxInstanceNum: string
memorySize: 0
mountUserGroupId: 0
mountUserId: 0
name: string
networkId: string
region: string
runtime: string
tags:
string: string
timeout: 0
timeouts:
create: string
delete: string
userData: string
versions:
- aliases:
description: string
name: string
name: string
vpcId: string
FgsFunction Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FgsFunction resource accepts the following input properties:
- Memory
Size double - Specifies the memory size(MB) allocated to the function.
- Runtime string
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- Timeout double
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- Agency string
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- App string
- Specifies the group to which the function belongs.
- App
Agency string - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- Code
Filename string - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- Code
Type string - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- Code
Url string - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- Custom
Image FgsFunction Custom Image - Depend
Lists List<string> - Specifies the ID list of the dependencies.
- Description string
- Specifies the description of the function.
- Dns
List string - Encrypted
User stringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - Enterprise
Project stringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- Fgs
Function stringId - Specifies a resource ID in UUID format.
- Func
Code string - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- Func
Mounts List<FgsFunction Func Mount> Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- Functiongraph
Version string - Handler string
- Specifies the entry point of the function.
- Initializer
Handler string - Specifies the initializer of the function.
- Initializer
Timeout double - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- Log
Group stringId - Log
Group stringName - Log
Stream stringId - Log
Stream stringName - Max
Instance stringNum - Mount
User doubleGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- Mount
User doubleId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- Name string
- Specifies the name of the function.
- Network
Id string Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- Package string
- Region string
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- Dictionary<string, string>
- Timeouts
Fgs
Function Timeouts - User
Data string - Versions
List<Fgs
Function Version> - The versions management of the function.
- Vpc
Id string - Specifies the ID of VPC.
- Xrole string
- Memory
Size float64 - Specifies the memory size(MB) allocated to the function.
- Runtime string
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- Timeout float64
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- Agency string
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- App string
- Specifies the group to which the function belongs.
- App
Agency string - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- Code
Filename string - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- Code
Type string - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- Code
Url string - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- Custom
Image FgsFunction Custom Image Args - Depend
Lists []string - Specifies the ID list of the dependencies.
- Description string
- Specifies the description of the function.
- Dns
List string - Encrypted
User stringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - Enterprise
Project stringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- Fgs
Function stringId - Specifies a resource ID in UUID format.
- Func
Code string - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- Func
Mounts []FgsFunction Func Mount Args Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- Functiongraph
Version string - Handler string
- Specifies the entry point of the function.
- Initializer
Handler string - Specifies the initializer of the function.
- Initializer
Timeout float64 - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- Log
Group stringId - Log
Group stringName - Log
Stream stringId - Log
Stream stringName - Max
Instance stringNum - Mount
User float64Group Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- Mount
User float64Id - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- Name string
- Specifies the name of the function.
- Network
Id string Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- Package string
- Region string
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- map[string]string
- Timeouts
Fgs
Function Timeouts Args - User
Data string - Versions
[]Fgs
Function Version Args - The versions management of the function.
- Vpc
Id string - Specifies the ID of VPC.
- Xrole string
- memory
Size Double - Specifies the memory size(MB) allocated to the function.
- runtime String
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- timeout Double
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- agency String
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app String
- Specifies the group to which the function belongs.
- app
Agency String - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code
Filename String - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code
Type String - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code
Url String - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom
Image FgsFunction Custom Image - depend
Lists List<String> - Specifies the ID list of the dependencies.
- description String
- Specifies the description of the function.
- dns
List String - encrypted
User StringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise
Project StringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs
Function StringId - Specifies a resource ID in UUID format.
- func
Code String - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func
Mounts List<FgsFunction Func Mount> Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph
Version String - handler String
- Specifies the entry point of the function.
- initializer
Handler String - Specifies the initializer of the function.
- initializer
Timeout Double - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log
Group StringId - log
Group StringName - log
Stream StringId - log
Stream StringName - max
Instance StringNum - mount
User DoubleGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount
User DoubleId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name String
- Specifies the name of the function.
- network
Id String Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package_ String
- region String
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- Map<String,String>
- timeouts
Fgs
Function Timeouts - user
Data String - versions
List<Fgs
Function Version> - The versions management of the function.
- vpc
Id String - Specifies the ID of VPC.
- xrole String
- memory
Size number - Specifies the memory size(MB) allocated to the function.
- runtime string
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- timeout number
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- agency string
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app string
- Specifies the group to which the function belongs.
- app
Agency string - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code
Filename string - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code
Type string - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code
Url string - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom
Image FgsFunction Custom Image - depend
Lists string[] - Specifies the ID list of the dependencies.
- description string
- Specifies the description of the function.
- dns
List string - encrypted
User stringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise
Project stringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs
Function stringId - Specifies a resource ID in UUID format.
- func
Code string - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func
Mounts FgsFunction Func Mount[] Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph
Version string - handler string
- Specifies the entry point of the function.
- initializer
Handler string - Specifies the initializer of the function.
- initializer
Timeout number - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log
Group stringId - log
Group stringName - log
Stream stringId - log
Stream stringName - max
Instance stringNum - mount
User numberGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount
User numberId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name string
- Specifies the name of the function.
- network
Id string Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package string
- region string
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- {[key: string]: string}
- timeouts
Fgs
Function Timeouts - user
Data string - versions
Fgs
Function Version[] - The versions management of the function.
- vpc
Id string - Specifies the ID of VPC.
- xrole string
- memory_
size float - Specifies the memory size(MB) allocated to the function.
- runtime str
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- timeout float
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- agency str
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app str
- Specifies the group to which the function belongs.
- app_
agency str - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code_
filename str - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code_
type str - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code_
url str - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom_
image FgsFunction Custom Image Args - depend_
lists Sequence[str] - Specifies the ID list of the dependencies.
- description str
- Specifies the description of the function.
- dns_
list str - encrypted_
user_ strdata - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise_
project_ strid - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs_
function_ strid - Specifies a resource ID in UUID format.
- func_
code str - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func_
mounts Sequence[FgsFunction Func Mount Args] Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph_
version str - handler str
- Specifies the entry point of the function.
- initializer_
handler str - Specifies the initializer of the function.
- initializer_
timeout float - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log_
group_ strid - log_
group_ strname - log_
stream_ strid - log_
stream_ strname - max_
instance_ strnum - mount_
user_ floatgroup_ id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount_
user_ floatid - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name str
- Specifies the name of the function.
- network_
id str Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package str
- region str
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- Mapping[str, str]
- timeouts
Fgs
Function Timeouts Args - user_
data str - versions
Sequence[Fgs
Function Version Args] - The versions management of the function.
- vpc_
id str - Specifies the ID of VPC.
- xrole str
- memory
Size Number - Specifies the memory size(MB) allocated to the function.
- runtime String
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- timeout Number
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- agency String
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app String
- Specifies the group to which the function belongs.
- app
Agency String - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code
Filename String - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code
Type String - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code
Url String - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom
Image Property Map - depend
Lists List<String> - Specifies the ID list of the dependencies.
- description String
- Specifies the description of the function.
- dns
List String - encrypted
User StringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise
Project StringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs
Function StringId - Specifies a resource ID in UUID format.
- func
Code String - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func
Mounts List<Property Map> Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph
Version String - handler String
- Specifies the entry point of the function.
- initializer
Handler String - Specifies the initializer of the function.
- initializer
Timeout Number - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log
Group StringId - log
Group StringName - log
Stream StringId - log
Stream StringName - max
Instance StringNum - mount
User NumberGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount
User NumberId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name String
- Specifies the name of the function.
- network
Id String Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package String
- region String
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- Map<String>
- timeouts Property Map
- user
Data String - versions List<Property Map>
- The versions management of the function.
- vpc
Id String - Specifies the ID of VPC.
- xrole String
Outputs
All input properties are implicitly available as output properties. Additionally, the FgsFunction resource produces the following output properties:
- Flexibleengine
Urn string - Uniform Resource Name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Version string
- The version of the function.
- Flexibleengine
Urn string - Uniform Resource Name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Version string
- The version of the function.
- flexibleengine
Urn String - Uniform Resource Name.
- id String
- The provider-assigned unique ID for this managed resource.
- version String
- The version of the function.
- flexibleengine
Urn string - Uniform Resource Name.
- id string
- The provider-assigned unique ID for this managed resource.
- version string
- The version of the function.
- flexibleengine_
urn str - Uniform Resource Name.
- id str
- The provider-assigned unique ID for this managed resource.
- version str
- The version of the function.
- flexibleengine
Urn String - Uniform Resource Name.
- id String
- The provider-assigned unique ID for this managed resource.
- version String
- The version of the function.
Look up Existing FgsFunction Resource
Get an existing FgsFunction resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FgsFunctionState, opts?: CustomResourceOptions): FgsFunction
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
agency: Optional[str] = None,
app: Optional[str] = None,
app_agency: Optional[str] = None,
code_filename: Optional[str] = None,
code_type: Optional[str] = None,
code_url: Optional[str] = None,
custom_image: Optional[FgsFunctionCustomImageArgs] = None,
depend_lists: Optional[Sequence[str]] = None,
description: Optional[str] = None,
dns_list: Optional[str] = None,
encrypted_user_data: Optional[str] = None,
enterprise_project_id: Optional[str] = None,
fgs_function_id: Optional[str] = None,
flexibleengine_urn: Optional[str] = None,
func_code: Optional[str] = None,
func_mounts: Optional[Sequence[FgsFunctionFuncMountArgs]] = None,
functiongraph_version: Optional[str] = None,
handler: Optional[str] = None,
initializer_handler: Optional[str] = None,
initializer_timeout: Optional[float] = None,
log_group_id: Optional[str] = None,
log_group_name: Optional[str] = None,
log_stream_id: Optional[str] = None,
log_stream_name: Optional[str] = None,
max_instance_num: Optional[str] = None,
memory_size: Optional[float] = None,
mount_user_group_id: Optional[float] = None,
mount_user_id: Optional[float] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
package: Optional[str] = None,
region: Optional[str] = None,
runtime: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
timeout: Optional[float] = None,
timeouts: Optional[FgsFunctionTimeoutsArgs] = None,
user_data: Optional[str] = None,
version: Optional[str] = None,
versions: Optional[Sequence[FgsFunctionVersionArgs]] = None,
vpc_id: Optional[str] = None,
xrole: Optional[str] = None) -> FgsFunction
func GetFgsFunction(ctx *Context, name string, id IDInput, state *FgsFunctionState, opts ...ResourceOption) (*FgsFunction, error)
public static FgsFunction Get(string name, Input<string> id, FgsFunctionState? state, CustomResourceOptions? opts = null)
public static FgsFunction get(String name, Output<String> id, FgsFunctionState state, CustomResourceOptions options)
resources: _: type: flexibleengine:FgsFunction get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Agency string
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- App string
- Specifies the group to which the function belongs.
- App
Agency string - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- Code
Filename string - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- Code
Type string - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- Code
Url string - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- Custom
Image FgsFunction Custom Image - Depend
Lists List<string> - Specifies the ID list of the dependencies.
- Description string
- Specifies the description of the function.
- Dns
List string - Encrypted
User stringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - Enterprise
Project stringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- Fgs
Function stringId - Specifies a resource ID in UUID format.
- Flexibleengine
Urn string - Uniform Resource Name.
- Func
Code string - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- Func
Mounts List<FgsFunction Func Mount> Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- Functiongraph
Version string - Handler string
- Specifies the entry point of the function.
- Initializer
Handler string - Specifies the initializer of the function.
- Initializer
Timeout double - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- Log
Group stringId - Log
Group stringName - Log
Stream stringId - Log
Stream stringName - Max
Instance stringNum - Memory
Size double - Specifies the memory size(MB) allocated to the function.
- Mount
User doubleGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- Mount
User doubleId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- Name string
- Specifies the name of the function.
- Network
Id string Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- Package string
- Region string
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- Runtime string
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- Dictionary<string, string>
- Timeout double
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- Timeouts
Fgs
Function Timeouts - User
Data string - Version string
- The version of the function.
- Versions
List<Fgs
Function Version> - The versions management of the function.
- Vpc
Id string - Specifies the ID of VPC.
- Xrole string
- Agency string
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- App string
- Specifies the group to which the function belongs.
- App
Agency string - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- Code
Filename string - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- Code
Type string - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- Code
Url string - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- Custom
Image FgsFunction Custom Image Args - Depend
Lists []string - Specifies the ID list of the dependencies.
- Description string
- Specifies the description of the function.
- Dns
List string - Encrypted
User stringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - Enterprise
Project stringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- Fgs
Function stringId - Specifies a resource ID in UUID format.
- Flexibleengine
Urn string - Uniform Resource Name.
- Func
Code string - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- Func
Mounts []FgsFunction Func Mount Args Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- Functiongraph
Version string - Handler string
- Specifies the entry point of the function.
- Initializer
Handler string - Specifies the initializer of the function.
- Initializer
Timeout float64 - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- Log
Group stringId - Log
Group stringName - Log
Stream stringId - Log
Stream stringName - Max
Instance stringNum - Memory
Size float64 - Specifies the memory size(MB) allocated to the function.
- Mount
User float64Group Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- Mount
User float64Id - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- Name string
- Specifies the name of the function.
- Network
Id string Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- Package string
- Region string
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- Runtime string
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- map[string]string
- Timeout float64
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- Timeouts
Fgs
Function Timeouts Args - User
Data string - Version string
- The version of the function.
- Versions
[]Fgs
Function Version Args - The versions management of the function.
- Vpc
Id string - Specifies the ID of VPC.
- Xrole string
- agency String
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app String
- Specifies the group to which the function belongs.
- app
Agency String - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code
Filename String - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code
Type String - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code
Url String - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom
Image FgsFunction Custom Image - depend
Lists List<String> - Specifies the ID list of the dependencies.
- description String
- Specifies the description of the function.
- dns
List String - encrypted
User StringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise
Project StringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs
Function StringId - Specifies a resource ID in UUID format.
- flexibleengine
Urn String - Uniform Resource Name.
- func
Code String - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func
Mounts List<FgsFunction Func Mount> Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph
Version String - handler String
- Specifies the entry point of the function.
- initializer
Handler String - Specifies the initializer of the function.
- initializer
Timeout Double - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log
Group StringId - log
Group StringName - log
Stream StringId - log
Stream StringName - max
Instance StringNum - memory
Size Double - Specifies the memory size(MB) allocated to the function.
- mount
User DoubleGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount
User DoubleId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name String
- Specifies the name of the function.
- network
Id String Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package_ String
- region String
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- runtime String
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- Map<String,String>
- timeout Double
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- timeouts
Fgs
Function Timeouts - user
Data String - version String
- The version of the function.
- versions
List<Fgs
Function Version> - The versions management of the function.
- vpc
Id String - Specifies the ID of VPC.
- xrole String
- agency string
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app string
- Specifies the group to which the function belongs.
- app
Agency string - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code
Filename string - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code
Type string - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code
Url string - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom
Image FgsFunction Custom Image - depend
Lists string[] - Specifies the ID list of the dependencies.
- description string
- Specifies the description of the function.
- dns
List string - encrypted
User stringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise
Project stringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs
Function stringId - Specifies a resource ID in UUID format.
- flexibleengine
Urn string - Uniform Resource Name.
- func
Code string - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func
Mounts FgsFunction Func Mount[] Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph
Version string - handler string
- Specifies the entry point of the function.
- initializer
Handler string - Specifies the initializer of the function.
- initializer
Timeout number - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log
Group stringId - log
Group stringName - log
Stream stringId - log
Stream stringName - max
Instance stringNum - memory
Size number - Specifies the memory size(MB) allocated to the function.
- mount
User numberGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount
User numberId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name string
- Specifies the name of the function.
- network
Id string Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package string
- region string
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- runtime string
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- {[key: string]: string}
- timeout number
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- timeouts
Fgs
Function Timeouts - user
Data string - version string
- The version of the function.
- versions
Fgs
Function Version[] - The versions management of the function.
- vpc
Id string - Specifies the ID of VPC.
- xrole string
- agency str
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app str
- Specifies the group to which the function belongs.
- app_
agency str - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code_
filename str - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code_
type str - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code_
url str - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom_
image FgsFunction Custom Image Args - depend_
lists Sequence[str] - Specifies the ID list of the dependencies.
- description str
- Specifies the description of the function.
- dns_
list str - encrypted_
user_ strdata - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise_
project_ strid - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs_
function_ strid - Specifies a resource ID in UUID format.
- flexibleengine_
urn str - Uniform Resource Name.
- func_
code str - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func_
mounts Sequence[FgsFunction Func Mount Args] Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph_
version str - handler str
- Specifies the entry point of the function.
- initializer_
handler str - Specifies the initializer of the function.
- initializer_
timeout float - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log_
group_ strid - log_
group_ strname - log_
stream_ strid - log_
stream_ strname - max_
instance_ strnum - memory_
size float - Specifies the memory size(MB) allocated to the function.
- mount_
user_ floatgroup_ id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount_
user_ floatid - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name str
- Specifies the name of the function.
- network_
id str Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package str
- region str
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- runtime str
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- Mapping[str, str]
- timeout float
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- timeouts
Fgs
Function Timeouts Args - user_
data str - version str
- The version of the function.
- versions
Sequence[Fgs
Function Version Args] - The versions management of the function.
- vpc_
id str - Specifies the ID of VPC.
- xrole str
- agency String
- Specifies the agency. This parameter is mandatory if the function needs to access other cloud services.
- app String
- Specifies the group to which the function belongs.
- app
Agency String - Specifies An execution agency enables you to obtain a token or an AK/SK for accessing other cloud services.
- code
Filename String - Specifies the name of a function file, This field is mandatory only when coe_type is set to jar or zip.
- code
Type String - Specifies the function code type, which can be inline: inline code, zip: ZIP file, jar: JAR file or java functions, obs: function code stored in an OBS bucket.
- code
Url String - Specifies the code url. This parameter is mandatory when code_type is set to obs.
- custom
Image Property Map - depend
Lists List<String> - Specifies the ID list of the dependencies.
- description String
- Specifies the description of the function.
- dns
List String - encrypted
User StringData - Specifies the key/value information defined to be encrypted for the
function. The format is the same as
user_data
. - enterprise
Project StringId - Specifies the enterprise project id of the function. Changing this creates a new function.
- fgs
Function StringId - Specifies a resource ID in UUID format.
- flexibleengine
Urn String - Uniform Resource Name.
- func
Code String - Specifies the function code. When code_type is set to inline, zip, or jar, this parameter is mandatory, and the code can be encoded using Base64 or just with the text code.
- func
Mounts List<Property Map> Specifies the file system list. The func_mounts object structure is documented below.
The
func_mounts
block supports:- functiongraph
Version String - handler String
- Specifies the entry point of the function.
- initializer
Handler String - Specifies the initializer of the function.
- initializer
Timeout Number - Specifies the maximum duration the function can be initialized. Value range: 1s to 300s.
- log
Group StringId - log
Group StringName - log
Stream StringId - log
Stream StringName - max
Instance StringNum - memory
Size Number - Specifies the memory size(MB) allocated to the function.
- mount
User NumberGroup Id - Specifies the user group ID, a non-0 integer from –1 to 65534. Default to -1.
- mount
User NumberId - Specifies the user ID, a non-0 integer from –1 to 65534. Default to -1.
- name String
- Specifies the name of the function.
- network
Id String Specifies the network ID of subnet.
NOTE: An agency with VPC management permissions must be specified for the function.
- package String
- region String
- Specifies the region in which to create the Function resource. If omitted, the provider-level region will be used. Changing this creates a new Function resource.
- runtime String
- Specifies the environment for executing the function. Changing this creates a new Function resource.
- Map<String>
- timeout Number
- Specifies the timeout interval of the function, ranges from 3s to 900s.
- timeouts Property Map
- user
Data String - version String
- The version of the function.
- versions List<Property Map>
- The versions management of the function.
- vpc
Id String - Specifies the ID of VPC.
- xrole String
Supporting Types
FgsFunctionCustomImage, FgsFunctionCustomImageArgs
- Url string
- Url string
- url String
- url string
- url str
- url String
FgsFunctionFuncMount, FgsFunctionFuncMountArgs
- Local
Mount stringPath - Specifies the function access path.
- Mount
Resource string - Specifies the ID of the mounted resource (corresponding cloud service).
- string
- Specifies the remote mount path. Example: 192.168.0.12:/data.
- Mount
Type string - Specifies the mount type. Options: sfs, sfsTurbo, and ecs.
- Status string
- The status of file system.
- Local
Mount stringPath - Specifies the function access path.
- Mount
Resource string - Specifies the ID of the mounted resource (corresponding cloud service).
- string
- Specifies the remote mount path. Example: 192.168.0.12:/data.
- Mount
Type string - Specifies the mount type. Options: sfs, sfsTurbo, and ecs.
- Status string
- The status of file system.
- local
Mount StringPath - Specifies the function access path.
- mount
Resource String - Specifies the ID of the mounted resource (corresponding cloud service).
- String
- Specifies the remote mount path. Example: 192.168.0.12:/data.
- mount
Type String - Specifies the mount type. Options: sfs, sfsTurbo, and ecs.
- status String
- The status of file system.
- local
Mount stringPath - Specifies the function access path.
- mount
Resource string - Specifies the ID of the mounted resource (corresponding cloud service).
- string
- Specifies the remote mount path. Example: 192.168.0.12:/data.
- mount
Type string - Specifies the mount type. Options: sfs, sfsTurbo, and ecs.
- status string
- The status of file system.
- local_
mount_ strpath - Specifies the function access path.
- mount_
resource str - Specifies the ID of the mounted resource (corresponding cloud service).
- str
- Specifies the remote mount path. Example: 192.168.0.12:/data.
- mount_
type str - Specifies the mount type. Options: sfs, sfsTurbo, and ecs.
- status str
- The status of file system.
- local
Mount StringPath - Specifies the function access path.
- mount
Resource String - Specifies the ID of the mounted resource (corresponding cloud service).
- String
- Specifies the remote mount path. Example: 192.168.0.12:/data.
- mount
Type String - Specifies the mount type. Options: sfs, sfsTurbo, and ecs.
- status String
- The status of file system.
FgsFunctionTimeouts, FgsFunctionTimeoutsArgs
FgsFunctionVersion, FgsFunctionVersionArgs
- Name string
- Specifies the name of the function.
- Aliases
Fgs
Function Version Aliases - The aliases management for specified version.
- Name string
- Specifies the name of the function.
- Aliases
Fgs
Function Version Aliases - The aliases management for specified version.
- name String
- Specifies the name of the function.
- aliases
Fgs
Function Version Aliases - The aliases management for specified version.
- name string
- Specifies the name of the function.
- aliases
Fgs
Function Version Aliases - The aliases management for specified version.
- name str
- Specifies the name of the function.
- aliases
Fgs
Function Version Aliases - The aliases management for specified version.
- name String
- Specifies the name of the function.
- aliases Property Map
- The aliases management for specified version.
FgsFunctionVersionAliases, FgsFunctionVersionAliasesArgs
- Name string
- Specifies the name of the function.
- Description string
- Specifies the description of the function.
- Name string
- Specifies the name of the function.
- Description string
- Specifies the description of the function.
- name String
- Specifies the name of the function.
- description String
- Specifies the description of the function.
- name string
- Specifies the name of the function.
- description string
- Specifies the description of the function.
- name str
- Specifies the name of the function.
- description str
- Specifies the description of the function.
- name String
- Specifies the name of the function.
- description String
- Specifies the description of the function.
Import
Functions can be imported using the id
, e.g.
$ pulumi import flexibleengine:index/fgsFunction:FgsFunction my-func 7117d38e-4c8f-4624-a505-bd96b97d024c
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
- License
- Notes
- This Pulumi package is based on the
flexibleengine
Terraform Provider.