# PartitionKey

Specifies the assignment to the partition key.

It can be
enhanced with the assignment of the sort key.

Extends: PrimaryKey › PartitionKey

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

## Example

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

declare const assign: appsync.Assign;
const partitionKey = new appsync.PartitionKey(assign);
```

## Initializer

```ts
new PartitionKey(pkey: Assign)
```

## Methods

- `partition(key: string): PartitionKeyStep` (static) — Allows assigning a value to the partition key.

- `renderTemplate(): string` — Renders the key assignment to a VTL string.

- `sort(key: string): SortKeyStep` — Allows assigning a value to the sort key.
