-
-
Notifications
You must be signed in to change notification settings - Fork 220
/
README.yaml
134 lines (127 loc) · 4.43 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: terraform-aws-ec2-instance
tags:
- aws
- terraform
- terraform-modules
- platform
- ec2
- instance
- security
- ansible
categories:
- terraform-modules/platform
license: APACHE2
github_repo: cloudposse/terraform-aws-ec2-instance
badges:
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/terraform-aws-ec2-instance.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-aws-ec2-instance/releases/latest
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/terraform-aws-ec2-instance.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-aws-ec2-instance/commits
- name: Slack Community
image: https://slack.cloudposse.com/for-the-badge.svg
url: https://slack.cloudposse.com
# List any related terraform modules that this module may be used with or that this module depends on.
related:
- name: terraform-aws-ec2-ami-backup
description: Terraform module for automatic & scheduled AMI creation
url: https://github.com/cloudposse/terraform-aws-ec2-ami-backup
- name: terraform-aws-ec2-ami-snapshot
description: Terraform module to easily generate AMI snapshots to create replica instances
url: https://github.com/cloudposse/terraform-aws-ec2-ami-snapshot
- name: terraform-aws-ec2-cloudwatch-sns-alarms
description: Terraform module that configures CloudWatch SNS alerts for EC2 instances
url: https://github.com/cloudposse/terraform-aws-ec2-cloudwatch-sns-alarms
- name: terraform-null-label
description: Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes])
url: https://github.com/cloudposse/terraform-null-label
description: |-
Terraform Module for provisioning a general purpose EC2 host.
Included features:
* Automatically create a Security Group
* Option to switch EIP attachment
* CloudWatch monitoring and automatic reboot if instance hangs
* Assume Role capability
usage: |-
Note: add `${var.ssh_key_pair}` private key to the `ssh agent`.
Include this repository as a module in your existing terraform code.
### Simple example:
```hcl
module "instance" {
source = "cloudposse/ec2-instance/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
ssh_key_pair = var.ssh_key_pair
instance_type = var.instance_type
vpc_id = var.vpc_id
security_groups = var.security_groups
subnet = var.subnet
name = "ec2"
namespace = "eg"
stage = "dev"
}
```
### Example with additional volumes and EIP
```hcl
module "kafka_instance" {
source = "cloudposse/ec2-instance/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
ssh_key_pair = var.ssh_key_pair
vpc_id = var.vpc_id
security_groups = var.security_groups
subnet = var.subnet
associate_public_ip_address = true
name = "kafka"
namespace = "eg"
stage = "dev"
additional_ips_count = 1
ebs_volume_count = 2
security_group_rules = [
{
type = "egress"
from_port = 0
to_port = 65535
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
},
{
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
},
{
type = "ingress"
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
},
{
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
},
{
type = "ingress"
from_port = 53
to_port = 53
protocol = "udp"
cidr_blocks = ["0.0.0.0/0"]
},
]
}
```
references:
- name: terraform-aws-ec2-bastion-server
description: Terraform Module to define a generic Bastion host with parameterized user_data
url: https://github.com/cloudposse/terraform-aws-ec2-bastion-server
include:
- docs/targets.md
- docs/terraform.md
contributors: []