{"id":24317213,"url":"https://github.com/ot-nemoto/learn-terraform-aws-instance","last_synced_at":"2026-05-31T02:31:39.400Z","repository":{"id":228108085,"uuid":"772990996","full_name":"ot-nemoto/learn-terraform-aws-instance","owner":"ot-nemoto","description":" Terraform Tutorials AWS","archived":false,"fork":false,"pushed_at":"2024-03-22T12:23:26.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T16:43:38.919Z","etag":null,"topics":["terraform","tutorial"],"latest_commit_sha":null,"homepage":"https://developer.hashicorp.com/terraform/tutorials/aws-get-started","language":"HCL","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/ot-nemoto.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":"2024-03-16T12:47:51.000Z","updated_at":"2024-03-16T12:51:56.000Z","dependencies_parsed_at":"2025-03-10T16:40:07.441Z","dependency_job_id":"a26cf948-b832-448d-9520-7c0360ba8423","html_url":"https://github.com/ot-nemoto/learn-terraform-aws-instance","commit_stats":null,"previous_names":["ot-nemoto/learn-terraform-aws-instance"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ot-nemoto/learn-terraform-aws-instance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ot-nemoto%2Flearn-terraform-aws-instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ot-nemoto%2Flearn-terraform-aws-instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ot-nemoto%2Flearn-terraform-aws-instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ot-nemoto%2Flearn-terraform-aws-instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ot-nemoto","download_url":"https://codeload.github.com/ot-nemoto/learn-terraform-aws-instance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ot-nemoto%2Flearn-terraform-aws-instance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33717415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["terraform","tutorial"],"created_at":"2025-01-17T13:32:58.180Z","updated_at":"2026-05-31T02:31:39.383Z","avatar_url":"https://github.com/ot-nemoto.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# learn-terraform-aws-instance\n\n-   [Terraform Tutorials AWS](https://developer.hashicorp.com/terraform/tutorials/aws-get-started)\n\n## 事前準備\n\n```sh\nexport AWS_ACCESS_KEY_ID=\nexport AWS_SECRET_ACCESS_KEY=\n```\n\n## コマンド\n\n### ディレクトリを初期化\n\n```sh\nterraform init\n```\n\n### 構成をフォーマット\n\n```sh\nterraform fmt\n```\n\n_vscode_\n\n-   [拡張機能](.devcontainer/devcontainer.json)に `esbenp.prettier-vscode`, `hashicorp.terraform` 設定済み\n-   [settings.json](.vscode/settings.json) に `terraform`, `terraform-vars` の設定済み\n\n### 構成を検証\n\n```sh\nterraform validate\n```\n\n### インフラストラクチャの更新内容確認\n\n```sh\nterraform plan\n```\n\n### インフラストラクチャの作成\n\n```sh\nterraform apply\n```\n\n**変数のオーバーライド**\n\n```sh\nterraform apply -var \"instance_name=YetAnotherName\"\n```\n\n### 状態の確認\n\n```sh\nterraform show\n```\n\n### リソース一覧\n\n```sh\nterraform state list\n```\n\n### 出力値を表示\n\n```sh\nterraform output\n```\n\n### インフラストラクチャの削除\n\n```sh\nterraform destroy\n```\n\n## バリデーション\n\nAmazon EC2 インスタンスが AWS Systems Manager の管理対象になっているか確認する\n\n```sh\naws ssm start-automation-execution \\\n  --document-name \"AWSSupport-TroubleshootManagedInstance\" \\\n  --parameters '{\"InstanceId\":[\"i-052aed696b43c7e49\"]}'\n  # {\n  #     \"AutomationExecutionId\": \"8779d17e-0f0c-41a3-b3d7-feddaed8643c\"\n  # }\n```\n\n```sh\naws ssm get-automation-execution \\\n  --automation-execution-id \"8779d17e-0f0c-41a3-b3d7-feddaed8643c\" \\\n  --query 'AutomationExecution.StepExecutions[?StepName==`FinalOutput` \u0026\u0026 StepStatus==`Success`].Outputs.Message' \\\n  --output text\n  # EC2 instance is managed by Systems Manager.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fot-nemoto%2Flearn-terraform-aws-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fot-nemoto%2Flearn-terraform-aws-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fot-nemoto%2Flearn-terraform-aws-instance/lists"}