# PartitionKeyStep

Utility class to allow assigning a value or an auto-generated id to a partition key.

Obtainable from: [PrimaryKey.partition](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.PrimaryKey.html#partition)

- Source: [`aws-appsync/lib/key.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-appsync/lib/key.ts#L107)
- Type last changed: v2.60.0 · 12 Jan 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const partitionKeyStep = new appsync.PartitionKeyStep('key');
```

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_appsync as appsync

partition_key_step = appsync.PartitionKeyStep("key")
```

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.appsync.*;

PartitionKeyStep partitionKeyStep = new PartitionKeyStep("key");
```

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.AppSync;

var partitionKeyStep = new PartitionKeyStep("key");
```

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"

partitionKeyStep := awscdk.Aws_appsync.NewPartitionKeyStep(jsii.String("key"))
```

## Initializer

TypeScript:

```ts
new PartitionKeyStep(key: string)
```

Python:

```python
PartitionKeyStep(key: str)
```

Java:

```java
new PartitionKeyStep(String key)
```

C# / .NET:

```csharp
new PartitionKeyStep(string key)
```

Golang:

```go
NewPartitionKeyStep(Key *string)
```

## Methods

- `auto(): PartitionKey` — Assign an auto-generated value to the partition key.

- `is(val: string): PartitionKey` — Assign an auto-generated value to the partition key.
