Skip to content

Commit e8dab77

Browse files
author
Sumit Sarkar
committed
CHORE: Add tag for auto-spotting
1 parent b0f52e6 commit e8dab77

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Terraform module to create an Amazon Web Services (AWS) EC2 Container Service
44

55
#### NOTE
66

7-
Please make sure you have the exact same size lists as that of the `instance_types`. If it's smaller that the `instance_types` list, you'll face errors.
7+
Please make sure you have the exact same size lists as that of the `instance_types`. If it's smaller than the `instance_types` list, you'll face errors.
88

99
## Usage
1010

@@ -86,6 +86,7 @@ module "container_service_cluster" {
8686
- `low_memory_threshold_percent` - List for Threshold as a percentage for low memory alarm (default: `[10]`)
8787
- `project` - Name of project this cluster is for (default: `Unknown`)
8888
- `environment` - Name of environment this cluster is targeting (default: `Unknown`)
89+
- `spot_enabled` - Enabling [AutoSpotting](https://github.com/cristim/autospotting) tag. It's the default tag used by AutoSpotting (default: `true`)
8990

9091
## Outputs
9192

main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ resource "aws_security_group" "container_instance" {
8181

8282
egress {
8383
from_port = 0
84-
to_port = 65535
84+
to_port = 0
8585
protocol = "-1"
8686
cidr_blocks = [
8787
"0.0.0.0/0"]
@@ -214,6 +214,12 @@ resource "aws_autoscaling_group" "container_instance" {
214214
value = "${var.environment}"
215215
propagate_at_launch = true
216216
}
217+
218+
tag {
219+
key = "spot-enabled"
220+
value = "${var.spot_enabled}"
221+
propagate_at_launch = true
222+
}
217223
}
218224

219225
#

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,8 @@ variable "low_memory_threshold_percent" {
156156
type = "list"
157157
default = ["10"]
158158
}
159+
160+
161+
variable "spot_enabled" {
162+
default = "false"
163+
}

0 commit comments

Comments
 (0)