# NodeLifecycleScriptProperty

A single lifecycle script with its source, arguments, and error behavior.

- Source: Generated at build time
- Type last changed: v2.264.0 · 10 Aug 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_pcs as pcs } from 'aws-cdk-lib';
const nodeLifecycleScriptProperty: pcs.CfnComputeNodeGroup.NodeLifecycleScriptProperty = {
  name: 'name',
  scriptSource: {
    scriptLocation: 'scriptLocation',

    // the properties below are optional
    checksum: 'checksum',
    s3VersionId: 's3VersionId',
  },

  // the properties below are optional
  arguments: ['arguments'],
  executionPolicy: 'executionPolicy',
  onError: 'onError',
};
```

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_pcs as pcs

node_lifecycle_script_property = pcs.CfnComputeNodeGroup.NodeLifecycleScriptProperty(
    name="name",
    script_source=pcs.CfnComputeNodeGroup.ScriptSourceProperty(
        script_location="scriptLocation",

        # the properties below are optional
        checksum="checksum",
        s3_version_id="s3VersionId"
    ),

    # the properties below are optional
    arguments=["arguments"],
    execution_policy="executionPolicy",
    on_error="onError"
)
```

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.pcs.*;

NodeLifecycleScriptProperty nodeLifecycleScriptProperty = NodeLifecycleScriptProperty.builder()
        .name("name")
        .scriptSource(ScriptSourceProperty.builder()
                .scriptLocation("scriptLocation")

                // the properties below are optional
                .checksum("checksum")
                .s3VersionId("s3VersionId")
                .build())

        // the properties below are optional
        .arguments(List.of("arguments"))
        .executionPolicy("executionPolicy")
        .onError("onError")
        .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.PCS;

var nodeLifecycleScriptProperty = new NodeLifecycleScriptProperty {
    Name = "name",
    ScriptSource = new ScriptSourceProperty {
        ScriptLocation = "scriptLocation",

        // the properties below are optional
        Checksum = "checksum",
        S3VersionId = "s3VersionId"
    },

    // the properties below are optional
    Arguments = new [] { "arguments" },
    ExecutionPolicy = "executionPolicy",
    OnError = "onError"
};
```

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"

nodeLifecycleScriptProperty := &NodeLifecycleScriptProperty{
	Name: jsii.String("name"),
	ScriptSource: &ScriptSourceProperty{
		ScriptLocation: jsii.String("scriptLocation"),

		// the properties below are optional
		Checksum: jsii.String("checksum"),
		S3VersionId: jsii.String("s3VersionId"),
	},

	// the properties below are optional
	Arguments: []*string{
		jsii.String("arguments"),
	},
	ExecutionPolicy: jsii.String("executionPolicy"),
	OnError: jsii.String("onError"),
}
```

## Properties

- `arguments`: string[] — An ordered list of arguments passed to the script.

- `executionPolicy`: string — Whether the script runs only on the node's first boot (FIRST_BOOT_ONLY) or on every boot including reboots (EVERY_BOOT).

  Defaults to FIRST_BOOT_ONLY.

- `name`: string (required) — A human-readable name that identifies the script.

- `onError`: string — The behavior when the script exits with an error.

  Defaults to TERMINATE.

- `scriptSource`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnComputeNodeGroup.ScriptSourceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pcs.CfnComputeNodeGroup.ScriptSourceProperty.html) (required) — The external location of a lifecycle script.
