@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.448Z") @Stability(value=Stable) public class InitPackage extends InitElement
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 |
InitPackage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
InitPackage(software.amazon.jsii.JsiiObjectRef objRef) |
protected |
InitPackage(String type,
List<String> versions) |
protected |
InitPackage(String type,
List<String> versions,
String packageName) |
protected |
InitPackage(String type,
List<String> versions,
String packageName,
List<InitServiceRestartHandle> serviceHandles) |
| Modifier and Type | Method and Description |
|---|---|
static InitPackage |
apt(String packageName)
Install a package using APT.
|
static InitPackage |
apt(String packageName,
NamedPackageOptions options)
Install a package using APT.
|
String |
getElementType()
Returns the init element type for this element.
|
static InitPackage |
msi(String location)
Install an MSI package from an HTTP URL or a location on disk.
|
static InitPackage |
msi(String location,
LocationPackageOptions options)
Install an MSI package from an HTTP URL or a location on disk.
|
static InitPackage |
python(String packageName)
Install a package from PyPI.
|
static InitPackage |
python(String packageName,
NamedPackageOptions options)
Install a package from PyPI.
|
protected Object |
renderPackageVersions() |
static InitPackage |
rpm(String location)
Install an RPM from an HTTP URL or a location on disk.
|
static InitPackage |
rpm(String location,
LocationPackageOptions options)
Install an RPM from an HTTP URL or a location on disk.
|
static InitPackage |
rubyGem(String gemName)
Install a package from RubyGems.
|
static InitPackage |
rubyGem(String gemName,
NamedPackageOptions options)
Install a package from RubyGems.
|
static InitPackage |
yum(String packageName)
Install a package using Yum.
|
static InitPackage |
yum(String packageName,
NamedPackageOptions options)
Install a package using Yum.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected InitPackage(software.amazon.jsii.JsiiObjectRef objRef)
protected InitPackage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
protected InitPackage(@NotNull
String type,
@NotNull
List<String> versions,
@Nullable
String packageName,
@Nullable
List<InitServiceRestartHandle> serviceHandles)
type - This parameter is required.versions - This parameter is required.packageName - serviceHandles - @Stability(value=Stable)
protected InitPackage(@NotNull
String type,
@NotNull
List<String> versions,
@Nullable
String packageName)
type - This parameter is required.versions - This parameter is required.packageName - @Stability(value=Stable) @NotNull public static InitPackage apt(@NotNull String packageName, @Nullable NamedPackageOptions options)
packageName - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitPackage apt(@NotNull String packageName)
packageName - This parameter is required.@Stability(value=Stable) @NotNull public static InitPackage msi(@NotNull String location, @Nullable LocationPackageOptions options)
location - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitPackage msi(@NotNull String location)
location - This parameter is required.@Stability(value=Stable) @NotNull public static InitPackage python(@NotNull String packageName, @Nullable NamedPackageOptions options)
packageName - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitPackage python(@NotNull String packageName)
packageName - This parameter is required.@Stability(value=Stable) @NotNull public static InitPackage rpm(@NotNull String location, @Nullable LocationPackageOptions options)
location - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitPackage rpm(@NotNull String location)
location - This parameter is required.@Stability(value=Stable) @NotNull public static InitPackage rubyGem(@NotNull String gemName, @Nullable NamedPackageOptions options)
gemName - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitPackage rubyGem(@NotNull String gemName)
gemName - This parameter is required.@Stability(value=Stable) @NotNull public static InitPackage yum(@NotNull String packageName, @Nullable NamedPackageOptions options)
packageName - This parameter is required.options - @Stability(value=Stable) @NotNull public static InitPackage yum(@NotNull String packageName)
packageName - This parameter is required.@Stability(value=Stable) @NotNull protected Object renderPackageVersions()
@Stability(value=Stable) @NotNull public String getElementType()
getElementType in class InitElementCopyright © 2022. All rights reserved.