aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.92k forks source link

(aws-ec2): systemd support for CloudFormation Init #19075

Open ericljiang opened 2 years ago

ericljiang commented 2 years ago

Description

It looks like CloudFormation has added systemd support for the services key in CloudFormation::Init.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html#aws-resource-init-services:

Services

You can use the services key to define which services should be enabled or disabled when the instance is launched. On Linux systems, this key is supported by using sysvinit or systemd.

This request is to add support to add systemd support to the InitService class.

Use Case

Currently you need to use InitCommand with a shell command to start a start a service with systemd from cfn-init. Using InitService would be cleaner, less error-prone, and more readable.

Proposed Solution

Add a property to InitServiceOptions to allow user to specify sysvinit or systemd. The entry will be synthesized using the "sysvinit" or "systemd" key based on this property. The property can default to sysvinit to be backwards compatible.

Other information

No response

Acknowledge

corymhall commented 2 years ago

I am unassigning and marking this issue as p2, which means that we are unable to work on this immediately.

We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.