Skip to content
v2.274.0

InitFileOptions Struct ​

Options for InitFile.

Example ​

ts
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 ​

base64Encodedbooleanbase64_encodedboolbase64EncodedBooleanBase64EncodedboolBase64Encoded*bool= false#
True if the inlined content (from a string or file) should be treated as base64 encoded.

Only applicable for inlined string and file content.

groupstringgroupstrgroupStringGroupstringGroup*string= 'root'#
The name of the owning group for this file.

Not supported for Windows systems.

modestringmodestrmodeStringModestringMode*string= '000644'#
A six-digit octal value representing the mode for this file.
notes

Use the first three digits for symlinks and the last three digits for setting permissions. To create a symlink, specify 120xxx, where xxx defines the permissions of the target file. To specify permissions for a file, use the last three digits, such as 000644.

Not supported for Windows systems.

ownerstringownerstrownerStringOwnerstringOwner*string= 'root'#
The name of the owning user for this file.

Not supported for Windows systems.

serviceRestartHandlesInitServiceRestartHandle[]service_restart_handlestyping.List[InitServiceRestartHandle]serviceRestartHandlesList<InitServiceRestartHandle>ServiceRestartHandlesInitServiceRestartHandle[]ServiceRestartHandles*[]InitServiceRestartHandle= Do not restart any service#
Restart the given service after this file has been written.

Used as props by ​