aws-cdk-lib.aws_ec2.ExecuteFileOptions

interface ExecuteFileOptions

LanguageType name
.NETAmazon.CDK.AWS.EC2.ExecuteFileOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#ExecuteFileOptions
Javasoftware.amazon.awscdk.services.ec2.ExecuteFileOptions
Pythonaws_cdk.aws_ec2.ExecuteFileOptions
TypeScript (source)aws-cdk-lib » aws_ec2 » ExecuteFileOptions

Options when executing a file.

Example

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

NameTypeDescription
filePathstringThe path to the file.
arguments?stringThe arguments to be passed to the file.

filePath

Type: string

The path to the file.


arguments?

Type: string (optional, default: No arguments are passed to the file.)

The arguments to be passed to the file.