# SortKeyStep

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

- 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#L129)
- 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';

declare const assign: appsync.Assign;
const sortKeyStep = new appsync.SortKeyStep(assign, 'skey');
```

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

# assign: appsync.Assign

sort_key_step = appsync.SortKeyStep(assign, "skey")
```

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

Assign assign;

SortKeyStep sortKeyStep = new SortKeyStep(assign, "skey");
```

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;

Assign assign;

var sortKeyStep = new SortKeyStep(assign, "skey");
```

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 assign Assign

sortKeyStep := awscdk.Aws_appsync.NewSortKeyStep(assign, jsii.String("skey"))
```

## Initializer

TypeScript:

```ts
new SortKeyStep(pkey: Assign, skey: string)
```

Python:

```python
SortKeyStep(pkey: Assign, skey: str)
```

Java:

```java
new SortKeyStep(Assign pkey, String skey)
```

C# / .NET:

```csharp
new SortKeyStep(Assign pkey, string skey)
```

Golang:

```go
NewSortKeyStep(Pkey Assign, Skey *string)
```

## Methods

- `auto(): PrimaryKey` — Assign an auto-generated value to the sort key.

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