Skip to content

Commit

Permalink
AWS provisioning playbook and account creation manual (#502)
Browse files Browse the repository at this point in the history
* AWS create account and instances

* updated readme and playbook

* update readme
  • Loading branch information
ralfeus authored Apr 13, 2022
1 parent a91cfe6 commit 5021b99
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ansible/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Description

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.
55 changes: 55 additions & 0 deletions ansible/aws/aws-provisioning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
- name: Prepare AWS account and create instances
hosts: localhost
gather_facts: false

tasks:
- name: "Add SSH key"
tags:
- aws
amazon.aws.ec2_key:
name: AWS
key_material: "{{ lookup('file', 'AWS.pub') }}"

- name: "Create SG with allowed management traffic"
tags:
- aws
amazon.aws.ec2_group:
name: ddos
description: Allows management traffic
rules:
- rule_desc: SSH
cidr_ip: 0.0.0.0/0
proto: tcp
from_port: 22
to_port: 22
- rule_desc: RDP
cidr_ip: 0.0.0.0/0
proto: tcp
from_port: 3389
to_port: 3389

- name: "Create Linux instance"
tags:
- linux
amazon.aws.ec2_instance:
name: Linux
state: running
instance_type: t2.micro
security_group: ddos
image_id: ami-0ae4d073cedc64830
key_name: "AWS"
network:
assign_public_ip: true

- name: "Create Windows instance"
tags:
- windows
amazon.aws.ec2_instance:
name: Windows
state: running
instance_type: t2.micro
security_group: ddos
image_id: ami-050d60cac23150261
key_name: "AWS"
network:
assign_public_ip: true

0 comments on commit 5021b99

Please sign in to comment.