Module: Awscli::Errors

Defined in:
lib/awscli/errors.rb

Defined Under Namespace

Classes: Error, LoadError, NotImplemented

Class Method Summary collapse

Class Method Details

.invalid_credentialsObject



60
61
62
63
# File 'lib/awscli/errors.rb', line 60

def self.invalid_credentials
  message = 'Invalid Credentials, Please check your AWS access and secret key id.'
  raise(Awscli::Errors::LoadError.new(message))
end

.invalid_regionObject



65
66
67
68
# File 'lib/awscli/errors.rb', line 65

def self.invalid_region
  message = "Invalid region found in config file (or) passed as an option , Available Regions are #{Awscli::Instances::REGIONS}"
  raise(Awscli::Errors::LoadError.new(message))
end

.missing_config_fileObject



35
36
37
38
39
40
# File 'lib/awscli/errors.rb', line 35

def self.missing_config_file
  message = "    File Load Error, check if file exists\n  ERRMSG2\n  raise(Awscli::Errors::LoadError.new(message))\nend\n".gsub(/^ {8}/, '')

.missing_credentialsObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/awscli/errors.rb', line 42

def self.missing_credentials
  message = "    MISSING CREDENTIALS\n    Add the following to your resource config file:\n    #############################\n    #Aws Credentials\n    #Key value pairs should look like this\n    #aws_access_key_id: 022QF06E7MXBSAMPLE\n    aws_access_key_id:\n    aws_secret_access_key:\n    region:\n    #\n    #End of Aws Credentials\n    ############################\n  ERRMSG3\n  raise(Awscli::Errors::LoadError.new(message))\nend\n".gsub(/^ {8}/, '')

.missing_environment_variableObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/awscli/errors.rb', line 20

def self.missing_environment_variable
  message = "    Missing AWSCLI_CONFIG_FILE environment variable\n    Please export the variable 'export AWSCLI_CONFIG_FILE=\"~/awscli_config.yml\"'\n    Contents of the file should be:\n    #########################################\n    #Aws Credentials\n    aws_access_key_id: YOUR_ACCESS_KEY\n    aws_secret_access_key: YOUR_SECRET_ACCESS_KEY\n    #End of Aws Credentials\n    ############################\n  ERRMSG1\n  raise(Awscli::Errors::LoadError.new(message))\nend\n".gsub(/^ {8}/, '')