Skip to content
v2.273.0

ExecuteFileOptions Struct ​

Options when executing a file.

Example ​

ts
import { Asset } from 'aws-cdk-lib/aws-s3-assets';

declare const instance: ec2.Instance;

const asset = new Asset(this, 'Asset', {
  path: './configure.sh'
});

const localPath = instance.userData.addS3DownloadCommand({
  bucket:asset.bucket,
  bucketKey:asset.s3ObjectKey,
  region: 'us-east-1', // Optional
});
instance.userData.addExecuteFileCommand({
  filePath:localPath,
  arguments: '--verbose -y'
});
asset.grantRead(instance.role);

Properties ​

argumentsstringargumentsstrargumentsStringArgumentsstringArguments*string= No arguments are passed to the f…#
The arguments to be passed to the file.
default

Default: No arguments are passed to the file.

filePathstringfile_pathstrfilePathStringFilePathstringFilePath*stringrequired#
The path to the file.