ExecuteFileOptions

class aws_cdk.aws_ec2.ExecuteFileOptions(*, file_path, arguments=None)

Bases: object

Options when executing a file.

Parameters:
  • file_path (str) – The path to the file.

  • arguments (Optional[str]) – The arguments to be passed to the file. Default: No arguments are passed to the file.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_s3_assets import Asset

# instance: ec2.Instance


asset = Asset(self, "Asset",
    path="./configure.sh"
)

local_path = instance.user_data.add_s3_download_command(
    bucket=asset.bucket,
    bucket_key=asset.s3_object_key,
    region="us-east-1"
)
instance.user_data.add_execute_file_command(
    file_path=local_path,
    arguments="--verbose -y"
)
asset.grant_read(instance.role)

Attributes

arguments

The arguments to be passed to the file.

Default:

No arguments are passed to the file.

file_path

The path to the file.