Class: AuroraDataApi::Environment
- Inherits:
-
Object
- Object
- AuroraDataApi::Environment
- Defined in:
- lib/aurora-data-api/environment.rb
Class Method Summary collapse
- .database_name ⇒ Object
-
.offline? ⇒ Boolean
Resources about “OFFLINE”: www.serverless.com/plugins/serverless-offline github.com/koxudaxi/local-data-api.
- .offline_endpoint ⇒ Object
- .region ⇒ Object
- .resource_arn ⇒ Object
- .secret_arn ⇒ Object
Class Method Details
.database_name ⇒ Object
17 18 19 |
# File 'lib/aurora-data-api/environment.rb', line 17 def self.database_name ENV["PGDATABASE"] || ENV["MYSQL_DATABASE"] end |
.offline? ⇒ Boolean
Resources about “OFFLINE”:
https://www.serverless.com/plugins/serverless-offline
https://github.com/koxudaxi/local-data-api
9 10 11 |
# File 'lib/aurora-data-api/environment.rb', line 9 def self.offline? ENV["IS_OFFLINE"] == "true" end |
.offline_endpoint ⇒ Object
13 14 15 |
# File 'lib/aurora-data-api/environment.rb', line 13 def self.offline_endpoint "http://local-data-api" end |
.region ⇒ Object
21 22 23 |
# File 'lib/aurora-data-api/environment.rb', line 21 def self.region ENV.fetch("AWS_DEFAULT_REGION", "ap-northeast-1") end |
.resource_arn ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/aurora-data-api/environment.rb', line 33 def self.resource_arn if offline? "arn:aws:rds:us-east-1:123456789012:cluster:dummy" else ENV["RDS_RESOURCE_ARN"] end end |
.secret_arn ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/aurora-data-api/environment.rb', line 25 def self.secret_arn if offline? "arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy" else ENV["RDS_SECRET_ARN"] end end |