Skip to content
v2.277.0

CfnFunctionDefinitionProps Struct ​

Properties for defining a CfnFunctionDefinition.

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,
};
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
// 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();
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
};
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 ​

initialVersionoptionalIResolvable | CfnFunctionDefinition.FunctionDefinitionVersionPropertyinitial_versionoptionaltyping.Union[IResolvable, FunctionDefinitionVersionProperty]initialVersionoptionalIResolvableInitialVersionoptionalIResolvableInitialVersionoptionalinterface{}#
The function definition version to include when the function definition is created.
notes

A function definition version contains a list of function property types.

To associate a function definition version after the function definition is created, create an AWS::Greengrass::FunctionDefinitionVersion resource and specify the ID of this function definition.

namestringnamestrnameStringNamestringName*stringrequired#
The name of the function definition.
tagsoptionalanytagsoptionalAnytagsoptionalObjectTagsoptionalobjectTagsoptionalinterface{}#
Application-specific metadata to attach to the function definition.
notes

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 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"
}