{"id":13398,"date":"2023-08-03T07:14:07","date_gmt":"2023-08-02T22:14:07","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=13398"},"modified":"2023-08-05T06:18:12","modified_gmt":"2023-08-04T21:18:12","slug":"cdk-for-terraform%e3%81%ae%e3%83%97%e3%83%ad%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88typescript%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/13398","title":{"rendered":"CDK for Terraform\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08TypeScript\uff09"},"content":{"rendered":"<p>TypeScript\u3092\u4f7f\u7528\u3059\u308bCDK for Terraform\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u3001AWS CodeCommit\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u4f5c\u6210\u3057\u305f\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/13249\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08AWS CLI\uff0fCloudShell\uff09\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08AWS CLI\uff0fCloudShell\uff09<\/div><div class=\"substr\">AWS CLI\u3067AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u74b0\u5883\u306f\u3001AWS CloudShell\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/13257\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092Clone\u3059\u308b\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092Clone\u3059\u308b\uff01<\/div><div class=\"substr\">AWS CodeCommit\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092Clone\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>Clone\u3057\u305f\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\uff01<\/h2>\n<p>Clone\u3057\u305f\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cd sample-repo\r\n<\/pre>\n<h2>TypeScript\u3092\u4f7f\u7528\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>TypeScript\u3092\u4f7f\u7528\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cdktf init --template=typescript\r\nWelcome to CDK for Terraform!\r\n\r\nBy default, cdktf allows you to manage the state of your stacks using Terraform Cloud for free.\r\ncdktf will request an API token for app.terraform.io using your browser.\r\n\r\nIf login is successful, cdktf will store the token in plain text in\r\nthe following file for use by subsequent Terraform commands:\r\n    \/home\/usradmin\/.terraform.d\/credentials.tfrc.json\r\n\r\nNote: The local storage mode isn't recommended for storing the state of your stacks.\r\n\r\n? Do you want to continue with Terraform Cloud remote state management? no\r\n? Project Name sample_repo\r\n? Project Description A simple getting started project for cdktf.\r\n? Do you want to start from an existing Terraform project? no\r\n? Do you want to send crash reports to the CDKTF team? Refer to \r\nhttps:\/\/developer.hashicorp.com\/terraform\/cdktf\/create-and-deploy\/configuration-file#enable-crash-reporting-for-the-cli \r\nfor more information yes\r\nNote: You can always add providers using 'cdktf provider add' later on\r\n? What providers do you want to use? aws\r\n\r\nadded 2 packages, and audited 57 packages in 9s\r\n\r\n7 packages are looking for funding\r\n  run `npm fund` for details\r\n\r\nfound 0 vulnerabilities\r\n\r\nadded 303 packages, and audited 360 packages in 31s\r\n\r\n37 packages are looking for funding\r\n  run `npm fund` for details\r\n\r\nfound 0 vulnerabilities\r\n========================================================================================================\r\n\r\n  Your cdktf typescript project is ready!\r\n\r\n  cat help                Print this message\r\n\r\n  Compile:\r\n    npm run get           Import\/update Terraform providers and modules (you should check-in this directory)\r\n    npm run compile       Compile typescript code to javascript (or &quot;npm run watch&quot;)\r\n    npm run watch         Watch for changes and compile typescript in the background\r\n    npm run build         Compile typescript\r\n\r\n  Synthesize:\r\n    cdktf synth &#x5B;stack]   Synthesize Terraform resources from stacks to cdktf.out\/ (ready for 'terraform apply')\r\n\r\n  Diff:\r\n    cdktf diff &#x5B;stack]    Perform a diff (terraform plan) for the given stack\r\n\r\n  Deploy:\r\n    cdktf deploy &#x5B;stack]  Deploy the given stack\r\n\r\n  Destroy:\r\n    cdktf destroy &#x5B;stack] Destroy the stack\r\n\r\n  Test:\r\n    npm run test        Runs unit tests (edit __tests__\/main-test.ts to add your own tests)\r\n    npm run test:watch  Watches the tests and reruns them on change\r\n\r\n  Upgrades:\r\n    npm run upgrade        Upgrade cdktf modules to latest version\r\n    npm run upgrade:next   Upgrade cdktf modules to latest &quot;@next&quot; version (last commit)\r\n\r\n Use Providers:\r\n\r\n  You can add prebuilt providers (if available) or locally generated ones using the add command:\r\n  \r\n  cdktf provider add &quot;aws@~&gt;3.0&quot; null kreuzwerker\/docker\r\n\r\n  You can find all prebuilt providers on npm: https:\/\/www.npmjs.com\/search?q=keywords:cdktf\r\n  You can also install these providers directly through npm:\r\n\r\n  npm install @cdktf\/provider-aws\r\n  npm install @cdktf\/provider-google\r\n  npm install @cdktf\/provider-azurerm\r\n  npm install @cdktf\/provider-docker\r\n  npm install @cdktf\/provider-github\r\n  npm install @cdktf\/provider-null\r\n\r\n  You can also build any module or provider locally. Learn more https:\/\/cdk.tf\/modules-and-providers\r\n\r\n========================================================================================================\r\n\r\n&#x5B;2023-08-03T07:13:00.325] &#x5B;INFO] default - Checking whether pre-built provider exists for the following constraints:\r\n  provider: aws\r\n  version : latest\r\n  language: typescript\r\n  cdktf   : 0.17.3\r\n\r\n&#x5B;2023-08-03T07:13:08.330] &#x5B;INFO] default - Found pre-built provider.\r\nAdding package @cdktf\/provider-aws @ 16.0.5\r\n&#x5B;2023-08-03T07:13:08.350] &#x5B;INFO] default - Installing package @cdktf\/provider-aws @ 16.0.5 using npm.\r\n&#x5B;2023-08-03T07:13:27.467] &#x5B;INFO] default - Package installed.\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001Cloud9\u306e\u74b0\u5883\u306e\u5834\u5408\u306fCloud9\u306e\u30a8\u30c7\u30a3\u30bf\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u74b0\u5883\u306e\u5834\u5408\u306fVisual Studio Code\u3092\u4f7f\u7528\u3057\u3066\u3001CDK for Terraform\u306e\u958b\u767a\u3092\u958b\u59cb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"\/\/developer.hashicorp.com\/terraform\/cdktf\" rel=\"noopener\" target=\"_blank\">CDK for Terraform<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/12112\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u64cd\u4f5c\u3059\u308b\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u64cd\u4f5c\u3059\u308b\uff01<\/div><div class=\"substr\">AWS\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TypeScript\u3092\u4f7f\u7528\u3059\u308bCDK for Terraform\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u3001AWS CodeCommit\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":8172,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[370],"tags":[760,846,847,630],"class_list":["post-13398","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-operation","tag-terraform","tag-typescript","tag-847","tag-630"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=13398"}],"version-history":[{"count":2,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13398\/revisions"}],"predecessor-version":[{"id":13402,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13398\/revisions\/13402"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/8172"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=13398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=13398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=13398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}