{"id":20031701,"url":"https://github.com/andrejmaya/aws-ec2-docker_ansible","last_synced_at":"2025-10-24T14:48:31.097Z","repository":{"id":86054459,"uuid":"116422404","full_name":"andrejmaya/aws-ec2-docker_ansible","owner":"andrejmaya","description":"Create a EC2 with Ansible","archived":false,"fork":false,"pushed_at":"2018-03-29T13:29:15.000Z","size":11,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T05:27:46.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/andrejmaya.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":"2018-01-05T20:05:51.000Z","updated_at":"2021-11-23T12:58:27.000Z","dependencies_parsed_at":"2023-03-05T11:30:18.780Z","dependency_job_id":null,"html_url":"https://github.com/andrejmaya/aws-ec2-docker_ansible","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/andrejmaya/aws-ec2-docker_ansible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejmaya%2Faws-ec2-docker_ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejmaya%2Faws-ec2-docker_ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejmaya%2Faws-ec2-docker_ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejmaya%2Faws-ec2-docker_ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrejmaya","download_url":"https://codeload.github.com/andrejmaya/aws-ec2-docker_ansible/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrejmaya%2Faws-ec2-docker_ansible/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259439394,"owners_count":22857718,"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-13T09:34:26.177Z","updated_at":"2025-10-24T14:48:26.053Z","avatar_url":"https://github.com/andrejmaya.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS EC2 Ansible Docker example\nCreate and connect to a AWS EC2 instance made simple\n\n## Prerequisites\n* Docker installed\n* AWS user with these permissions:\n  * `AmazonEC2FullAccess`\n  * `SecurityAudit`\n* Configurations can be made in the `inventory` file.\n\n## Create EC2 instance\n\nPlease add your AWS user credentials to the `inventory` file:\n```\nec2_access_key=\"YOUR_AWS_ACCESS_KEY_ID\"\nec2_secret_key=\"YOUR_AWS_SECRET_ACCESS_KEY\"\n```\n\nAnd execute following statement:\n```\ndocker run -it --rm -v $(pwd):/ansible \\\nryanwalls/ansible-aws:v2.3.1.0-1 sh -c \"ansible-playbook -i ./inventory ec2-basic.yml\"\n```\n\n## Multiple instances per user\n* copy the `id_rsa_your_name.pub` key into the `deploy_keys` directory.\n* add role execution to `ec2-basic.yml` like this: \n  ```\n  - { role: ec2_basic, key_name: 'id_rsa_joe', tags: basic}\n  - { role: ec2_basic, key_name: 'id_rsa_peter', tags: basic}\n  - { role: ec2_basic, key_name: 'id_rsa_julia', tags: basic}\n  ```\n\n## SSH connection\nlook up the public ip in the `inventory` file underneath `[playground]` block and pass it to:\n\n`ssh -i ./deploy_keys/\u003ckey_name\u003e \u003cansible_ssh_user\u003e@\u003cPUBLIC_IP\u003e`\n\n\n## Delete EC2 instance\nUncomment the `FOR DELETION ONLY` block in the `inventory` file and enter the correct ec2 instance id\n\n## Known issues\n* `IdempotentInstanceTerminated: The client token you have provided is associated with a terminated instance. Please use a different client token`: Please change the `key_name` variable in `inventory` to create a new instance(s)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrejmaya%2Faws-ec2-docker_ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrejmaya%2Faws-ec2-docker_ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrejmaya%2Faws-ec2-docker_ansible/lists"}