Class InitService
A services that be enabled, disabled or restarted when the instance is launched.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class InitService : InitElement
Syntax (vb)
Public Class InitService
Inherits InitElement
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
InitService(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
InitService(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
ElementType | Returns the init element type for this element. |
Methods
Disable(String) | Disable and stop the given service. |
Enable(String, IInitServiceOptions) | Enable and start the given service, optionally restarting it. |
Constructors
InitService(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected InitService(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
InitService(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected InitService(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
ElementType
Returns the init element type for this element.
public override string ElementType { get; }
Property Value
System.String
Overrides
Methods
Disable(String)
Disable and stop the given service.
public static InitService Disable(string serviceName)
Parameters
- serviceName System.String
Returns
Enable(String, IInitServiceOptions)
Enable and start the given service, optionally restarting it.
public static InitService Enable(string serviceName, IInitServiceOptions options = null)
Parameters
- serviceName System.String
- options IInitServiceOptions
Returns