Skip to content
v2.277.0

NamedPackageOptions Struct ​

Options for InitPackage.yum/apt/rubyGem/python.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const initServiceRestartHandle: ec2.InitServiceRestartHandle;
const namedPackageOptions: ec2.NamedPackageOptions = {
  serviceRestartHandles: [initServiceRestartHandle],
  version: ['version'],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

# init_service_restart_handle: ec2.InitServiceRestartHandle

named_package_options = ec2.NamedPackageOptions(
    service_restart_handles=[init_service_restart_handle],
    version=["version"]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

InitServiceRestartHandle initServiceRestartHandle;

NamedPackageOptions namedPackageOptions = NamedPackageOptions.builder()
        .serviceRestartHandles(List.of(initServiceRestartHandle))
        .version(List.of("version"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

InitServiceRestartHandle initServiceRestartHandle;

var namedPackageOptions = new NamedPackageOptions {
    ServiceRestartHandles = new [] { initServiceRestartHandle },
    Version = new [] { "version" }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var initServiceRestartHandle InitServiceRestartHandle

namedPackageOptions := &NamedPackageOptions{
	ServiceRestartHandles: []InitServiceRestartHandle{
		initServiceRestartHandle,
	},
	Version: []*string{
		jsii.String("version"),
	},
}

Properties ​

serviceRestartHandlesoptionalInitServiceRestartHandle[]service_restart_handlesoptionaltyping.List[InitServiceRestartHandle]serviceRestartHandlesoptionalList<InitServiceRestartHandle>ServiceRestartHandlesoptionalInitServiceRestartHandle[]ServiceRestartHandlesoptional*[]InitServiceRestartHandle#
Restart the given services after this command has run.

Default: Do not restart any service

versionoptionalstring[]versionoptionaltyping.List[str]versionoptionalList<String>Versionoptionalstring[]Versionoptional*[]*string#
Specify the versions to install.

Default: Install the latest version