Module: AWSCDK::IAM::IGroup
- Includes:
- IIdentity, AWSCDK::Interfaces::AWSIAM::IGroupRef
- Included in:
- Group
- Defined in:
- iam/i_group.rb
Overview
Represents an IAM Group.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_managed_policy(policy) ⇒ void
Attaches a managed policy to this principal.
-
#add_to_principal_policy(statement) ⇒ AWSCDK::IAM::AddToPrincipalPolicyResult
Add to the policy of this principal.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#assume_role_action ⇒ String
When this Principal is used in an AssumeRole policy, the action to use.
-
#attach_inline_policy(policy) ⇒ void
Attaches an inline policy to this principal.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
The principal to grant permissions to.
-
#group_arn ⇒ String
Returns the IAM Group ARN.
-
#group_name ⇒ String
Returns the IAM Group Name.
-
#group_ref ⇒ AWSCDK::Interfaces::AWSIAM::GroupReference
A reference to a Group resource.
-
#node ⇒ Constructs::Node
The tree node.
-
#policy_fragment ⇒ AWSCDK::IAM::PrincipalPolicyFragment
Return the policy fragment that identifies this principal in a Policy.
-
#principal_account ⇒ String?
The AWS account ID of this principal.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'iam/i_group.rb', line 154 def self.jsii_overridable_methods { :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false }, :assume_role_action => { kind: :property, name: "assumeRoleAction", is_optional: false }, :policy_fragment => { kind: :property, name: "policyFragment", is_optional: false }, :principal_account => { kind: :property, name: "principalAccount", is_optional: true }, :node => { kind: :property, name: "node", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :stack => { kind: :property, name: "stack", is_optional: false }, :group_ref => { kind: :property, name: "groupRef", is_optional: false }, :group_arn => { kind: :property, name: "groupArn", is_optional: false }, :group_name => { kind: :property, name: "groupName", is_optional: false }, :add_to_principal_policy => { kind: :method, name: "addToPrincipalPolicy", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :add_managed_policy => { kind: :method, name: "addManagedPolicy", is_optional: false }, :attach_inline_policy => { kind: :method, name: "attachInlinePolicy", is_optional: false }, } end |
Instance Method Details
#add_managed_policy(policy) ⇒ void
This method returns an undefined value.
Attaches a managed policy to this principal.
138 139 140 141 |
# File 'iam/i_group.rb', line 138 def add_managed_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklNYW5hZ2VkUG9saWN5In0=")), "policy") jsii_call_method("addManagedPolicy", [policy]) end |
#add_to_principal_policy(statement) ⇒ AWSCDK::IAM::AddToPrincipalPolicyResult
Add to the policy of this principal.
98 99 100 101 |
# File 'iam/i_group.rb', line 98 def add_to_principal_policy(statement) Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement") jsii_call_method("addToPrincipalPolicy", [statement]) end |
#apply_removal_policy(policy) ⇒ void
This method returns an undefined value.
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
129 130 131 132 |
# File 'iam/i_group.rb', line 129 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#assume_role_action ⇒ String
When this Principal is used in an AssumeRole policy, the action to use.
21 22 23 |
# File 'iam/i_group.rb', line 21 def assume_role_action() jsii_get_property("assumeRoleAction") end |
#attach_inline_policy(policy) ⇒ void
This method returns an undefined value.
Attaches an inline policy to this principal.
This is the same as calling policy.addToXxx(principal).
149 150 151 152 |
# File 'iam/i_group.rb', line 149 def attach_inline_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeSJ9")), "policy") jsii_call_method("attachInlinePolicy", [policy]) end |
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
62 63 64 |
# File 'iam/i_group.rb', line 62 def env() jsii_get_property("env") end |
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
The principal to grant permissions to.
14 15 16 |
# File 'iam/i_group.rb', line 14 def grant_principal() jsii_get_property("grantPrincipal") end |
#group_arn ⇒ String
Returns the IAM Group ARN.
83 84 85 |
# File 'iam/i_group.rb', line 83 def group_arn() jsii_get_property("groupArn") end |
#group_name ⇒ String
Returns the IAM Group Name.
90 91 92 |
# File 'iam/i_group.rb', line 90 def group_name() jsii_get_property("groupName") end |
#group_ref ⇒ AWSCDK::Interfaces::AWSIAM::GroupReference
A reference to a Group resource.
76 77 78 |
# File 'iam/i_group.rb', line 76 def group_ref() jsii_get_property("groupRef") end |
#node ⇒ Constructs::Node
The tree node.
47 48 49 |
# File 'iam/i_group.rb', line 47 def node() jsii_get_property("node") end |
#policy_fragment ⇒ AWSCDK::IAM::PrincipalPolicyFragment
Return the policy fragment that identifies this principal in a Policy.
28 29 30 |
# File 'iam/i_group.rb', line 28 def policy_fragment() jsii_get_property("policyFragment") end |
#principal_account ⇒ String?
The AWS account ID of this principal.
Can be undefined when the account is not known (for example, for service principals). Can be a Token - in that case, it's assumed to be AWS::AccountId.
40 41 42 |
# File 'iam/i_group.rb', line 40 def principal_account() jsii_get_property("principalAccount") end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
69 70 71 |
# File 'iam/i_group.rb', line 69 def stack() jsii_get_property("stack") end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.
110 111 112 113 114 115 |
# File 'iam/i_group.rb', line 110 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |