# FunctionConfigurationProperty

The group-specific configuration settings for a Lambda function.

These settings configure the function's behavior in the Greengrass group. For more information, see [Controlling Execution of Greengrass Lambda Functions by Using Group-Specific Configuration](https://docs.aws.amazon.com/greengrass/v1/developerguide/lambda-group-config.html) in the *Developer Guide* .

In an CloudFormation template, `FunctionConfiguration` is a property of the [`Function`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-function.html) property type.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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 functionConfigurationProperty: greengrass.CfnFunctionDefinition.FunctionConfigurationProperty = {
  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,
};
```

Python:

```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_configuration_property = greengrass.CfnFunctionDefinition.FunctionConfigurationProperty(
    encoding_type="encodingType",
    environment=greengrass.CfnFunctionDefinition.EnvironmentProperty(
        access_sysfs=False,
        execution=greengrass.CfnFunctionDefinition.ExecutionProperty(
            isolation_mode="isolationMode",
            run_as=greengrass.CfnFunctionDefinition.RunAsProperty(
                gid=123,
                uid=123
            )
        ),
        resource_access_policies=[greengrass.CfnFunctionDefinition.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
)
```

Java:

```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;

FunctionConfigurationProperty functionConfigurationProperty = 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();
```

C# / .NET:

```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 functionConfigurationProperty = 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
};
```

Golang:

```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{}

functionConfigurationProperty := &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),
}
```

## Properties

- `encodingType`: string — The expected encoding type of the input payload for the function.

  Valid values are `json` (default) and `binary` .

- `environment`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinition.EnvironmentProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinition.EnvironmentProperty.html) — The environment configuration of the function.

- `execArgs`: string — The execution arguments.

- `executable`: string — The name of the function executable.

- `memorySize`: number — The memory size (in KB) required by the function.

  > This property applies only to Lambda functions that run in a Greengrass container.

- `pinned`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether the function is pinned (or *long-lived* ).

  Pinned functions start when the core starts and process all requests in the same container. The default value is false.

- `timeout`: number — The allowed execution time (in seconds) after which the function should terminate.

  For pinned functions, this timeout applies for each request.
