aws-cdk-lib.aws_ec2.InitSourceOptions

interface InitSourceOptions

LanguageType name
.NETAmazon.CDK.AWS.EC2.InitSourceOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#InitSourceOptions
Javasoftware.amazon.awscdk.services.ec2.InitSourceOptions
Pythonaws_cdk.aws_ec2.InitSourceOptions
TypeScript (source)aws-cdk-lib » aws_ec2 » InitSourceOptions

Additional options for an InitSource.

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,
  })
);

Properties

NameTypeDescription
serviceRestartHandles?InitServiceRestartHandle[]Restart the given services after this archive has been extracted.

serviceRestartHandles?

Type: InitServiceRestartHandle[] (optional, default: Do not restart any service)

Restart the given services after this archive has been extracted.