Class InitServiceRestartHandle
An object that represents reasons to restart an InitService.
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class InitServiceRestartHandle : DeputyBase
Syntax (vb)
Public Class InitServiceRestartHandle
Inherits DeputyBase
Remarks
Pass an instance of this object to the InitFile
, InitCommand
,
InitSource
and InitPackage
objects, and finally to an InitService
itself to cause the actions (files, commands, sources, and packages)
to trigger a restart of the service.
For example, the following will run a custom command to install Nginx, and trigger the nginx service to be restarted after the command has run.
var handle = new InitServiceRestartHandle();
CloudFormationInit.FromElements(InitCommand.ShellCommand("/usr/bin/custom-nginx-install.sh", new InitCommandOptions { ServiceRestartHandles = new [] { handle } }), InitService.Enable("nginx", new InitServiceOptions { ServiceRestartHandle = handle }));
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
InitServiceRestartHandle() | |
InitServiceRestartHandle(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
InitServiceRestartHandle(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Constructors
InitServiceRestartHandle()
public InitServiceRestartHandle()
InitServiceRestartHandle(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected InitServiceRestartHandle(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
InitServiceRestartHandle(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected InitServiceRestartHandle(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props