InitElement

class aws_cdk.aws_ec2.InitElement

Bases: object

Base class for all CloudFormation Init elements.

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

element_type

Returns the init element type for this element.

Return type

str