Class: Pangea::Kubernetes::Architecture::IamResult

Inherits:
Contracts::IamResult
  • Object
show all
Defined in:
lib/pangea/kubernetes/architecture.rb

Overview

AWS-specific IamResult — extends the base contract with AWS fields. is_a?(Pangea::Contracts::IamResult) returns true.

Direct Known Subclasses

AwsEksIamResult, GcpIamResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIamResult

Returns a new instance of IamResult.



237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/pangea/kubernetes/architecture.rb', line 237

def initialize
  super
  @log_group = nil
  @ecr_policy = nil
  @etcd_policy = nil
  @logs_policy = nil
  @ec2_policy = nil
  @ssm_policy = nil
  @karpenter_role = nil
  @karpenter_profile = nil
  @persistent_state_policy = nil
end

Instance Attribute Details

#ec2_policyObject

Returns the value of attribute ec2_policy.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def ec2_policy
  @ec2_policy
end

#ecr_policyObject

Returns the value of attribute ecr_policy.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def ecr_policy
  @ecr_policy
end

#etcd_policyObject

Returns the value of attribute etcd_policy.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def etcd_policy
  @etcd_policy
end

#karpenter_profileObject

Returns the value of attribute karpenter_profile.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def karpenter_profile
  @karpenter_profile
end

#karpenter_roleObject

Returns the value of attribute karpenter_role.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def karpenter_role
  @karpenter_role
end

#log_groupObject

Returns the value of attribute log_group.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def log_group
  @log_group
end

#logs_policyObject

Returns the value of attribute logs_policy.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def logs_policy
  @logs_policy
end

#persistent_state_policyObject

Returns the value of attribute persistent_state_policy.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def persistent_state_policy
  @persistent_state_policy
end

#ssm_policyObject

Returns the value of attribute ssm_policy.



231
232
233
# File 'lib/pangea/kubernetes/architecture.rb', line 231

def ssm_policy
  @ssm_policy
end

Instance Method Details

#[](key) ⇒ Object

Hash-style access for backward compatibility



251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/pangea/kubernetes/architecture.rb', line 251

def [](key)
  case key.to_sym
  when :log_group then log_group
  when :ecr_policy then ecr_policy
  when :etcd_policy then etcd_policy
  when :logs_policy then logs_policy
  when :ec2_policy then ec2_policy
  when :ssm_policy then ssm_policy
  when :karpenter_role then karpenter_role
  when :karpenter_profile then karpenter_profile
  when :persistent_state_policy then persistent_state_policy
  else super
  end
end

#to_hObject



266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/pangea/kubernetes/architecture.rb', line 266

def to_h
  hash = super
  hash[:log_group] = log_group if log_group
  hash[:ecr_policy] = ecr_policy if ecr_policy
  hash[:etcd_policy] = etcd_policy if etcd_policy
  hash[:logs_policy] = logs_policy if logs_policy
  hash[:ec2_policy] = ec2_policy if ec2_policy
  hash[:ssm_policy] = ssm_policy if ssm_policy
  hash[:karpenter_role] = karpenter_role if karpenter_role
  hash[:karpenter_profile] = karpenter_profile if karpenter_profile
  hash[:persistent_state_policy] = persistent_state_policy if persistent_state_policy
  hash
end