Class: AWSCDK::IAM::PermissionsBoundary

Inherits:
Jsii::Object
  • Object
show all
Defined in:
iam/permissions_boundary.rb

Overview

Modify the Permissions Boundaries of Users and Roles in a construct tree.

policy = AWSCDK::IAM::ManagedPolicy.from_aws_managed_policy_name("ReadOnlyAccess")
AWSCDK::IAM::PermissionsBoundary.of(self).apply(policy)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ PermissionsBoundary

Returns a new instance of PermissionsBoundary.

Raises:

  • (NoMethodError)


13
14
15
# File 'iam/permissions_boundary.rb', line 13

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

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
22
# File 'iam/permissions_boundary.rb', line 17

def self.jsii_overridable_methods
  {
    :apply => { kind: :method, name: "apply", is_optional: false },
    :clear => { kind: :method, name: "clear", is_optional: false },
  }
end

.of(scope) ⇒ AWSCDK::IAM::PermissionsBoundary

Access the Permissions Boundaries of a construct tree.

Parameters:

  • scope (Constructs::IConstruct)

Returns:

  • (AWSCDK::IAM::PermissionsBoundary)


28
29
30
31
# File 'iam/permissions_boundary.rb', line 28

def self.of(scope)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_iam.PermissionsBoundary", "of", [scope])
end

Instance Method Details

#apply(boundary_policy) ⇒ void

This method returns an undefined value.

Apply the given policy as Permissions Boundary to all Roles and Users in the scope.

Will override any Permissions Boundaries configured previously; in case a Permission Boundary is applied in multiple scopes, the Boundary applied closest to the Role wins.

Parameters:



41
42
43
44
# File 'iam/permissions_boundary.rb', line 41

def apply(boundary_policy)
  Jsii::Type.check_type(boundary_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklNYW5hZ2VkUG9saWN5In0=")), "boundaryPolicy")
  jsii_call_method("apply", [boundary_policy])
end

#clearvoid

This method returns an undefined value.

Remove previously applied Permissions Boundaries.



49
50
51
# File 'iam/permissions_boundary.rb', line 49

def clear()
  jsii_call_method("clear", [])
end