@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.451Z") @Stability(value=Stable) public class InitUser extends InitElement
Users are created as non-interactive system users with a shell of /sbin/nologin. This is by design and cannot be modified.
Not supported for Windows systems.
Example:
// Example automatically generated from non-compiling source. May contain errors.
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
Instance.Builder.create(this, "Instance")
.vpc(vpc)
.instanceType(instanceType)
.machineImage(machineImage)
// Showing the most complex setup, if you have simpler requirements
// you can use `CloudFormationInit.fromElements()`.
.init(CloudFormationInit.fromConfigSets(ConfigSetProps.builder()
.configSets(Map.of(
// Applies the configs below in this order
"default", List.of("yumPreinstall", "config")))
.configs(Map.of(
"yumPreinstall", new InitConfig(List.of(InitPackage.yum("git"))),
"config", new InitConfig(List.of(InitFile.fromObject("/etc/stack.json", Map.of(
"stackId", Stack.of(this).getStackId(),
"stackName", Stack.of(this).getStackName(),
"region", Stack.of(this).getRegion())), InitGroup.fromName("my-group"), InitUser.fromName("my-user"), InitPackage.rpm("http://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/r/rubygem-git-1.5.0-2.el8.noarch.rpm")))))
.build()))
.initOptions(ApplyCloudFormationInitOptions.builder()
// Optional, which configsets to activate (['default'] by default)
.configSets(List.of("default"))
// Optional, how long the installation is expected to take (5 minutes by default)
.timeout(Duration.minutes(30))
// Optional, whether to include the --url argument when running cfn-init and cfn-signal commands (false by default)
.includeUrl(true)
// Optional, whether to include the --role argument when running cfn-init and cfn-signal commands (false by default)
.includeRole(true)
.build())
.build();
| Modifier | Constructor and Description |
|---|---|
protected |
InitUser(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
InitUser(software.amazon.jsii.JsiiObjectRef objRef) |
protected |
InitUser(String userName,
InitUserOptions userOptions) |
| Modifier and Type | Method and Description |
|---|---|
static InitUser |
fromName(String userName)
Create a user from user name.
|
static InitUser |
fromName(String userName,
InitUserOptions options)
Create a user from user name.
|
String |
getElementType()
Returns the init element type for this element.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected InitUser(software.amazon.jsii.JsiiObjectRef objRef)
protected InitUser(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
protected InitUser(@NotNull
String userName,
@NotNull
InitUserOptions userOptions)
userName - This parameter is required.userOptions - This parameter is required.@Stability(value=Stable) @NotNull public static InitUser fromName(@NotNull String userName, @Nullable InitUserOptions options)
userName - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitUser fromName(@NotNull String userName)
userName - This parameter is required.@Stability(value=Stable) @NotNull public String getElementType()
getElementType in class InitElementCopyright © 2022. All rights reserved.