# Assign

Utility class representing the assigment of a value to an attribute.

Used as argument in: [AttributeValues (initializer)](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AttributeValues.html#initializer), [AttributeValuesStep (initializer)](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AttributeValuesStep.html#initializer), PartitionKey (initializer), PrimaryKey (initializer), SortKeyStep (initializer)

- Source: [`aws-appsync/lib/key.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appsync/lib/key.ts#L85)
- 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 assign = new appsync.Assign('attr', 'arg');
```

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("attr", "arg")
```

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 = new Assign("attr", "arg");
```

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 assign = new Assign("attr", "arg");
```

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"

assign := awscdk.Aws_appsync.NewAssign(jsii.String("attr"), jsii.String("arg"))
```

## Initializer

TypeScript:

```ts
new Assign(attr: string, arg: string)
```

Python:

```python
Assign(attr: str, arg: str)
```

Java:

```java
new Assign(String attr, String arg)
```

C# / .NET:

```csharp
new Assign(string attr, string arg)
```

Golang:

```go
NewAssign(Attr *string, Arg *string)
```

## Methods

- `putInMap(map: string): string` — Renders the assignment as a map element.

- `renderAsAssignment(): string` — Renders the assignment as a VTL string.
