{"id":15120,"date":"2019-09-30T09:00:48","date_gmt":"2019-09-30T00:00:48","guid":{"rendered":"https:\/\/www.agent-grow.com\/self20percent\/?p=15120"},"modified":"2019-09-24T09:48:12","modified_gmt":"2019-09-24T00:48:12","slug":"aws-cdk-python","status":"publish","type":"post","link":"https:\/\/www.agent-grow.com\/self20percent\/2019\/09\/30\/aws-cdk-python\/","title":{"rendered":"AWS CDK(Cloud Development Kit) \u3092 python \u3067\u4f7f\u3063\u3066\u307f\u308b"},"content":{"rendered":"<h1>AWS \u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406<\/h1>\n<p>\u307f\u306a\u3055\u3093\u3001AWS \u4f7f\u3063\u3066\u307e\u3059\u304b\uff1f<\/p>\n<p>AWS \u306b\u306f\u672c\u5f53\u306b\u305f\u304f\u3055\u3093\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3089\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u65e9\u304f\u3001\u7c21\u5358\u306b\u3001\u305d\u3057\u3066\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u306b\u74b0\u5883\u3092\u69cb\u7bc9\u3067\u304d\u308b\u3053\u3068\u304c<br \/>\nAWS \u306e\u9b45\u529b\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u305f\u3060\u3001\u30b5\u30fc\u30d3\u30b9\u304c\u591a\u3044\u5206\u3001\u305d\u308c\u3089\u3092\u6b63\u3057\u304f\u8a2d\u5b9a\u3057\u3066\u9023\u643a\u3055\u305b\u3066\u3044\u304f\u3053\u3068\u306f<br \/>\n\u666e\u901a\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3059\u308b\u3053\u3068\u3001\u3082\u3057\u304f\u306f\u305d\u308c\u4ee5\u4e0a\u306b\u9aa8\u304c\u6298\u308c\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u672c\u756a\u74b0\u5883\u3092\u4e00\u3064\u4f5c\u308b\u3060\u3051\u3067\u3042\u308c\u3070\u3001Web \u306e\u753b\u9762\u304b\u3089\u30de\u30a6\u30b9\u3067\u30dd\u30c1\u30dd\u30c1\u3067\u4f5c\u3063\u3066\u3044\u3063\u3066\u3082\u826f\u3044\u306e\u3067\u3057\u3087\u3046\u304c\u3001<br \/>\n\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u74b0\u5883\u3068\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3068\u30c6\u30b9\u30c8\u74b0\u5883\u3068\u2026\u3068\u304b\u3084\u3063\u3066\u305f\u3089\u5927\u5909\u3067\u3059\u3002<\/p>\n<p>\u4f55\u306a\u3089\u3001\u69cb\u6210\u3092\u9014\u4e2d\u3067\u5909\u66f4\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3060\u3063\u3066\u3088\u304f\u3042\u308b\u3053\u3068\u3067\u3059\u304c\u3001<br \/>\n\u4e00\u30ab\u6240\u5909\u3048\u305f\u3068\u304d\u306b\u4ed6\u306e\u74b0\u5883\u3082\u6b63\u3057\u304f\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3068\u3044\u3046\u3053\u3068\u3092\u3001<br \/>\n\u8ab0\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u3053\u308c\u3089\u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u306f\u30af\u30e9\u30a6\u30c9\u3067\u958b\u767a\u3092\u3059\u308b\u305f\u3081\u306b\u306f\u3068\u3066\u3082\u91cd\u8981\u306a\u3053\u3068\u3067\u3042\u308a\u3001<br \/>\n\u5b9f\u969b\u306b AWS \u3067\u306f\u6bd4\u8f03\u7684\u65e9\u3044\u6bb5\u968e\u304b\u3089(\u30ea\u30bd\u30fc\u30b9\u306e\u7a2e\u985e\u304c\u5897\u3048\u3066\u304d\u305f\u9803\u306b)<br \/>\nCloudFormation \u3068\u3044\u3046\u3001\u30ea\u30bd\u30fc\u30b9\u3092\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u5168\u3066\u7acb\u3061\u4e0a\u3052\u3001\u7ba1\u7406\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e CloudFormation \u3001\u5404\u74b0\u5883\u3092\u5168\u304f\u540c\u3058\u3088\u3046\u306b\u7acb\u3061\u4e0a\u3052\u3001\u5909\u66f4\u3057\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3068\u3066\u3082\u4fbf\u5229\u306a\u306e\u3067\u3059\u304c\u3001<br \/>\n\u4e00\u70b9\u554f\u984c\u306a\u306e\u304c\u3001\u305f\u3060\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4f8b\u3048\u3070 10 \u500b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u7528\u610f\u3057\u305f\u3051\u308c\u3070\u540c\u3058\u3088\u3046\u306a\u8a18\u8ff0\u3092 10 \u56de\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3057\u3001<br \/>\n\u30a4\u30de\u30c9\u30ad IDE \u306f\u5165\u529b\u3057\u305f\u3044\u3053\u3068\u3092\u88dc\u5b8c\u3057\u3066\u304f\u308c\u307e\u3059\u304c\u3001\u305d\u3046\u3044\u3063\u305f\u3082\u306e\u3082\u52b9\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u8fd1\u5e74\u4f5c\u3089\u308c\u305f\u306e\u304c AWS CDK \u306a\u306e\u3067\u3059\u306d\u3002<br \/>\n\u3053\u308c\u306f\u3001CloudFormation \u306e\u8a18\u8ff0\u5185\u5bb9\u3092\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30fc\u30c9\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u4f7f\u3046\u3068\u3001\u672c\u5f53\u306b\u666e\u901a\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3088\u3046\u306b\u3001\u5feb\u9069\u306b\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u3053\u306e AWS CDK \u3092\u89e6\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h1>AWS CDK (Pyhotn) \u304b\u3089 Cognito \u3092\u7acb\u3061\u4e0a\u3052\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u65e9\u901f\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u3059\u3067\u306b\u3044\u304f\u3089\u304b\u3053\u3046\u3044\u3063\u305f\u8a18\u4e8b\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u5927\u4f53 EC2 \u3068\u304b S3 \u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u306e\u3067\u3001<br \/>\n\u4eca\u56de\u306f\u3061\u3087\u3063\u3068\u30de\u30cb\u30a2\u30c3\u30af\u306a\u3068\u3053\u308d\u3067 Cognito (Web \u3067\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30ed\u30b0\u30a4\u30f3\u7b49\u3005\u3092\u30a4\u30a4\u611f\u3058\u306b\u3057\u3066\u304f\u308c\u308b\u3084\u3064)\u3092\u7acb\u3061\u4e0a\u3052\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u52a0\u3048\u3066\u3001TypeScript \u3092\u4f7f\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u304c\u4e16\u306b\u51fa\u56de\u3063\u3066\u307e\u3059\u304c\u3001<br \/>\n\u4eca\u56de\u306f Python \u3092\u3064\u304b\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<h2>\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>\u307e\u305a\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u521d\u671f\u8a2d\u5b9a\u3067\u3059\u306d\u3002<br \/>\n\u5148\u307b\u3069 Python \u3092\u4f7f\u3046\u3068\u8a00\u3044\u307e\u3057\u305f\u304c\u3001\u624b\u5143\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f<br \/>\nnode.js \u3067\u4f5c\u6210\u3055\u308c\u305f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3092\u5165\u308c\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3068\u308a\u3042\u3048\u305a node \u3068 python (python \u306f 3 \u7cfb\u3092\u4f7f\u3044\u307e\u3059) \u304c\u52d5\u304b\u305b\u308b\u74b0\u5883\u3092\u7528\u610f\u3057\u305f\u3089<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnpm install -g aws-cdk\n<\/pre>\n<p>\u3067\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3089\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308a\u305f\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u304b\u3089<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncdk init --language=python\n<\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u305d\u308d\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"15121\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/09\/30\/aws-cdk-python\/%e7%84%a1%e9%a1%8c-86\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-1.png\" data-orig-size=\"666,184\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-1.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-1-300x83.png\" alt=\"\" width=\"300\" height=\"83\" class=\"alignnone size-medium wp-image-15121\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-1-300x83.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-1.png 666w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u3067\u3001AWS \u306f\u89aa\u5207\u306b\u3082 virtualenv \u3092\u4f7f\u3063\u3066\u3059\u3050\u958b\u767a\u304c\u9032\u3081\u3089\u308c\u308b\u3088\u3046\u306b\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7cfb\u306e\u30d5\u30a1\u30a4\u30eb\u3082\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u304c\u3001<br \/>\n\u4eca\u56de\u306f pipenv \u3092\u4f7f\u3044\u305f\u3044\u3068\u3044\u3046\u79c1\u306e\u4e00\u5b58\u3067\u305d\u306e\u3042\u305f\u308a\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u3054\u3063\u305d\u308a\u524a\u9664\u3002<\/p>\n<p>(\u516c\u5f0f\u306e virtualenv \u3092\u4f7f\u3046\u624b\u9806\u306f\u3001<br \/>\nhttps:\/\/docs.aws.amazon.com\/ja_jp\/cdk\/latest\/guide\/getting_started.html<br \/>\n\u3053\u306e\u3042\u305f\u308a\u3092\u8aad\u3093\u3060\u3089\u5206\u304b\u308b\u304b\u3068\u601d\u3044\u307e\u3059)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"15122\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/09\/30\/aws-cdk-python\/%e7%84%a1%e9%a1%8c-87\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" data-orig-size=\"632,74\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-2.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-2-300x35.png\" alt=\"\" width=\"300\" height=\"35\" class=\"alignnone size-medium wp-image-15122\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-2-300x35.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/0d40a5e4a645fc6b96e767d64ac0878e-2.png 632w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>.git \u306f git \u7ba1\u7406\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u3001\u5b9f\u8cea\u6b8b\u3063\u305f\u306e\u306f app.py \u3068 cdk.json \u3060\u3051\u3067\u3059\u306d\u3002<br \/>\ncdk.json \u306f\u5148\u307b\u3069\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f cdk \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u64cd\u4f5c\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u53c2\u7167\u3055\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u3001\u3053\u308c\u306f\u305d\u306e\u307e\u307e\u7f6e\u3044\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\napp.py \u306e\u65b9\u304c\u3001\u5b9f\u969b\u306b\u5b9f\u884c\u3055\u308c\u308b python \u30d5\u30a1\u30a4\u30eb\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001 pipenv \u3092\u4f7f\u3063\u3066\u5fc5\u8981\u306a\u4f9d\u5b58\u95a2\u4fc2\u3092\u6301\u3063\u3066\u304d\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npipenv --python 3\n<\/pre>\n<p>\u4e0a\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001pipenv \u306b\u5fc5\u8981\u306a Pipfile \u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001 CDK \u3092\u4f7f\u3046\u4e0a\u3067\u5fc5\u305a\u5fc5\u8981\u306b\u306a\u308b core \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npipenv install aws_cdk.core\n<\/pre>\n<p>CDK \u95a2\u9023\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u5168\u3066 <code>aws_cdk.*<\/code> \u306e\u5f62\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3088\u3002<br \/>\n\u3053\u308c\u3067\u3001 CDK \u3092\u66f8\u304d\u59cb\u3081\u308b\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h2>Cognito \u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u3063\u3066\u307f\u308b<\/h2>\n<p>\u3067\u306f\u65e9\u901f Cognito \u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001Cognito \u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u4f9d\u5b58\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npipenv install aws_cdk.aws_cognito\n<\/pre>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5165\u3063\u305f\u3089\u3001\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a cdk \u3068\u8a00\u3046\u540d\u524d\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\npython \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306a\u306e\u3067\u3001 <code>__init__.py<\/code> \u30d5\u30a1\u30a4\u30eb\u3082 cdk \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u7f6e\u3044\u3066\u304a\u304d\u307e\u3059\u304c\u3001<br \/>\n\u4e2d\u8eab\u306f\u7a7a\u3067\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<p>\u3067\u3001\u5b9f\u969b\u306b Cognito \u3092\u4f5c\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u30d5\u30a1\u30a4\u30eb\u3092 <code>auth.py<\/code> \u3068\u3057\u3066\u4f5c\u6210\u3057\u3066\u3001<br \/>\n\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u66f8\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom aws_cdk import (\n    core,\n    aws_cognito as cognito,\n)\n\n\nclass CognitoStack(core.Stack):\n\n    def __init__(self, scope: core.Construct, name: str, **kwargs) -\uff1e None:\n        super().__init__(scope, name, **kwargs)\n        cognito.UserPool(\n            self,\n            \u2019cognito_name\u2019,\n            user_pool_name=\u2019cognito_user_pool\u2019,\n            auto_verified_attributes=&#x5B;\n                cognito.UserPoolAttribute.EMAIL,\n            ],\n            sign_in_type=cognito.SignInType.EMAIL,\n        )\n\n\n<\/pre>\n<p><code>aws_cognito<\/code> \u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u306f\u3001aws \u306e\u90e8\u5206\u304c\u6bce\u56de\u66f8\u304f\u306e\u304c\u9762\u5012\u3060\u3063\u305f\u306e\u3067 as \u3067 cognito \u3067\u53c2\u7167\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u898b\u3066\u3044\u305f\u3060\u3044\u305f\u3089\u5206\u304b\u308b\u3068\u304a\u308a\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u66f8\u3044\u3066\u3042\u308b\u3060\u3051\u306e\u5185\u5bb9\u3067\u5341\u5206\u3067\u3059\u3002<br \/>\n\u4e00\u884c\u76ee\u306f <code>super().__init__(scope, name, **kwargs)<\/code> \u306a\u306e\u3067\u3001<br \/>\n\u5358\u7d14\u306b\u89aa\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u4e8c\u884c\u76ee\u304c\u6539\u884c\u304c\u305f\u304f\u3055\u3093\u5165\u3063\u3066\u5c11\u3057\u9577\u3044\u3067\u3059\u304c\u3001<br \/>\n\u5185\u5bb9\u305d\u306e\u3082\u306e\u3068\u3057\u3066\u306f\u4e00\u884c\u5206\u3060\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>Cognito \u306b\u9650\u3089\u305a\u3069\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u308b\u3068\u304d\u3082\u305d\u3046\u306a\u306e\u3067\u3059\u304c\u3001<br \/>\n\u5f15\u6570\u306e\u5185\u5bb9\u306f <code>(self, '\u30b9\u30b3\u30fc\u30d7(\u3053\u3061\u3089\u3067\u9069\u5f53\u306b\u540d\u524d\u3092\u6c7a\u3081\u308b)', ...\u30aa\u30d7\u30b7\u30e7\u30f3\u8af8\u3005)<\/code> \u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3001<br \/>\n\u4e00\u3064\u76ee\u306e self \u3068\u3001\u4e8c\u3064\u76ee\u306e\u30b9\u30b3\u30fc\u30d7\u306f\u5fc5\u9808\u3067\u3001\u305d\u308c\u4ee5\u5916\u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u3044\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6307\u5b9a\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306f<br \/>\nhttps:\/\/docs.aws.amazon.com\/cdk\/api\/latest\/docs\/@aws-cdk_aws-cognito.UserPool.html<br \/>\n\u4eca\u56de\u306e Cognito \u306e UserPool \u306b\u3064\u3044\u3066\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u304b\u3044\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u540c\u69d8\u306b\u3001\u4ed6\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u3064\u3044\u3066\u3082<br \/>\nhttps:\/\/docs.aws.amazon.com\/cdk\/api\/latest\/<br \/>\n\u3053\u306e\u4e2d\u304b\u3089\u63a2\u3057\u3066\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u3044\u304f\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3042\u305f\u308a\u306f\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3066\u3044\u3051\u3070\u3001\u3042\u3068\u306f IDE \u306e\u88dc\u5b8c\u306b\u305f\u3088\u3063\u3066\u884c\u3051\u3070\u66f8\u3051\u3066\u3057\u307e\u3046\u306e\u3067<br \/>\n\u3068\u3063\u3066\u3082\u4fbf\u5229\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u3001python \u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308b app.py \u306e\u5185\u5bb9\u3092\u3001<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom aws_cdk import core\nfrom cdk.auth import CognitoStack\n\napp = core.App()\n\nCognitoStack(app, \u2019CognitoStack\u2019)\n\napp.synth()\n<\/pre>\n<p>\u5358\u7d14\u306b\u5148\u307b\u3069\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u3063\u3066\u308b\u3060\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u305f\u3089\u3001\u30d3\u30eb\u30c9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u3092 Pipfile \u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;scripts]\nbuild = \u201dpython app.py\u201d\n<\/pre>\n<p>\u3067\u3001\u304a\u3082\u3080\u308d\u306b<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npipenv run build\n<\/pre>\n<p>\u3092\u5b9f\u884c\u3059\u308b\u3068\u2026<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"15124\" data-permalink=\"https:\/\/www.agent-grow.com\/self20percent\/2019\/09\/30\/aws-cdk-python\/%e7%84%a1%e9%a1%8c-1-12\/\" data-orig-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/2dbba63b65be5b241a1087c427d95864.png\" data-orig-size=\"608,80\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\u7121\u984c (1)\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/2dbba63b65be5b241a1087c427d95864.png\" src=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/2dbba63b65be5b241a1087c427d95864-300x39.png\" alt=\"\" width=\"300\" height=\"39\" class=\"alignnone size-medium wp-image-15124\" srcset=\"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/2dbba63b65be5b241a1087c427d95864-300x39.png 300w, https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/2dbba63b65be5b241a1087c427d95864.png 608w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001cdk.out \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u4f5c\u6210\u3055\u308c\u3001\u305d\u306e\u4e2d\u306b CloudFormation \u306e\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3042\u3068\u306f cdk deploy \u3068\u6253\u3066\u3070\u3001 CloudFromation \u3092\u7d4c\u7531\u3057\u3066 Cognito \u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n(\u8a8d\u8a3c\u60c5\u5831\u3092\u6c42\u3081\u3089\u308c\u305f\u3089\u3001\u74b0\u5883\u5909\u6570\u306a\u3069\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u306d)<\/p>\n<h1>CDK \u3067\u7c21\u5358\u306b\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u3092<\/h1>\n<p>\u4ee5\u4e0a\u3067\u3068\u3066\u3082\u7c21\u5358\u306b\u30ea\u30bd\u30fc\u30b9\u3092\u30b3\u30fc\u30c9\u5316\u3057\u3066\u7ba1\u7406\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u3044\u3051\u307e\u3057\u305f\u3002<br \/>\n\u6700\u5f8c\u3067\u304a\u6c17\u3065\u304d\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001 CDK \u306f\u7d50\u5c40\u306f CloudFormation \u306e\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306e<br \/>\n\u30e9\u30c3\u30d1\u30fc\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u307e\u3060 CloudFormation \u3067\u591a\u304f\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u751f\u6210\u3059\u308b\u969b\u306b\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u3001<br \/>\n\u30b9\u30bf\u30c3\u30af\u306e\u30cd\u30b9\u30c6\u30a3\u30f3\u30b0\u306a\u3069\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001 CloudFormation \u306e\u529b\u3092\u30d5\u30eb\u306b\u5f15\u304d\u51fa\u3059\u305f\u3081\u306b\u306f<br \/>\n\u307e\u3060\u3042\u3068\u4e00\u6b69\u3068\u3044\u3063\u305f\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u666e\u901a\u306b\u30b3\u30fc\u30c9\u3067\u7ba1\u7406\u3067\u304d\u308b\u305f\u3081\u3001IDE \u306e\u88dc\u5b8c\u3082\u304d\u304d\u307e\u3059\u3057\u3001<br \/>\n\u30df\u30b9\u30bf\u30a4\u30d7\u306a\u3069\u304c\u3042\u3063\u3066\u3082\u30d3\u30eb\u30c9\u6642\u306b\u304d\u3061\u3093\u3068\u6559\u3048\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u3088\u3002<\/p>\n<p>\u305c\u3072\u3001CloudFormation, CDK \u5171\u306b\u3001\u3053\u308c\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u81ea\u4f53\u306f\u7121\u6599\u3067\u3067\u304d\u308b\u306e\u3067<br \/>\n\uff08\u3082\u3061\u308d\u3093\u3001\u751f\u6210\u3057\u305fEC2\u7b49\u3005\u306b\u306f\u304a\u91d1\u304c\u304b\u304b\u308a\u307e\u3059\u3088\uff01\uff09<br \/>\n\u4eca\u5f8c AWS \u3067\u69cb\u7bc9\u3092\u3059\u308b\u969b\u306b\u306f\u662f\u975e\u4f7f\u3063\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS \u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406 \u307f\u306a\u3055\u3093\u3001AWS \u4f7f\u3063\u3066\u307e\u3059\u304b\uff1f AWS \u306b\u306f\u672c\u5f53\u306b\u305f\u304f\u3055\u3093\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u3089\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u65e9\u304f\u3001\u7c21\u5358\u306b\u3001\u305d\u3057\u3066\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u306b\u74b0\u5883\u3092\u69cb\u7bc9\u3067\u304d\u308b\u3053\u3068\u304c AWS \u306e\u9b45\u529b\u3067\u3059\u3088\u306d [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":15125,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[516,517,518,30],"class_list":["post-15120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-aws","tag-cdk","tag-devops","tag-python"],"jetpack_featured_media_url":"https:\/\/www.agent-grow.com\/self20percent\/wp-content\/uploads\/2019\/09\/850c7612116999490846136e772ab7fd-3.png","jetpack_shortlink":"https:\/\/wp.me\/p7Bq4F-3VS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts\/15120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/comments?post=15120"}],"version-history":[{"count":0,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/posts\/15120\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/media\/15125"}],"wp:attachment":[{"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/media?parent=15120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/categories?post=15120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.agent-grow.com\/self20percent\/wp-json\/wp\/v2\/tags?post=15120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}