interface ExecuteFileOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.ExecuteFileOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#ExecuteFileOptions |
Java | software.amazon.awscdk.services.ec2.ExecuteFileOptions |
Python | aws_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
Name | Type | Description |
---|---|---|
file | string | The path to the file. |
arguments? | string | The 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.