class InitElement
| Language | Type name | 
|---|---|
  .NET | Amazon.CDK.AWS.EC2.InitElement | 
  Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#InitElement | 
  Java | software.amazon.awscdk.services.ec2.InitElement | 
  Python | aws_cdk.aws_ec2.InitElement | 
  TypeScript (source) | aws-cdk-lib » aws_ec2 » InitElement | 
Implemented by
Init, Init, Init, Init, Init
Base class for all CloudFormation Init elements.
Example
declare const myBucket: s3.Bucket;
const handle = new ec2.InitServiceRestartHandle();
ec2.CloudFormationInit.fromElements(
  ec2.InitFile.fromString('/etc/nginx/nginx.conf', '...', { serviceRestartHandles: [handle] }),
  ec2.InitSource.fromS3Object('/var/www/html', myBucket, 'html.zip', { serviceRestartHandles: [handle] }),
  ec2.InitService.enable('nginx', {
    serviceRestartHandle: handle,
  })
);
Initializer
new InitElement()
Properties
| Name | Type | Description | 
|---|---|---|
| element | string | Returns the init element type for this element. | 
elementType
Type:
string
Returns the init element type for this element.

 .NET
 Go
 Java
 Python
 TypeScript (