{"id":21433048,"url":"https://github.com/randomtask2000/terraform-codebuild-ec2-instance","last_synced_at":"2026-02-07T19:31:14.305Z","repository":{"id":218614874,"uuid":"162868609","full_name":"randomtask2000/terraform-codebuild-ec2-instance","owner":"randomtask2000","description":"Terraform CodeBuild project that builds an EC2 instance with Terraform. It essentially builds a CodeBuild project that becomes a Terraform builder.","archived":false,"fork":false,"pushed_at":"2019-01-02T05:17:14.000Z","size":1862,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T04:40:54.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/randomtask2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-23T06:42:32.000Z","updated_at":"2019-02-07T19:29:25.000Z","dependencies_parsed_at":"2024-01-23T01:49:59.039Z","dependency_job_id":null,"html_url":"https://github.com/randomtask2000/terraform-codebuild-ec2-instance","commit_stats":null,"previous_names":["randomtask2000/terraform-codebuild-ec2-instance"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/randomtask2000/terraform-codebuild-ec2-instance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Fterraform-codebuild-ec2-instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Fterraform-codebuild-ec2-instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Fterraform-codebuild-ec2-instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Fterraform-codebuild-ec2-instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randomtask2000","download_url":"https://codeload.github.com/randomtask2000/terraform-codebuild-ec2-instance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomtask2000%2Fterraform-codebuild-ec2-instance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29205249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-22T23:24:25.851Z","updated_at":"2026-02-07T19:31:14.289Z","avatar_url":"https://github.com/randomtask2000.png","language":"HCL","readme":"![Terraform CodeBuild that Terraforms an EC2 Instance](images/photo-4.jpeg)\n\n# Use Terraform to build a CodeBuild project that runs terraform as a build service\nThis little repo illustrates how to build a `CodeBuild` project with `terraform` and run terraform inside of this project to build infrastructure from another [repo](https://github.com/randomtask2000/terraform_ec2_instance). This other repo builds a simple `ec2` instance.\n\n## Config\nBefore running this terraform template add the following terraform config file.\n\nCreate a settings file `terraform.auto.tfvars` with the following:\n```\necho \u003c\u003c\u003c EOL\naws_access_key = \"XXXXXXXXXXXXXXXXXXXX\"\naws_secret_key = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\naws_region = \"us-east-1\"\npublic_key = \"ssh-rsa AAAAB3NzaC1yc....9wrf+M7Q== my@laptop.local\"\nvpc_id = \"vpc-00000000x00x0xxx0\"\nterraform_version = \"0.9.9\"\ns3_bucket = \"your-s3-bucket-terraform-state\"\ndebug = \"true\"\nEOL \u003e\u003e terraform.auto.tfvars;\n```\n\n## terraform apply\nAfter you're done creating the above file and adding your `aws access key`, `secret` and your `ssh public key`, run the following:\n```\nterraform init\nterraform plan\necho yes | terraform apply\n```\nTo remove what you built run:\n```\necho yes | terraform destroy\n```\nThe above `terraform apply` statement will create your CodeBuild project. After creating your project in AWS you should find your CodeBase project here:\nhttps://console.aws.amazon.com/codesuite/codebuild/projects?region=us-east-1 \n(Change your region in this URL to what you set your `aws_region` variable in your `tfvars` file to.)\n\n## This bit is manual in AWS Console\nYour project in CodeBuild will look something like the image below:\n\n![Your CodeBuild project](images/photo-2.jpeg)\n\nSelect your project and click `Start Build`: ![Start Build in AWS CodeBuild](images/photo-3.jpeg)\n\nSelect `Advanced build overrides`: ![Advanced Build Overrides in AWS CodeBuild](images/photo-5.jpeg)\n\nUnfold `Additional configuration` and edit any of the environment variables. Set the `DESTROY` variable to `true` if you would like to run a build cycle that destroys your infrastructure. ![Advanced Build Overrides in AWS CodeBuild and build environment settings](images/IMG_0265.png)\n \nPress `Start Build`.\n\n# And Bob's your uncle\nYou're done and have fun!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomtask2000%2Fterraform-codebuild-ec2-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandomtask2000%2Fterraform-codebuild-ec2-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomtask2000%2Fterraform-codebuild-ec2-instance/lists"}