Skip to content

Commit

Permalink
Update Windows EC2 instance (#505)
Browse files Browse the repository at this point in the history
* AWS create account and instances

* updated readme and playbook

* update readme

* update AMI with OpenSSH and password reset

* added prerequisites

* Apply suggestions from code review

Co-authored-by: Bohdan Ivashko <[email protected]>
  • Loading branch information
ralfeus and arriven authored Apr 14, 2022
1 parent 5021b99 commit 79918b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions ansible/aws/AWS.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- here you put your public key --
12 changes: 11 additions & 1 deletion ansible/aws/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Description

## Prerequisites

1. Ansible 2.9
1. Collection amazon.aws (can be installed by command `ansible-galaxy collection install amazon.aws`)
1. Created key pair and public key stored in `AWS.pub` in same folder as the `aws-provisioning.yaml` playbook

Here you can read a manual on AWS account creation: [AWS manual](https://docs.google.com/document/d/e/2PACX-1vTeCirL7ANTcX9vKXniKTjKkxGEE9Ftd1xBc0bHKPoSrd2aj5fNeresltDUEp6ZYNgM3EZF5csNj_R4/pub)

This playbook creates one Linux and one Windows EC2 instances from customized AMIs so whole setup fits into Free Tier limits. This means it can run for free 1 year from AWS account creation.
This playbook creates one Linux and one Windows EC2 instances from customized AMIs so whole setup fits into Free Tier limits. This means it can run for free 1 year from AWS account creation.

The AMI has OpenSSH server installed. The public key is copied to the server if it's created using Ansible playbook provided. Otherwise it would have to be done manually after logging in to the server.

The Administrator password is reset during startup and can be retrieved in a standard AWS way.
5 changes: 4 additions & 1 deletion ansible/aws/aws-provisioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
state: running
instance_type: t2.micro
security_group: ddos
image_id: ami-050d60cac23150261
image_id: ami-06aa8ca602578e4a4
key_name: "AWS"
network:
assign_public_ip: true
user_data: <powershell>
echo {{ lookup('file', 'AWS.pub') }} > $env:ProgramData\ssh\administrators_authorized_keys
</powershell>

0 comments on commit 79918b7

Please sign in to comment.