(ec2): Support UserData interface in MultipartUserData #14346
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Simply, provide a way-forward whereby attempting to use the
add*Command
methods inherited fromUserData
do not throw exceptions. Rather, invoking the methods onMultipartUserData
passes the invocation through to a designatedUserData
object.Use Case
CDK construct libraries (like https://github.com/aws/aws-rfdk) allow the customer to provide a
UserData
object into an L3 construct. That L3 construct may use the provided UserData object in the creation of Instances, AutoScaling Groups, etc, but also use methods on the UserData such asaddCommands()
,addS3DownloadCommand()
, etc to set up initialization required by the L3 construct.Having these methods on the
MultipartUserData
throw exceptions makes it awkward at best to integrate the class with these libraries. Without this change toMultipartUserData
these libraries would be required to accept both aUserData
andMultipartUserData
property to supportMultipartUserData
-- commands would be added to theUserData
, but theMultipartUserData
would be used to actually render the Instance/ASG's -- and enforce, somehow, that the givenUserData
is a part in the givenMultipartUserData
. It's all very awkward.Proposed Solution
I have a candidate PR prepped, and will be posting it momentarily.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: