# FunctionProperty

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](https://docs.aws.amazon.com/greengrass/v1/developerguide/lambda-functions.html) in the *Developer Guide* .

In an CloudFormation template, the `Functions` property of the [`FunctionDefinitionVersion`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-functiondefinitionversion.html) property type contains a list of `Function` property types.

- Source: Generated code
- Type last changed: v2.93.0 · 23 Aug 2023

## 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.CfnFunctionDefinition.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',
};
```

## Properties

- `functionArn`: string (required) — The Amazon Resource Name (ARN) of the alias (recommended) or version of the referenced Lambda function.

- `functionConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinition.FunctionConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinition.FunctionConfigurationProperty.html) (required) — The group-specific settings of the Lambda function.

  These settings configure the function's behavior in the Greengrass group.

- `id`: string (required) — 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:_-]+` .
