# Identity

Identity.

Obtainable from: Identity.domain, Identity.email, Identity.publicHostedZone

- Source: [`aws-ses/lib/email-identity.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ses/lib/email-identity.ts#L120)
- Type last changed: v2.32.0 · 14 Jul 2022

## Example

TypeScript:

```ts
import * as iam from 'aws-cdk-lib/aws-iam';
declare const user: iam.User;

const identity = new ses.EmailIdentity(this, 'Identity', {
  identity: ses.Identity.domain('cdk.dev'),
});

identity.grantSendEmail(user);
```

Python:

```python
import aws_cdk.aws_iam as iam
# user: iam.User

identity = ses.EmailIdentity(self, "Identity",
    identity=ses.Identity.domain("cdk.dev")
)

identity.grant_send_email(user)
```

Java:

```java
import software.amazon.awscdk.services.iam.*;
User user;

EmailIdentity identity = EmailIdentity.Builder.create(this, "Identity")
        .identity(Identity.domain("cdk.dev"))
        .build();

identity.grantSendEmail(user);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.IAM;
User user;

var identity = new EmailIdentity(this, "Identity", new EmailIdentityProps {
    Identity = Identity.Domain("cdk.dev")
});

identity.GrantSendEmail(user);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import iam "github.com/aws/aws-cdk-go/awscdk"
var user User

identity := ses.NewEmailIdentity(this, jsii.String("Identity"), &EmailIdentityProps{
	Identity: ses.Identity_Domain(jsii.String("cdk.dev")),
})

identity.grantSendEmail(user)
```

## Initializer

TypeScript:

```ts
new Identity()
```

Python:

```python
Identity()
```

Java:

```java
new Identity()
```

C# / .NET:

```csharp
new Identity()
```

Golang:

```go
NewIdentity()
```

## Properties

- `hostedZone`: [IPublicHostedZone](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53.IPublicHostedZone.html) — The hosted zone associated with this identity.

  **Default:** no hosted zone is associated and no records are created

- `value`: string — The value of the identity.

## Methods

- `domain(domain: string): Identity // chainable` (static) — Verify a domain name.

  DKIM records will have to be added manually to complete the verification
  process

- `email(email: string): Identity // chainable` (static) — Verify an email address.

  To complete the verification process look for an email from
  no-reply-aws@amazon.com, open it and click the link.

- `publicHostedZone(hostedZone: IPublicHostedZone): Identity // chainable` (static) — Verify a public hosted zone.

  DKIM and MAIL FROM records will be added automatically to the hosted
  zone
