# FunctionDefinitionVersionProperty

A function definition version contains a list of functions.

> After you create a function definition version that contains the functions you want to deploy, you must add it to your group version. For more information, see [`AWS::Greengrass::Group`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-group.html) .

In an CloudFormation template, `FunctionDefinitionVersion` is the property type of the `InitialVersion` property in the [`AWS::Greengrass::FunctionDefinition`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrass-functiondefinition.html) resource.

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

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_definition_version_property = greengrass.CfnFunctionDefinition.FunctionDefinitionVersionProperty(
    functions=[greengrass.CfnFunctionDefinition.FunctionProperty(
        function_arn="functionArn",
        function_configuration=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
        ),
        id="id"
    )],

    # the properties below are optional
    default_config=greengrass.CfnFunctionDefinition.DefaultConfigProperty(
        execution=greengrass.CfnFunctionDefinition.ExecutionProperty(
            isolation_mode="isolationMode",
            run_as=greengrass.CfnFunctionDefinition.RunAsProperty(
                gid=123,
                uid=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;

FunctionDefinitionVersionProperty functionDefinitionVersionProperty = FunctionDefinitionVersionProperty.builder()
        .functions(List.of(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()))

        // the properties below are optional
        .defaultConfig(DefaultConfigProperty.builder()
                .execution(ExecutionProperty.builder()
                        .isolationMode("isolationMode")
                        .runAs(RunAsProperty.builder()
                                .gid(123)
                                .uid(123)
                                .build())
                        .build())
                .build())
        .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 functionDefinitionVersionProperty = new FunctionDefinitionVersionProperty {
    Functions = new [] { 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"
    } },

    // the properties below are optional
    DefaultConfig = new DefaultConfigProperty {
        Execution = new ExecutionProperty {
            IsolationMode = "isolationMode",
            RunAs = new RunAsProperty {
                Gid = 123,
                Uid = 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{}

functionDefinitionVersionProperty := &FunctionDefinitionVersionProperty{
	Functions: []interface{}{
		&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"),
		},
	},

	// the properties below are optional
	DefaultConfig: &DefaultConfigProperty{
		Execution: &ExecutionProperty{
			IsolationMode: jsii.String("isolationMode"),
			RunAs: &RunAsProperty{
				Gid: jsii.Number(123),
				Uid: jsii.Number(123),
			},
		},
	},
}
```

## Properties

- `defaultConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinition.DefaultConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinition.DefaultConfigProperty.html) — The default configuration that applies to all Lambda functions in the group.

  Individual Lambda functions can override these settings.

- `functions`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinition.FunctionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinition.FunctionProperty.html)[] (required) — The functions in this version.
