# EnvironmentProperty

The environment configuration for a Lambda function on the AWS IoT Greengrass core.

In an CloudFormation template, `Environment` is a property of the [`FunctionConfiguration`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-functiondefinitionversion-functionconfiguration.html) property type.

- Source: Generated at build time
- 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 environmentProperty: greengrass.CfnFunctionDefinitionVersion.EnvironmentProperty = {
  accessSysfs: false,
  execution: {
    isolationMode: 'isolationMode',
    runAs: {
      gid: 123,
      uid: 123,
    },
  },
  resourceAccessPolicies: [{
    resourceId: 'resourceId',

    // the properties below are optional
    permission: 'permission',
  }],
  variables: variables,
};
```

## Properties

- `accessSysfs`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether the function is allowed to access the `/sys` directory on the core device, which allows the read device information from `/sys` .

  > This property applies only to Lambda functions that run in a Greengrass container.

- `execution`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinitionVersion.ExecutionProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinitionVersion.ExecutionProperty.html) — Settings for the Lambda execution environment in AWS IoT Greengrass .

- `resourceAccessPolicies`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunctionDefinitionVersion.ResourceAccessPolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_greengrass.CfnFunctionDefinitionVersion.ResourceAccessPolicyProperty.html)[] — A list of the [resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-resourceinstance.html) in the group that the function can access, with the corresponding read-only or read-write permissions. The maximum is 10 resources.

  > This property applies only to Lambda functions that run in a Greengrass container.

- `variables`: any — Environment variables for the Lambda function.
