Class: AWSCDK::EC2::InitServiceRestartHandle
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EC2::InitServiceRestartHandle
- Defined in:
- ec2/init_service_restart_handle.rb
Overview
An object that represents reasons to restart an InitService.
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.
handle = AWSCDK::EC2::InitServiceRestartHandle.new
AWSCDK::EC2::CloudFormationInit.from_elements(AWSCDK::EC2::InitCommand.shell_command("/usr/bin/custom-nginx-install.sh", {service_restart_handles: [handle]}), AWSCDK::EC2::InitService.enable("nginx", {service_restart_handle: handle}))
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ InitServiceRestartHandle
constructor
A new instance of InitServiceRestartHandle.
Constructor Details
#initialize ⇒ InitServiceRestartHandle
Returns a new instance of InitServiceRestartHandle.
21 22 23 |
# File 'ec2/init_service_restart_handle.rb', line 21 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
.jsii_overridable_methods ⇒ Object
25 26 27 28 |
# File 'ec2/init_service_restart_handle.rb', line 25 def self.jsii_overridable_methods { } end |