Top Level Namespace

Defined Under Namespace

Modules: ActiveRecord, ApplicationHelper, AwsLambda, Jets, Kernel Classes: ApplicationController, ApplicationItem, ApplicationJob, ApplicationRecord, BasePathMapping, BucketConfigurator, Thor

Constant Summary collapse

STAGE_NAME =
"<%= @stage_name %>"

Instance Method Summary collapse

Instance Method Details

#lambda_handler(event:, context:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/jets/internal/app/functions/jets/base_path.rb', line 7

def lambda_handler(event:, context:)
  cfn = CfnResponse.new(event, context)
  cfn.response do
    mapping = BasePathMapping.new(event, STAGE_NAME)
    case event['RequestType']
    when "Create", "Update"
      mapping.update
    when "Delete"
      mapping.delete(true) if mapping.should_delete?
    end
  end
end