# CfnFunctionDefinitionProps

Properties for defining a `CfnFunctionDefinition`.

Used as props by: [CfnFunctionDefinition](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinition.html)

- Source: Generated at build time

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

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

# tags: Any
# variables: Any

cfn_function_definition_props = greengrass.CfnFunctionDefinitionProps(
    name="name",

    # the properties below are optional
    initial_version=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
                )
            )
        )
    ),
    tags=tags
)
```

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 tags;
Object variables;

CfnFunctionDefinitionProps cfnFunctionDefinitionProps = CfnFunctionDefinitionProps.builder()
        .name("name")

        // the properties below are optional
        .initialVersion(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())
        .tags(tags)
        .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 tags;
var variables;

var cfnFunctionDefinitionProps = new CfnFunctionDefinitionProps {
    Name = "name",

    // the properties below are optional
    InitialVersion = 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
                }
            }
        }
    },
    Tags = tags
};
```

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 tags interface{}
var variables interface{}

cfnFunctionDefinitionProps := &CfnFunctionDefinitionProps{
	Name: jsii.String("name"),

	// the properties below are optional
	InitialVersion: &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),
				},
			},
		},
	},
	Tags: tags,
}
```

## Properties

- `initialVersion`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinition.FunctionDefinitionVersionProperty](https://docs.aws.amazon.com/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"
  }
  ```
