# AppSyncEventResource

A class used to generate resource arns for AppSync Event APIs.

Obtainable from: AppSyncEventResource.all, AppSyncEventResource.allChannelNamespaces, AppSyncEventResource.forAPI, AppSyncEventResource.ofChannelNamespace
Used as argument in: [IEventApi.grant](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.IEventApi.html#grant)

- Source: [`aws-appsync/lib/appsync-common.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appsync/lib/appsync-common.ts#L10)
- Type last changed: v2.178.0 · 6 Feb 2025

## 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 appSyncEventResource = appsync.AppSyncEventResource.all();
```

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

app_sync_event_resource = appsync.AppSyncEventResource.all()
```

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

AppSyncEventResource appSyncEventResource = AppSyncEventResource.all();
```

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 appSyncEventResource = AppSyncEventResource.All();
```

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"

appSyncEventResource := awscdk.Aws_appsync.AppSyncEventResource_All()
```

## Methods

- `all(): AppSyncEventResource // chainable` (static) — Generate the resource names that accepts all types: `*`.

- `allChannelNamespaces(): AppSyncEventResource // chainable` (static) — Generate the resource names that accepts all channel namespaces: `*`.

- `forAPI(): AppSyncEventResource // chainable` (static) — Generate a resource for the calling API.

- `ofChannelNamespace(channelNamespace: string): AppSyncEventResource // chainable` (static) — Generate the resource names given a channel namespace.

  **Parameters**

  - `channelNamespace` — The channel namespace that needs to be allowed.

- `resourceArns(api: EventApiBase): string[]` — Return the Resource ARN.

  **Parameters**

  - `api` — The AppSync API to give permissions.
