- Create IAM Role with s3 access
- Create Lambda function(delete-s3-file) with Ruby 2.7
require 'aws-sdk-s3'
S3_CLIENT = Aws::S3::Client.new
def lambda_handler(event:, context:)
resp = S3_CLIENT.delete_object({
bucket: event['bucket'],
class Api::DocsController < ApplicationController | |
def index | |
@html = Aws::S3::Object.new(ENV['API_DOCS_BUCKET'], ENV['API_DOCS_FILE_NAME']).get.body.string | |
render html: @html.html_safe, content_type: "text/html" | |
end | |
end |
name: API Documentation | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
db: |
require 'acceptance_helper' | |
resource 'Users' do | |
header "Content-Type", "application/json" | |
route "/api/users", "Add User" do | |
parameter :name, "User name", type: :string, example: 'John Wick', required: true | |
parameter :email, "User email", type: :string, example: 'user@test.com', required: true | |
parameter :password, "User password", type: :string, required: true | |
parameter :password_confirmation, type: :string, required: true |