{"id":2900,"date":"2025-03-01T15:25:46","date_gmt":"2025-03-01T06:25:46","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=2900"},"modified":"2025-03-01T18:10:50","modified_gmt":"2025-03-01T09:10:50","slug":"aws-cdk%e3%81%a7%e3%83%ad%e3%83%bc%e3%83%89%e3%83%90%e3%83%a9%e3%83%b3%e3%82%b5%e3%81%a8%e3%82%bf%e3%83%bc%e3%82%b2%e3%83%83%e3%83%88%e3%82%b0%e3%83%ab%e3%83%bc%e3%83%97%e3%81%ae%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=2900","title":{"rendered":"AWS CDK\u3067\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u3068\u30bf\u30fc\u30b2\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\u306e\u8a2d\u5b9a"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">SSL\u8a3c\u660e\u66f8\u3092\u6307\u5b9a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/ SSL\u8a3c\u660e\u66f8\u6307\u5b9a(ACM)\n    const certificate = acm.Certificate.fromCertificateArn(\n      this,\n      'MyCertificate',\n      'arn:aws:acm:ap-northeast-1:123456789012:certificate\/abcdefg1-h2ijk-3456-7890-1m2n3o4p5q6r',\n    );\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">ALB(\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5)\u306e\u8a2d\u5b9a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/ ALB\u4f5c\u6210\n    const alb = new elbv2.ApplicationLoadBalancer(this, 'MyALB', {\n      vpc,\n      vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC },\n      securityGroup,\n      internetFacing: true,\n    });<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u30bf\u30fc\u30b2\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\u306e\u4f5c\u6210<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/ \u30bf\u30fc\u30b2\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\n    const targetGroup = new elbv2.ApplicationTargetGroup(this, 'MyTargetGroup', {\n      vpc,\n      port: 80,\n      protocol: elbv2.ApplicationProtocol.HTTP,\n      targetType: elbv2.TargetType.INSTANCE,\n      targets: [new InstanceTarget(ec2Instance, 80)],\n      \/\/ \u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3067\u306fCDK 2.1001.0 \u3067\u52d5\u4f5c\u3057\u306a\u3044\u3002\n      \/\/ targets: [ec2Instance],\n      \/\/ targets: [new elbv2.InstanceTarget(ec2Instance, 80)],\n      \/\/ targets: [new elbv2.InstanceTargetId(ec2Instance.instanceId)],\n      healthCheck: {\n        path: '\/',\n        port: 'traffic-port',\n      },\n    });\n    \/\/ \u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3067\u306fCDK 2.1001.0 \u3067\u52d5\u4f5c\u3057\u306a\u3044\u3002\n    \/\/ targetGroup.addTarget(ec2Instance);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">ALB\u306b\u30ea\u30b9\u30ca\u30fc\u3092\u8ffd\u52a0(\u30bf\u30fc\u30b2\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\u3068\u8a3c\u660e\u66f8\u3092\u8ffd\u52a0)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    \/\/ ALB\u306b\u30ea\u30b9\u30ca\u30fc\u3092\u8ffd\u52a0\n    alb.addListener('Listener', {\n      port: 443,\n      protocol: elbv2.ApplicationProtocol.HTTPS,\n      certificates: [certificate],\n      defaultAction: elbv2.ListenerAction.forward([targetGroup]),\n    });\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SSL\u8a3c\u660e\u66f8\u3092\u6307\u5b9a ALB(\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5)\u306e\u8a2d\u5b9a \u30bf\u30fc\u30b2\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\u306e\u4f5c\u6210 ALB\u306b\u30ea\u30b9\u30ca\u30fc\u3092\u8ffd\u52a0(\u30bf\u30fc\u30b2\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\u3068\u8a3c\u660e\u66f8\u3092\u8ffd\u52a0)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[73,76,77,4],"tags":[],"class_list":["post-2900","post","type-post","status-publish","format-standard","hentry","category-aws","category-cdk","category-typescript","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2900"}],"version-history":[{"count":8,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2900\/revisions"}],"predecessor-version":[{"id":2917,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2900\/revisions\/2917"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}