Class: Clusters::Providers::Aws

Inherits:
ApplicationRecord show all
Includes:
Concerns::ProviderStatus, Gitlab::Utils::StrongMemoize
Defined in:
app/models/clusters/providers/aws.rb

Constant Summary collapse

DEFAULT_REGION =
'us-east-1'

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#api_clientObject


48
49
50
51
52
# File 'app/models/clusters/providers/aws.rb', line 48

def api_client
  strong_memoize(:api_client) do
    ::Aws::CloudFormation::Client.new(credentials: credentials, region: region)
  end
end

#created_by_userObject


68
69
70
# File 'app/models/clusters/providers/aws.rb', line 68

def created_by_user
  cluster.user
end

#credentialsObject


54
55
56
57
58
# File 'app/models/clusters/providers/aws.rb', line 54

def credentials
  strong_memoize(:credentials) do
    ::Aws::Credentials.new(access_key_id, secret_access_key, session_token)
  end
end

#has_rbac_enabled?Boolean

Returns:

  • (Boolean)

60
61
62
# File 'app/models/clusters/providers/aws.rb', line 60

def has_rbac_enabled?
  true
end

#knative_pre_installed?Boolean

Returns:

  • (Boolean)

64
65
66
# File 'app/models/clusters/providers/aws.rb', line 64

def knative_pre_installed?
  false
end

#nullify_credentialsObject


40
41
42
43
44
45
46
# File 'app/models/clusters/providers/aws.rb', line 40

def nullify_credentials
  assign_attributes(
    access_key_id: nil,
    secret_access_key: nil,
    session_token: nil
  )
end