{"id":19357869,"url":"https://github.com/swiftsoftwaregroup/aws-ec2-terraform-test","last_synced_at":"2026-05-18T05:11:52.790Z","repository":{"id":251543299,"uuid":"837681751","full_name":"swiftsoftwaregroup/aws-ec2-terraform-test","owner":"swiftsoftwaregroup","description":"Serverspec test for the aws-ec2-terraform deployment","archived":false,"fork":false,"pushed_at":"2024-08-03T19:09:09.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T18:25:27.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftsoftwaregroup.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-03T17:37:59.000Z","updated_at":"2024-08-03T19:10:17.000Z","dependencies_parsed_at":"2024-08-03T21:26:30.413Z","dependency_job_id":"44833925-0a89-4d17-af08-280c6ff57aa8","html_url":"https://github.com/swiftsoftwaregroup/aws-ec2-terraform-test","commit_stats":null,"previous_names":["swiftsoftwaregroup/aws-ec2-terraform-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-terraform-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftsoftwaregroup","download_url":"https://codeload.github.com/swiftsoftwaregroup/aws-ec2-terraform-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240473974,"owners_count":19807252,"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":[],"created_at":"2024-11-10T07:09:29.864Z","updated_at":"2026-05-18T05:11:52.763Z","avatar_url":"https://github.com/swiftsoftwaregroup.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-ec2-terraform-test\nServerspec test for the [aws-ec2-terraform](https://github.com/swiftsoftwaregroup/aws-ec2-terraform) deployment\n\n## Setup for macOS\n\n### rbenv\n\nInstall `rbenv` via Homebrew:\n\n```bash\n# install\nbrew install rbenv\n\n# initialize\nrbenv init\n```\n\n## Development\n\nConfigure project:\n\n```bash\nsource configure.sh\n```\n\nOpen the project in Visual Studio Code:\n\n```bash\ncode .\n```\n\n## Run Tests\n\nMake sure you have deployed [aws-ec2-terraform](https://github.com/swiftsoftwaregroup/aws-ec2-terraform) and that you can connect to the instance via SSH:\n\n```bash\n# SSH access key\nkey=\"aws-ec2-key\"\n\n# instance name\ninstance=\"nginx-server-tf\"\n\n# instance IP\ninstance_public_ip=$(aws ec2 describe-instances --filters Name=tag:Name,Values=$instance | jq -r '.Reservations[-1].Instances[-1].PublicIpAddress')\n\nssh -i ~/.ssh/$key ec2-user@$instance_public_ip\n```\n\nRun tests:\n\n```bash\n./test.sh\n\n# or\nexport SPEC_HOST=$instance_public_ip\nexport SPEC_USER=\"ec2-user\"\nexport SPEC_SSH_KEY=\"~/.ssh/$key\"\n\nbundle exec rspec spec/nginx-server-tf\n```\n\n## How to create a new project\n\n### Create Ruby project\n\n```bash\n# install ruby \nrbenv install 3.3.0\nrbenv local 3.3.0 \n\n# install bundler\ngem install bundler\n\n# init project (creates empty Gemfile)\nbundle config set path '.bundle'\nbundle init\n\n# install gems\n\n# test framework\nbundle add serverspec\n\n# needed for ssh connections\nbundle add ed25519\nbundle add bcrypt_pbkdf\n```\n\n### Init Serverspec\n\n```bash\nserverspec-init\n\nSelect OS type:\n\n  1) UN*X\n  2) Windows\n\nSelect number: 1\n\nSelect a backend type:\n\n  1) SSH\n  2) Exec (local)\n\nSelect number: 1\n\nVagrant instance y/n: n\nInput target host name: nginx-server-tf\n\n# rename nginx-server-tf/sample_spec.rb to nginx-server-tf/default_spec.rb\nmv spec/nginx-server-tf/sample_spec.rb spec/nginx-server-tf/default_spec.rb\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-terraform-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-terraform-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-terraform-test/lists"}