interface InitFileOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.InitFileOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#InitFileOptions |
![]() | software.amazon.awscdk.services.ec2.InitFileOptions |
![]() | aws_cdk.aws_ec2.InitFileOptions |
![]() | aws-cdk-lib » aws_ec2 » InitFileOptions |
Options for InitFile.
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
Name | Type | Description |
---|---|---|
base64 | boolean | True if the inlined content (from a string or file) should be treated as base64 encoded. |
group? | string | The name of the owning group for this file. |
mode? | string | A six-digit octal value representing the mode for this file. |
owner? | string | The name of the owning user for this file. |
service | Init [] | Restart the given service after this file has been written. |
base64Encoded?
Type:
boolean
(optional, default: 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.
group?
Type:
string
(optional, default: 'root')
The name of the owning group for this file.
Not supported for Windows systems.
mode?
Type:
string
(optional, default: '000644')
A six-digit octal value representing the mode for this file.
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.
owner?
Type:
string
(optional, default: 'root')
The name of the owning user for this file.
Not supported for Windows systems.
serviceRestartHandles?
Type:
Init
[]
(optional, default: Do not restart any service)
Restart the given service after this file has been written.