Class: AWSCDK::EKS::ServiceAccount

Inherits:
Constructs::Construct
  • Object
show all
Includes:
IAM::IPrincipal
Defined in:
eks/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 'eks/service_account.rb', line 12

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::EKS::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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLlNlcnZpY2VBY2NvdW50UHJvcHMifQ==")), "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
# File 'eks/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_principal_policy => { kind: :method, name: "addToPrincipalPolicy", is_optional: false },
  }
end

Instance Method Details

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

Add to the policy of this principal.



111
112
113
114
# File 'eks/service_account.rb', line 111

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)


45
46
47
# File 'eks/service_account.rb', line 45

def assume_role_action()
  jsii_get_property("assumeRoleAction")
end

#grant_principalAWSCDK::IAM::IPrincipal

The principal to grant permissions to.



52
53
54
# File 'eks/service_account.rb', line 52

def grant_principal()
  jsii_get_property("grantPrincipal")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


38
39
40
# File 'eks/service_account.rb', line 38

def node()
  jsii_get_property("node")
end

#policy_fragmentAWSCDK::IAM::PrincipalPolicyFragment

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



59
60
61
# File 'eks/service_account.rb', line 59

def policy_fragment()
  jsii_get_property("policyFragment")
end

#roleAWSCDK::IAM::IRole

The role which is linked to the service account.

Returns:



66
67
68
# File 'eks/service_account.rb', line 66

def role()
  jsii_get_property("role")
end

#service_account_nameString

The name of the service account.

Returns:

  • (String)


73
74
75
# File 'eks/service_account.rb', line 73

def ()
  jsii_get_property("serviceAccountName")
end

#service_account_namespaceString

The namespace where the service account is located in.

Returns:

  • (String)


80
81
82
# File 'eks/service_account.rb', line 80

def ()
  jsii_get_property("serviceAccountNamespace")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


87
88
89
# File 'eks/service_account.rb', line 87

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



100
101
102
103
104
105
# File 'eks/service_account.rb', line 100

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