Class InitServiceOptions
Options for an InitService.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class InitServiceOptions : Object, IInitServiceOptions
Syntax (vb)
Public Class InitServiceOptions
Inherits Object
Implements IInitServiceOptions
Remarks
ExampleMetadata: infused
Examples
Bucket myBucket;
var handle = new InitServiceRestartHandle();
CloudFormationInit.FromElements(InitFile.FromString("/etc/nginx/nginx.conf", "...", new InitFileOptions { ServiceRestartHandles = new [] { handle } }), InitSource.FromS3Object("/var/www/html", myBucket, "html.zip", new InitSourceOptions { ServiceRestartHandles = new [] { handle } }), InitService.Enable("nginx", new InitServiceOptions {
ServiceRestartHandle = handle
}));
Synopsis
Constructors
InitServiceOptions() |
Properties
Enabled | Enable or disable this service. |
EnsureRunning | Make sure this service is running or not running after cfn-init finishes. |
ServiceRestartHandle | Restart service when the actions registered into the restartHandle have been performed. |
Constructors
InitServiceOptions()
public InitServiceOptions()
Properties
Enabled
Enable or disable this service.
public Nullable<bool> Enabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Set to true to ensure that the service will be started automatically upon boot.
Set to false to ensure that the service will not be started automatically upon boot.
Default: - true if used in InitService.enable()
, no change to service
state if used in InitService.fromOptions()
.
EnsureRunning
Make sure this service is running or not running after cfn-init finishes.
public Nullable<bool> EnsureRunning { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Set to true to ensure that the service is running after cfn-init finishes.
Set to false to ensure that the service is not running after cfn-init finishes.
Default: - same value as enabled
.
ServiceRestartHandle
Restart service when the actions registered into the restartHandle have been performed.
public InitServiceRestartHandle ServiceRestartHandle { get; set; }
Property Value
Remarks
Register actions into the restartHandle by passing it to InitFile
, InitCommand
,
InitPackage
and InitSource
objects.
Default: - No files trigger restart