Class: AWSCDK::EKSv2::ServiceAccount

Inherits:
Constructs::Construct
  • Object
show all
Includes:
IAM::IPrincipal
Defined in:
ek_sv2/service_account.rb

Overview

Service Account.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ ServiceAccount

Returns a new instance of ServiceAccount.

Parameters:



12
13
14
15
16
17
18
# File 'ek_sv2/service_account.rb', line 12

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::EKSv2::ServiceAccountProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLlNlcnZpY2VBY2NvdW50UHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'ek_sv2/service_account.rb', line 20

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :assume_role_action => { kind: :property, name: "assumeRoleAction", is_optional: false },
    :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false },
    :policy_fragment => { kind: :property, name: "policyFragment", is_optional: false },
    :role => { kind: :property, name: "role", is_optional: false },
    :service_account_name => { kind: :property, name: "serviceAccountName", is_optional: false },
    :service_account_namespace => { kind: :property, name: "serviceAccountNamespace", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :add_to_policy => { kind: :method, name: "addToPolicy", is_optional: false },
    :add_to_principal_policy => { kind: :method, name: "addToPrincipalPolicy", is_optional: false },
  }
end

Instance Method Details

#add_to_policy(statement) ⇒ Boolean

Deprecated.

use addToPrincipalPolicy()

Add to the policy of this principal.

Parameters:

Returns:

  • (Boolean)


113
114
115
116
# File 'ek_sv2/service_account.rb', line 113

def add_to_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToPolicy", [statement])
end

#add_to_principal_policy(statement) ⇒ AWSCDK::IAM::AddToPrincipalPolicyResult

Add to the policy of this principal.



122
123
124
125
# File 'ek_sv2/service_account.rb', line 122

def add_to_principal_policy(statement)
  Jsii::Type.check_type(statement, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeVN0YXRlbWVudCJ9")), "statement")
  jsii_call_method("addToPrincipalPolicy", [statement])
end

#assume_role_actionString

When this Principal is used in an AssumeRole policy, the action to use.

Returns:

  • (String)


46
47
48
# File 'ek_sv2/service_account.rb', line 46

def assume_role_action()
  jsii_get_property("assumeRoleAction")
end

#grant_principalAWSCDK::IAM::IPrincipal

The principal to grant permissions to.



53
54
55
# File 'ek_sv2/service_account.rb', line 53

def grant_principal()
  jsii_get_property("grantPrincipal")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


39
40
41
# File 'ek_sv2/service_account.rb', line 39

def node()
  jsii_get_property("node")
end

#policy_fragmentAWSCDK::IAM::PrincipalPolicyFragment

Return the policy fragment that identifies this principal in a Policy.



60
61
62
# File 'ek_sv2/service_account.rb', line 60

def policy_fragment()
  jsii_get_property("policyFragment")
end

#roleAWSCDK::IAM::IRole

The role which is linked to the service account.

Returns:



67
68
69
# File 'ek_sv2/service_account.rb', line 67

def role()
  jsii_get_property("role")
end

#service_account_nameString

The name of the service account.

Returns:

  • (String)


74
75
76
# File 'ek_sv2/service_account.rb', line 74

def ()
  jsii_get_property("serviceAccountName")
end

#service_account_namespaceString

The namespace where the service account is located in.

Returns:

  • (String)


81
82
83
# File 'ek_sv2/service_account.rb', line 81

def ()
  jsii_get_property("serviceAccountNamespace")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


88
89
90
# File 'ek_sv2/service_account.rb', line 88

def to_string()
  jsii_call_method("toString", [])
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. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



101
102
103
104
105
106
# File 'ek_sv2/service_account.rb', line 101

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