2020-06-18
aws_cloud_watch_agent

最近遇到 EC2 上,Disk 滿了,server 有問題的情形,加 EBS 後,想說應該來設定 alert
找 Cloud Watch 沒有這個 metrics
查了一下後,發現需要安裝 CloudWatch Agent,才能收集到 disk percent usage 的資料

使用 CloudWatch Agent 的簡易步驟

Reference

Read More

2020-06-02
aws_glue_study_note

基本概念

  • Data Store

遇到的問題

  • 設定 connection 後,無法連結到 RDS
    • 出現的 error code 為 “At least one security group must open all ingress ports.To limit traffic, the source security group in your inbound rule can be restricted to the same security group”
    • google 後,Error的情形為Error: Inbound Rule in Security Group Required,照著說明的方式進行,test connection 就通過囉
    • 原因:security group 沒有設定好,沒有 allow security-group 本身所有的 tcp 都可以連
    • Setting Up a VPC to Connect to JDBC Data Stores

轉換 json 的資料

連動的方式

ETL job

目前 glue 的 job, 可以用 純 python or PySpark 來寫 script code, 我目前是用 PySpark 來嘗試

Reference

Read More

2020-06-02
aws_parquet_data

最近在嘗試使用 parquet & AWS athena,剛好有 google 到一些資料,先隨手記錄一下

有關 AWS Glue 相關資料

Reference

Read More

2020-05-22
watch_cloudwatch_tag

原因

  • 近來在加 AWS resource 的 tag,其中 cloudwatch 的 tag,無法由 AWS console 來看。用程式加了之後,一直找不到 cloud watch 的 tag 是否有加成功

結果

  • 找了一段時間後,才發現原來要用 aws logs help 來找,用 aws clodwatch 是找不到的
    1
    2
    3
    4
    5
    6
    7
    $ aws logs list-tags-log-group --log-group-name /aws/lambda/log-group-name
    {
    "tags": {
    "env": "dev",
    "service": "xxx-service"
    }
    }

Reference

同場加映

  • 要看 aws cloud watch log 的話,可以用 awslogs,還滿好用的
  • jorgebastida/awslogs
  • 要找需要看的 log group 時,還滿方便的
    1
    $ awslogs groups | grep -i v3 | grep -i dev
Read More

2020-05-22
add_tag_on_serverless

原因

  • 為了要細分 AWS cost 用到那部分,常見的方式為使用 Tag 來區分

做法

  • 在 serverless.conf 中的 provider block 加 stackTags , 可以標註 tag
    1
    2
    3
    4
    5
    provider:
    stackTags:
    owner: owner
    env: ${self:custom.stage}
    service: service

可以加強的部分

  • 因為 stack tag,會有些 AWS resources 沒有加到 tag, 可以用 “Serverless Repository apps” 來加強
  • lumigo-io/SAR-Propagate-CFN-Tags
    • SAR app to propagate CloudFormation’s stack tags to resources that are currently not propagated automatically - e.g. CloudWatch Logs

Reference

Read More