class ClusterGrants
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.ClusterGrants |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#ClusterGrants |
Java | software.amazon.awscdk.services.ecs.ClusterGrants |
Python | aws_cdk.aws_ecs.ClusterGrants |
TypeScript | aws-cdk-lib » aws_ecs » ClusterGrants |
Collection of grant methods for a IClusterRef.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_ecs as interfaces_aws_ecs } from 'aws-cdk-lib/interfaces';
declare const clusterRef: interfaces_aws_ecs.IClusterRef;
const clusterGrants = ecs.ClusterGrants.fromCluster(clusterRef);
Properties
| Name | Type | Description |
|---|---|---|
| resource | ICluster |
resource
Type:
ICluster
Methods
| Name | Description |
|---|---|
| task | Grants an ECS Task Protection API permission to the specified grantee. |
| static from | Creates grants for ClusterGrants. |
taskProtection(grantee)
public taskProtection(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grants an ECS Task Protection API permission to the specified grantee.
This method provides a streamlined way to assign the 'ecs:UpdateTaskProtection' permission, enabling the grantee to manage task protection in the ECS cluster.
static fromCluster(resource)
public static fromCluster(resource: IClusterRef): ClusterGrants
Parameters
- resource
IClusterRef
Returns
Creates grants for ClusterGrants.

.NET
Go
Java
Python
TypeScript