FunctionProperty Struct
A function is a Lambda function that's referenced from an AWS IoT Greengrass group.
The function is deployed to a Greengrass core where it runs locally. For more information, see Run Lambda Functions on the AWS IoT Greengrass Core in the Developer Guide .
In an CloudFormation template, the Functions property of the AWS::Greengrass::FunctionDefinitionVersion resource contains a list of Function property types.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_greengrass as greengrass } from 'aws-cdk-lib';
declare const variables: any;
const functionProperty: greengrass.CfnFunctionDefinitionVersion.FunctionProperty = {
functionArn: 'functionArn',
functionConfiguration: {
encodingType: 'encodingType',
environment: {
accessSysfs: false,
execution: {
isolationMode: 'isolationMode',
runAs: {
gid: 123,
uid: 123,
},
},
resourceAccessPolicies: [{
resourceId: 'resourceId',
// the properties below are optional
permission: 'permission',
}],
variables: variables,
},
execArgs: 'execArgs',
executable: 'executable',
memorySize: 123,
pinned: false,
timeout: 123,
},
id: 'id',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_greengrass as greengrass
# variables: Any
function_property = greengrass.CfnFunctionDefinitionVersion.FunctionProperty(
function_arn="functionArn",
function_configuration=greengrass.CfnFunctionDefinitionVersion.FunctionConfigurationProperty(
encoding_type="encodingType",
environment=greengrass.CfnFunctionDefinitionVersion.EnvironmentProperty(
access_sysfs=False,
execution=greengrass.CfnFunctionDefinitionVersion.ExecutionProperty(
isolation_mode="isolationMode",
run_as=greengrass.CfnFunctionDefinitionVersion.RunAsProperty(
gid=123,
uid=123
)
),
resource_access_policies=[greengrass.CfnFunctionDefinitionVersion.ResourceAccessPolicyProperty(
resource_id="resourceId",
# the properties below are optional
permission="permission"
)],
variables=variables
),
exec_args="execArgs",
executable="executable",
memory_size=123,
pinned=False,
timeout=123
),
id="id"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.greengrass.*;
Object variables;
FunctionProperty functionProperty = FunctionProperty.builder()
.functionArn("functionArn")
.functionConfiguration(FunctionConfigurationProperty.builder()
.encodingType("encodingType")
.environment(EnvironmentProperty.builder()
.accessSysfs(false)
.execution(ExecutionProperty.builder()
.isolationMode("isolationMode")
.runAs(RunAsProperty.builder()
.gid(123)
.uid(123)
.build())
.build())
.resourceAccessPolicies(List.of(ResourceAccessPolicyProperty.builder()
.resourceId("resourceId")
// the properties below are optional
.permission("permission")
.build()))
.variables(variables)
.build())
.execArgs("execArgs")
.executable("executable")
.memorySize(123)
.pinned(false)
.timeout(123)
.build())
.id("id")
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Greengrass;
var variables;
var functionProperty = new FunctionProperty {
FunctionArn = "functionArn",
FunctionConfiguration = new FunctionConfigurationProperty {
EncodingType = "encodingType",
Environment = new EnvironmentProperty {
AccessSysfs = false,
Execution = new ExecutionProperty {
IsolationMode = "isolationMode",
RunAs = new RunAsProperty {
Gid = 123,
Uid = 123
}
},
ResourceAccessPolicies = new [] { new ResourceAccessPolicyProperty {
ResourceId = "resourceId",
// the properties below are optional
Permission = "permission"
} },
Variables = variables
},
ExecArgs = "execArgs",
Executable = "executable",
MemorySize = 123,
Pinned = false,
Timeout = 123
},
Id = "id"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var variables interface{}
functionProperty := &FunctionProperty{
FunctionArn: jsii.String("functionArn"),
FunctionConfiguration: &FunctionConfigurationProperty{
EncodingType: jsii.String("encodingType"),
Environment: &EnvironmentProperty{
AccessSysfs: jsii.Boolean(false),
Execution: &ExecutionProperty{
IsolationMode: jsii.String("isolationMode"),
RunAs: &RunAsProperty{
Gid: jsii.Number(123),
Uid: jsii.Number(123),
},
},
ResourceAccessPolicies: []interface{}{
&ResourceAccessPolicyProperty{
ResourceId: jsii.String("resourceId"),
// the properties below are optional
Permission: jsii.String("permission"),
},
},
Variables: variables,
},
ExecArgs: jsii.String("execArgs"),
Executable: jsii.String("executable"),
MemorySize: jsii.Number(123),
Pinned: jsii.Boolean(false),
Timeout: jsii.Number(123),
},
Id: jsii.String("id"),
}
Properties
The Amazon Resource Name (ARN) of the alias (recommended) or version of the referenced Lambda function.
functionConfigurationIResolvable | CfnFunctionDefinitionVersion.FunctionConfigurationPropertyfunction_configurationtyping.Union[IResolvable, FunctionConfigurationProperty]functionConfigurationIResolvableFunctionConfigurationIResolvableFunctionConfigurationinterface{}required#The group-specific settings of the Lambda function.
These settings configure the function's behavior in the Greengrass group.
A descriptive or arbitrary ID for the function.
This value must be unique within the function definition version. Maximum length is 128 characters with pattern [a-zA-Z0-9:_-]+ .