# CfnFunctionDefinitionProps

Properties for defining a `CfnFunctionDefinition`.

Extends: CfnFunctionDefinitionProps
Used as props by: CfnFunctionDefinition

- Source: Generated code

## 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 tags: any;
declare const variables: any;
const cfnFunctionDefinitionProps: greengrass.CfnFunctionDefinitionProps = {
  name: 'name',

  // the properties below are optional
  initialVersion: {
    functions: [{
      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',
    }],

    // the properties below are optional
    defaultConfig: {
      execution: {
        isolationMode: 'isolationMode',
        runAs: {
          gid: 123,
          uid: 123,
        },
      },
    },
  },
  tags: tags,
};
```

## Properties

- `initialVersion`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinition.FunctionDefinitionVersionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinition.FunctionDefinitionVersionProperty.html) — The function definition version to include when the function definition is created.

  A function definition version contains a list of [`function`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinition-function.html) property types.

  > To associate a function definition version after the function definition is created, create an [`AWS::Greengrass::FunctionDefinitionVersion`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-functiondefinitionversion.html) resource and specify the ID of this function definition.

- `name`: string (required) — The name of the function definition.

- `tags`: any — Application-specific metadata to attach to the function definition.

  You can use tags in IAM policies to control access to AWS IoT Greengrass resources. You can also use tags to categorize your resources. For more information, see [Tagging Your AWS IoT Greengrass Resources](https://docs.aws.amazon.com/greengrass/v1/developerguide/tagging.html) in the *Developer Guide* .

  This `Json` property type is processed as a map of key-value pairs. It uses the following format, which is different from most `Tags` implementations in CloudFormation templates.

  ```json
  "Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value"
  }
  ```
