Merge pull request #60 from HideyoshiSolutions/fixes-instances-dns-server
Fixes Spot Prices Configuration and EC2 DNS Namespace
This commit is contained in:
@@ -49,6 +49,11 @@ variable "aws_ami" {
|
||||
default = "ami-06a17a87e19be286a"
|
||||
}
|
||||
|
||||
variable "aws_spot_price" {
|
||||
type = number
|
||||
default = 0.0028
|
||||
}
|
||||
|
||||
variable "cloudflare_api_token" {
|
||||
type = string
|
||||
sensitive = true
|
||||
|
||||
@@ -25,7 +25,7 @@ resource "cloudflare_record" "default" {
|
||||
zone_id = var.cloudflare_zone_id
|
||||
|
||||
name = var.environment_name == "prod" ? "@" : "staging"
|
||||
value = var.public_ip
|
||||
content = var.public_ip
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
proxied = false
|
||||
@@ -36,7 +36,7 @@ resource "cloudflare_record" "api" {
|
||||
zone_id = var.cloudflare_zone_id
|
||||
|
||||
name = var.environment_name == "prod" ? "api" : "api.staging"
|
||||
value = var.public_ip
|
||||
content = var.public_ip
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
proxied = false
|
||||
|
||||
@@ -33,6 +33,11 @@ variable "aws_ami" {
|
||||
default = "ami-06a17a87e19be286a"
|
||||
}
|
||||
|
||||
variable "aws_spot_price" {
|
||||
type = number
|
||||
default = 0.0028
|
||||
}
|
||||
|
||||
variable "ssh_public_key_main" {
|
||||
type = string
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ resource "aws_instance" "main" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"sudo sed -i '1s/^/nameserver 1.1.1.1\\n/' /etc/resolv.conf",
|
||||
"sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024",
|
||||
"sudo /sbin/mkswap /var/swap.1",
|
||||
"sudo chmod 600 /var/swap.1",
|
||||
@@ -118,7 +119,7 @@ resource "aws_instance" "worker" {
|
||||
instance_market_options {
|
||||
market_type = "spot"
|
||||
spot_options {
|
||||
max_price = 0.0020
|
||||
max_price = var.aws_spot_price
|
||||
instance_interruption_behavior = "stop"
|
||||
spot_instance_type = "persistent"
|
||||
}
|
||||
@@ -146,6 +147,7 @@ resource "aws_instance" "worker" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"sudo sed -i '1s/^/nameserver 1.1.1.1\\n/' /etc/resolv.conf",
|
||||
"sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024",
|
||||
"sudo /sbin/mkswap /var/swap.1",
|
||||
"sudo chmod 600 /var/swap.1",
|
||||
|
||||
Reference in New Issue
Block a user