> **Experimental**
>
> `@aws-cdk/aws-elasticache-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ServerlessCacheGrants

Collection of grant methods for a IServerlessCacheRef.

Obtainable from: ServerlessCacheGrants.fromServerlessCache

- Stability: [Experimental](/cdk/api/stability.html)
- Source: Generated at build time

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as elasticache_alpha from '@aws-cdk/aws-elasticache-alpha';
import { aws_elasticache as interfaces_elasticache } from 'aws-cdk-lib/interfaces';

declare const serverlessCacheRef: interfaces_elasticache.IServerlessCacheRef;
const serverlessCacheGrants = elasticache_alpha.ServerlessCacheGrants.fromServerlessCache(serverlessCacheRef);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_elasticache_alpha as elasticache_alpha
from aws_cdk.interfaces import aws_elasticache as interfaces_elasticache

# serverless_cache_ref: interfaces_elasticache.IServerlessCacheRef

serverless_cache_grants = elasticache_alpha.ServerlessCacheGrants.from_serverless_cache(serverless_cache_ref)
```

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.elasticache.alpha.*;
import software.amazon.awscdk.interfaces.elasticache.*;

IServerlessCacheRef serverlessCacheRef;

ServerlessCacheGrants serverlessCacheGrants = ServerlessCacheGrants.fromServerlessCache(serverlessCacheRef);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.ElastiCache.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElastiCache.Alpha;
using Amazon.CDK.Interfaces.ElastiCache;

IServerlessCacheRef serverlessCacheRef;

var serverlessCacheGrants = ServerlessCacheGrants.FromServerlessCache(serverlessCacheRef);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import elasticache_alpha "github.com/aws/aws-cdk-go/awscdkelasticachealpha"
import "github.com/aws/aws-cdk-go/awscdk"

var serverlessCacheRef IServerlessCacheRef

serverlessCacheGrants := elasticache_alpha.ServerlessCacheGrants_FromServerlessCache(serverlessCacheRef)
```

## Methods

- `actions(grantee: IGrantable, actions: string[], options?: PermissionsOptions): Grant` — Grant the given identity custom permissions.

- `connect(grantee: IGrantable): Grant` — Grant connect permissions to the cache.

- `fromServerlessCache(resource: IServerlessCacheRef): ServerlessCacheGrants // chainable` (static) — Creates grants for ServerlessCacheGrants.
