0
0

More than 1 year has passed since last update.

AWSであれこれ試す

Last updated at Posted at 2022-12-18

AWSであれこれ試すための参考にしたこと

URLからメモリに読み込む

URLからメモリに読み込みS3に直接書き込む

いろいろ参考にした。CLI環境でリソースを読み込んで実施。

    url_path = r'https://www.data.jma.go.jp/obd/stats/data/mdrr/snc_rct/alltable/snc00_rct.csv'
    response = urllib.request.urlopen(url_path)
    data = response.read()

    s3 = boto3.resource('s3')
    bucket_name = 'test-bucket'
    object_key = 'putdir/put.csv'

    s3.Bucket(bucket_name).put_object(Key=object_key, Body=data)

Lambda から S3へファイルを置くのに苦労

BOM追加

@echo off

call :GET_FILENAME %1

GOTO :END

:GET_FILENAME

echo     %~1
echo     %~p1
echo     %~n1

echo %~d1%~p1%~n1-BOM%~x1

copy /b .\utf8bom.bin+%1 %~d1%~p1%~n1-BOM%~x1

GridJsでリスト表示

まずはテストから。

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <link href="https://unpkg.com/gridjs/dist/theme/mermaid.min.css" rel="stylesheet"/>
    <script src="https://unpkg.com/gridjs/dist/gridjs.umd.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="index.js"></script>
  </head>
  <body>
    <div id="wrapper"></div>
  </body>

<script>
  abc()
</script>
</html>
function abc(){
  new gridjs.Grid({
    columns: ["Name", "Email", "Phone Number"],
    data: [
      ["John", "john@example.com", "(353) 01 222 3333"],
      ["Mark", "mark@gmail.com", "(01) 22 888 4444"],
    ]
  }).render(document.getElementById("wrapper"));
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0