InitSourceOptions

class aws_cdk.aws_ec2.InitSourceOptions(*, service_restart_handles=None)

Bases: object

Additional options for an InitSource.

Parameters

service_restart_handles (Optional[Sequence[InitServiceRestartHandle]]) – Restart the given services after this archive has been extracted. Default: - Do not restart any service

Example:

# my_bucket is of type Bucket


handle = ec2.InitServiceRestartHandle()

ec2.CloudFormationInit.from_elements(
    ec2.InitFile.from_string("/etc/nginx/nginx.conf", "...", service_restart_handles=[handle]),
    ec2.InitSource.from_s3_object("/var/www/html", my_bucket, "html.zip", service_restart_handles=[handle]),
    ec2.InitService.enable("nginx",
        service_restart_handle=handle
    ))

Attributes

service_restart_handles

Restart the given services after this archive has been extracted.

Default
  • Do not restart any service

Return type

Optional[List[InitServiceRestartHandle]]