Skip to content
v2.278.0

RunAsProperty Struct ​

The user and group permissions used to run the Lambda function.

This setting overrides the default access identity that's specified for the group (by default, ggc_user and ggc_group). You can override the user, group, or both. For more information, see Run as in the Developer Guide .

Running as the root user increases risks to your data and device. Do not run as root (UID/GID=0) unless your business case requires it. For more information and requirements, see Running a Lambda Function as Root .

In an CloudFormation template, RunAs is a property of the Execution property type.

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';
const runAsProperty: greengrass.CfnFunctionDefinitionVersion.RunAsProperty = {
  gid: 123,
  uid: 123,
};
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

run_as_property = greengrass.CfnFunctionDefinitionVersion.RunAsProperty(
    gid=123,
    uid=123
)
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.*;

RunAsProperty runAsProperty = RunAsProperty.builder()
        .gid(123)
        .uid(123)
        .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 runAsProperty = new RunAsProperty {
    Gid = 123,
    Uid = 123
};
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"

runAsProperty := &RunAsProperty{
	Gid: jsii.Number(123),
	Uid: jsii.Number(123),
}

Properties ​

gidoptionalnumbergidoptionalint | floatgidoptionalNumberGidoptionaldoubleGidoptional*float64 #
The group ID whose permissions are used to run the Lambda function.

You can use the getent group command on your core device to look up the group ID.

uidoptionalnumberuidoptionalint | floatuidoptionalNumberUidoptionaldoubleUidoptional*float64 #
The user ID whose permissions are used to run the Lambda function.

You can use the getent passwd command on your core device to look up the user ID.