{"id":18104734,"url":"https://github.com/springmt/log-sample-cdk","last_synced_at":"2025-04-06T06:18:07.413Z","repository":{"id":66034624,"uuid":"393971855","full_name":"SpringMT/log-sample-cdk","owner":"SpringMT","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-17T07:03:28.000Z","size":174,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T11:52:09.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpringMT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-08T13:43:31.000Z","updated_at":"2021-08-17T07:06:47.000Z","dependencies_parsed_at":"2023-03-15T00:17:31.236Z","dependency_job_id":null,"html_url":"https://github.com/SpringMT/log-sample-cdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringMT%2Flog-sample-cdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringMT%2Flog-sample-cdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringMT%2Flog-sample-cdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpringMT%2Flog-sample-cdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpringMT","download_url":"https://codeload.github.com/SpringMT/log-sample-cdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441058,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T22:15:42.588Z","updated_at":"2025-04-06T06:18:07.406Z","avatar_url":"https://github.com/SpringMT.png","language":"TypeScript","readme":"# Welcome to your CDK TypeScript project!\n\nThis is a blank project for TypeScript development with CDK.\n\nThe `cdk.json` file tells the CDK Toolkit how to execute your app.\n\n## Useful commands\n\n * `npm run build`   compile typescript to js\n * `npm run watch`   watch for changes and compile\n * `npm run test`    perform the jest unit tests\n * `cdk deploy`      deploy this stack to your default AWS account/region\n * `cdk diff`        compare deployed stack with current state\n * `cdk synth`       emits the synthesized CloudFormation template\n\n## ハマったこと\n* CloudWatchとFirehoseの権限不足でエラー\n* CDKでIPアドレスがうまく解放されてなくてLimitにかかる\n* CloudWachのLogGroupがデフォルトretainでdeploy -\u003e destroy -\u003e deployでエラー\n* FargateはCPUとmemoryの組み合わせが決まっているのを知らずにやるとエラー\n\n## AWS Firelens\nsidecarに配置されるlog-router\n\nhttps://github.com/aws/aws-for-fluent-bit\n\n### awsfirelensを指定した場合\nsidecarを追加するCDKの実装\n* https://github.com/aws/aws-cdk/blob/a04c017323130cb6f88a530e192e9e0e86fb137a/packages/%40aws-cdk/aws-ecs/lib/base/task-definition.ts#L662-L671\n\nパーミッションとかもよしなにやってくれるのか？\n* https://github.com/aws/aws-cdk/blob/7966f8d48c4bff26beb22856d289f9d0c7e7081d/packages/%40aws-cdk/aws-ecs/lib/firelens-log-router.ts#L151-L177\n\nawsfirelensを指定したときのecs-agent\nhttps://github.com/aws/amazon-ecs-agent/blob/225bc3a556bd2d1759ab27b23f54e7e68086c9f0/agent/taskresource/firelens/firelens_unix.go#L470\n\nhttps://github.com/awslabs/go-config-generator-for-fluentd-and-fluentbit これ使っている\n\n## fluent-bit\nmacでコケたら\nhttps://github.com/fluent/fluent-bit/issues/1528\n\n## 参考\n* https://dev.classmethod.jp/articles/ecs-deploy-using-cdk/\n* https://docs.aws.amazon.com/cdk/latest/guide/about_examples.html\n\n### CloudWatch log のtail\n```\naws logs tail --follow ロググループ名\n```\n\n### S3のファイルのcat\n```\naws s3 cp s3://バケット名/ファイル名 -\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringmt%2Flog-sample-cdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringmt%2Flog-sample-cdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringmt%2Flog-sample-cdk/lists"}