InitPackage

class aws_cdk.aws_ec2.InitPackage(type, versions, package_name=None, service_handles=None)

Bases: aws_cdk.aws_ec2.InitElement

A package to be installed during cfn-init time.

Parameters
  • type (str) –

  • versions (List[str]) –

  • package_name (Optional[str]) –

  • service_handles (Optional[List[InitServiceRestartHandle]]) –

Attributes

element_type

Returns the init element type for this element.

Return type

str

Static Methods

classmethod apt(package_name, *, service_restart_handles=None, version=None)

Install a package using APT.

Parameters
  • package_name (str) –

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given services after this command has run. Default: - Do not restart any service

  • version (Optional[List[str]]) – Specify the versions to install. Default: - Install the latest version

Return type

InitPackage

classmethod msi(location, *, key=None, service_restart_handles=None)

Install an MSI package from an HTTP URL or a location on disk.

Parameters
  • location (str) –

  • key (Optional[str]) – Identifier key for this package. You can use this to order package installs. Default: - Automatically generated

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given service after this command has run. Default: - Do not restart any service

Return type

InitPackage

classmethod python(package_name, *, service_restart_handles=None, version=None)

Install a package from PyPI.

Parameters
  • package_name (str) –

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given services after this command has run. Default: - Do not restart any service

  • version (Optional[List[str]]) – Specify the versions to install. Default: - Install the latest version

Return type

InitPackage

classmethod rpm(location, *, key=None, service_restart_handles=None)

Install an RPM from an HTTP URL or a location on disk.

Parameters
  • location (str) –

  • key (Optional[str]) – Identifier key for this package. You can use this to order package installs. Default: - Automatically generated

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given service after this command has run. Default: - Do not restart any service

Return type

InitPackage

classmethod ruby_gem(gem_name, *, service_restart_handles=None, version=None)

Install a package from RubyGems.

Parameters
  • gem_name (str) –

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given services after this command has run. Default: - Do not restart any service

  • version (Optional[List[str]]) – Specify the versions to install. Default: - Install the latest version

Return type

InitPackage

classmethod yum(package_name, *, service_restart_handles=None, version=None)

Install a package using Yum.

Parameters
  • package_name (str) –

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given services after this command has run. Default: - Do not restart any service

  • version (Optional[List[str]]) – Specify the versions to install. Default: - Install the latest version

Return type

InitPackage