@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-13T01:13:32.881Z") public class InitPackage extends InitElement
Example:
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(java.lang.String type,
java.util.List<java.lang.String> versions) |
protected |
InitPackage(java.lang.String type,
java.util.List<java.lang.String> versions,
java.lang.String packageName) |
protected |
InitPackage(java.lang.String type,
java.util.List<java.lang.String> versions,
java.lang.String packageName,
java.util.List<InitServiceRestartHandle> serviceHandles) |
Modifier and Type | Method and Description |
---|---|
static InitPackage |
apt(java.lang.String packageName)
Install a package using APT.
|
static InitPackage |
apt(java.lang.String packageName,
NamedPackageOptions options)
Install a package using APT.
|
java.lang.String |
getElementType()
Returns the init element type for this element.
|
static InitPackage |
msi(java.lang.String location)
Install an MSI package from an HTTP URL or a location on disk.
|
static InitPackage |
msi(java.lang.String location,
LocationPackageOptions options)
Install an MSI package from an HTTP URL or a location on disk.
|
static InitPackage |
python(java.lang.String packageName)
Install a package from PyPI.
|
static InitPackage |
python(java.lang.String packageName,
NamedPackageOptions options)
Install a package from PyPI.
|
protected java.lang.Object |
renderPackageVersions() |
static InitPackage |
rpm(java.lang.String location)
Install an RPM from an HTTP URL or a location on disk.
|
static InitPackage |
rpm(java.lang.String location,
LocationPackageOptions options)
Install an RPM from an HTTP URL or a location on disk.
|
static InitPackage |
rubyGem(java.lang.String gemName)
Install a package from RubyGems.
|
static InitPackage |
rubyGem(java.lang.String gemName,
NamedPackageOptions options)
Install a package from RubyGems.
|
static InitPackage |
yum(java.lang.String packageName)
Install a package using Yum.
|
static InitPackage |
yum(java.lang.String packageName,
NamedPackageOptions options)
Install a package using Yum.
|
protected InitPackage(software.amazon.jsii.JsiiObjectRef objRef)
protected InitPackage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected InitPackage(java.lang.String type, java.util.List<java.lang.String> versions, java.lang.String packageName, java.util.List<InitServiceRestartHandle> serviceHandles)
type
- This parameter is required.versions
- This parameter is required.packageName
- serviceHandles
- protected InitPackage(java.lang.String type, java.util.List<java.lang.String> versions, java.lang.String packageName)
type
- This parameter is required.versions
- This parameter is required.packageName
- protected InitPackage(java.lang.String type, java.util.List<java.lang.String> versions)
type
- This parameter is required.versions
- This parameter is required.public static InitPackage apt(java.lang.String packageName, NamedPackageOptions options)
packageName
- This parameter is required.options
- public static InitPackage apt(java.lang.String packageName)
packageName
- This parameter is required.public static InitPackage msi(java.lang.String location, LocationPackageOptions options)
location
- This parameter is required.options
- public static InitPackage msi(java.lang.String location)
location
- This parameter is required.public static InitPackage python(java.lang.String packageName, NamedPackageOptions options)
packageName
- This parameter is required.options
- public static InitPackage python(java.lang.String packageName)
packageName
- This parameter is required.public static InitPackage rpm(java.lang.String location, LocationPackageOptions options)
location
- This parameter is required.options
- public static InitPackage rpm(java.lang.String location)
location
- This parameter is required.public static InitPackage rubyGem(java.lang.String gemName, NamedPackageOptions options)
gemName
- This parameter is required.options
- public static InitPackage rubyGem(java.lang.String gemName)
gemName
- This parameter is required.public static InitPackage yum(java.lang.String packageName, NamedPackageOptions options)
packageName
- This parameter is required.options
- public static InitPackage yum(java.lang.String packageName)
packageName
- This parameter is required.protected java.lang.Object renderPackageVersions()
public java.lang.String getElementType()
getElementType
in class InitElement