Show / Hide Table of Contents

Class UserData

Instance User Data.

Inheritance
System.Object
UserData
MultipartUserData
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public abstract class UserData : DeputyBase
Syntax (vb)
Public MustInherit Class UserData
    Inherits DeputyBase
Remarks

ExampleMetadata: infused

Examples
MultipartUserData multipartUserData = new MultipartUserData();
UserData commandsUserData = UserData.ForLinux();
multipartUserData.AddUserDataPart(commandsUserData, MultipartBody.SHELL_SCRIPT, true);

// Adding commands to the multipartUserData adds them to commandsUserData, and vice-versa.
multipartUserData.AddCommands("touch /root/multi.txt");
commandsUserData.AddCommands("touch /root/userdata.txt");

Synopsis

Constructors

UserData()
UserData(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

UserData(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Methods

AddCommands(String[])

Add one or more commands to the user data.

AddExecuteFileCommand(IExecuteFileOptions)

Adds commands to execute a file.

AddOnExitCommands(String[])

Add one or more commands to the user data that will run when the script exits.

AddS3DownloadCommand(IS3DownloadOptions)

Adds commands to download a file from S3.

AddSignalOnExitCommand(Resource)

Adds a command which will send a cfn-signal when the user data script ends.

Custom(String)

Create a userdata object with custom content.

ForLinux(ILinuxUserDataOptions)

Create a userdata object for Linux hosts.

ForOperatingSystem(OperatingSystemType)
ForWindows()

Create a userdata object for Windows hosts.

Render()

Render the UserData for use in a construct.

Constructors

UserData()

protected UserData()

UserData(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected UserData(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

UserData(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected UserData(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Methods

AddCommands(String[])

Add one or more commands to the user data.

public abstract void AddCommands(params string[] commands)
Parameters
commands System.String[]

AddExecuteFileCommand(IExecuteFileOptions)

Adds commands to execute a file.

public abstract void AddExecuteFileCommand(IExecuteFileOptions params)
Parameters
params IExecuteFileOptions

AddOnExitCommands(String[])

Add one or more commands to the user data that will run when the script exits.

public abstract void AddOnExitCommands(params string[] commands)
Parameters
commands System.String[]

AddS3DownloadCommand(IS3DownloadOptions)

Adds commands to download a file from S3.

public abstract string AddS3DownloadCommand(IS3DownloadOptions params)
Parameters
params IS3DownloadOptions
Returns

System.String

: The local path that the file will be downloaded to

AddSignalOnExitCommand(Resource)

Adds a command which will send a cfn-signal when the user data script ends.

public abstract void AddSignalOnExitCommand(Resource resource)
Parameters
resource Resource

Custom(String)

Create a userdata object with custom content.

public static UserData Custom(string content)
Parameters
content System.String
Returns

UserData

ForLinux(ILinuxUserDataOptions)

Create a userdata object for Linux hosts.

public static UserData ForLinux(ILinuxUserDataOptions options = null)
Parameters
options ILinuxUserDataOptions
Returns

UserData

ForOperatingSystem(OperatingSystemType)

public static UserData ForOperatingSystem(OperatingSystemType os)
Parameters
os OperatingSystemType
Returns

UserData

ForWindows()

Create a userdata object for Windows hosts.

public static UserData ForWindows()
Returns

UserData

Render()

Render the UserData for use in a construct.

public abstract string Render()
Returns

System.String

Back to top Generated by DocFX