{"id":19404111,"url":"https://github.com/newcontext-oss/terraform-google-instance","last_synced_at":"2025-08-14T12:39:13.939Z","repository":{"id":48768308,"uuid":"133420780","full_name":"newcontext-oss/terraform-google-instance","owner":"newcontext-oss","description":"Terraform module which creates a Google compute instance within the default networking of an existing project","archived":false,"fork":false,"pushed_at":"2022-10-06T00:58:03.000Z","size":36,"stargazers_count":5,"open_issues_count":2,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-23T14:09:24.531Z","etag":null,"topics":["gcp","google","hashicorp","inspec","kitchen-terraform","newcontext-oss","terraform","test-kitchen"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newcontext-oss.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}},"created_at":"2018-05-14T20:59:04.000Z","updated_at":"2024-04-23T14:09:24.532Z","dependencies_parsed_at":"2023-01-19T07:45:22.857Z","dependency_job_id":null,"html_url":"https://github.com/newcontext-oss/terraform-google-instance","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcontext-oss%2Fterraform-google-instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcontext-oss%2Fterraform-google-instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcontext-oss%2Fterraform-google-instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newcontext-oss%2Fterraform-google-instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newcontext-oss","download_url":"https://codeload.github.com/newcontext-oss/terraform-google-instance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223947727,"owners_count":17230085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gcp","google","hashicorp","inspec","kitchen-terraform","newcontext-oss","terraform","test-kitchen"],"created_at":"2024-11-10T11:33:10.462Z","updated_at":"2024-11-10T11:33:11.035Z","avatar_url":"https://github.com/newcontext-oss.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Compute Instance Terraform Module\n\nTerraform module which creates a Google compute instance within\nthe default networking of an existing project.\n\n## Features\n\nDeploys a Google compute instance to the existing networking of\nan existing Google cloud project.\n\n## Usage\n\nCall it as a module and deploy the instance.\n\n```hcl\nmodule \"terraform-google-instance\" {\n  source = \"git@github.com:newcontext-oss/terraform-google-instance.git\"\n}\n```\n\n## Requirements\n\nTerraform version must be less than 0.12. (See below for tips on migrating to 0.12)\n\n## Development\n\nFeel free to submit pull requests to make changes to the module.\n\nTo begin developing on this module please have a Google Compute Project.\n\n### Required Setup\n- See the script bin/example-setup-ubuntu.sh for the complete setup. However, the steps are listed below.\n\n#### Install Terraform (options below)\n\n- [https://github.com/kamatama41/tfenv](https://github.com/kamatama41/tfenv)\n- brew install terraform\n- [https://www.terraform.io/downloads.html](https://www.terraform.io/downloads.html)\n\n#### Install Ruby (options below)\n\n- [https://github.com/rbenv/rbenv](https://github.com/rbenv/rbenv)\n- brew install ruby # or other package managers\n- [http://ruby-lang.org/](http://ruby-lang.org/)\n\n#### Install JQ\n\n- brew install jq # or other package managers\n- [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/)\n\n#### Google IAM Console\n\nDownload a credentials JSON file from a user with proper permissions.\n[https://console.cloud.google.com/iam-admin/iam](https://console.cloud.google.com/iam-admin/iam)\n\nSave the file to the root of the repository directory called: `credentials.json`\n\n#### Install gcloud CLI\n\n- [https://cloud.google.com/sdk/gcloud/](https://cloud.google.com/sdk/gcloud/)\n\nSet up the gcloud command line client:\n\n```sh\ngcloud auth activate-service-account --key-file credentials.json\ngcloud config set project $(jq -r '.project_id' credentials.json)\ngcloud config set compute/zone us-west1-a\n```\n\n#### Install Kitchen-Terraform and many other required Ruby Gems. \n\n```sh\ngem install bundler --no-rdoc --no-ri\nbundle install\n```\n\n#### Create an environment variables file\n\nCreate a file in the repository directory called: `.env`\nIt will have environment variables that Terraform uses to run.\n\n```sh\ncat \u003e .env \u003c\u003cHEREDOC\nexport GOOGLE_APPLICATION_CREDENTIALS=\"$(pwd)/credentials.json\"\nexport GCLOUD_PROJECT=$(jq -r '.project_id' $GOOGLE_APPLICATION_CREDENTIALS)\nexport GCLOUD_REGION=\"us-west1\"\nexport TF_VAR_gcloud_project=$GCLOUD_PROJECT\nmy_public_ip=\\$(dig +short myip.opendns.com @resolver1.opendns.com)\nexport TF_VAR_engineer_cidrs=\"[\\\"\\$my_public_ip/32\\\"]\"\nexport TF_VAR_ssh_key=\"$(pwd)/ubuntu.pub\"\nHEREDOC\n\n```\n\n#### Run Terraform and Tests\n\nCommon setup to be run once before any number of the rest of the following:\n\n```sh\nsource .env\nyes | ssh-keygen -f ubuntu -N '' \u003e/dev/null\n```\n\nTo run Terraform via Test-Kitchen:\n\n```sh\nbundle exec kitchen converge\n```\n\nTest-Kitchen will run the module code that is called via this file:\n`test/fixtures/tf_module/main.tf`\n\nTo run InSpec via Test-Kitchen:\n\n```sh\nbundle exec kitchen verify\n```\n\nTest-Kitchen will run the InSpec controls via this file:\n`test/integration/kt_suite/controls/default.rb`\n\nTo destroy everything via Test-Kitchen:\n\n```sh\nbundle exec kitchen destroy\n```\n\n## Migration to Terraform 0.12+\n\nThis repository does not support Terraform 0.12+ out of the box. \nHere are **some** of the things necessary to migrate.\n1. Edit Gemfile to change version requirements to be this:\n   - gem 'inspec', '~\u003e 4.0'\n   - gem 'kitchen-terraform', '\u003e= 4.0.0'\n1. Testing (verify stage) does not pass - there seem to be problems with the inspec plugins. \n\n## Authors\n\nModule managed by [Nick Willever](https://github.com/nictrix).\n\n## License\n\nApache 2 Licensed. See LICENSE for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewcontext-oss%2Fterraform-google-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewcontext-oss%2Fterraform-google-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewcontext-oss%2Fterraform-google-instance/lists"}