# LocationPackageOptions

Options for InitPackage.rpm/InitPackage.msi.

Used as argument in: [InitPackage.msi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InitPackage.html#msi), [InitPackage.rpm](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InitPackage.html#rpm)

- Source: [`aws-ec2/lib/cfn-init-elements.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/cfn-init-elements.ts#L616)

## Example

TypeScript:

```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 locationPackageOptions: ec2.LocationPackageOptions = {
  key: 'key',
  serviceRestartHandles: [initServiceRestartHandle],
};
```

Python:

```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

location_package_options = ec2.LocationPackageOptions(
    key="key",
    service_restart_handles=[init_service_restart_handle]
)
```

Java:

```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;

LocationPackageOptions locationPackageOptions = LocationPackageOptions.builder()
        .key("key")
        .serviceRestartHandles(List.of(initServiceRestartHandle))
        .build();
```

C# / .NET:

```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 locationPackageOptions = new LocationPackageOptions {
    Key = "key",
    ServiceRestartHandles = new [] { initServiceRestartHandle }
};
```

Golang:

```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

locationPackageOptions := &LocationPackageOptions{
	Key: jsii.String("key"),
	ServiceRestartHandles: []InitServiceRestartHandle{
		initServiceRestartHandle,
	},
}
```

## Properties

- `key`: string — Identifier key for this package.

  **Default:** Automatically generated

  You can use this to order package installs.

- `serviceRestartHandles`: [InitServiceRestartHandle](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InitServiceRestartHandle.html)[] — Restart the given service after this command has run.

  **Default:** Do not restart any service
