Class: AWSCDK::ECS::ClusterGrants

Inherits:
Jsii::Object
  • Object
show all
Defined in:
ecs/cluster_grants.rb

Overview

Collection of grant methods for a IClusterRef.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ClusterGrants

Returns a new instance of ClusterGrants.

Raises:

  • (NoMethodError)


8
9
10
# File 'ecs/cluster_grants.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_ecs.ClusterGrants does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.from_cluster(resource) ⇒ AWSCDK::ECS::ClusterGrants

Creates grants for ClusterGrants.

Parameters:

Returns:

  • (AWSCDK::ECS::ClusterGrants)


23
24
25
26
# File 'ecs/cluster_grants.rb', line 23

def self.from_cluster(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lY3MuSUNsdXN0ZXJSZWYifQ==")), "resource")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.ClusterGrants", "fromCluster", [resource])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
# File 'ecs/cluster_grants.rb', line 12

def self.jsii_overridable_methods
  {
    :resource => { kind: :property, name: "resource", is_optional: false },
    :task_protection => { kind: :method, name: "taskProtection", is_optional: false },
  }
end

Instance Method Details

#resourceAWSCDK::Interfaces::AWSECS::IClusterRef



29
30
31
# File 'ecs/cluster_grants.rb', line 29

def resource()
  jsii_get_property("resource")
end

#task_protection(grantee) ⇒ AWSCDK::IAM::Grant

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.

Parameters:

Returns:



40
41
42
43
# File 'ecs/cluster_grants.rb', line 40

def task_protection(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("taskProtection", [grantee])
end