mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 17:02:05 +03:00
demo-5
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
provider "aws" {
|
||||||
|
region = "${var.AWS_REGION}"
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
data "aws_ip_ranges" "european_ec2" {
|
||||||
|
regions = [ "eu-west-1", "eu-central-1" ]
|
||||||
|
services = [ "ec2" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group" "from_europe" {
|
||||||
|
name = "from_europe"
|
||||||
|
|
||||||
|
ingress {
|
||||||
|
from_port = "443"
|
||||||
|
to_port = "443"
|
||||||
|
protocol = "tcp"
|
||||||
|
cidr_blocks = [ "${data.aws_ip_ranges.european_ec2.cidr_blocks}" ]
|
||||||
|
}
|
||||||
|
tags {
|
||||||
|
CreateDate = "${data.aws_ip_ranges.european_ec2.create_date}"
|
||||||
|
SyncToken = "${data.aws_ip_ranges.european_ec2.sync_token}"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
variable "AWS_REGION" {
|
||||||
|
default = "eu-west-1"
|
||||||
|
}
|
||||||
|
variable "AMIS" {
|
||||||
|
type = "map"
|
||||||
|
default = {
|
||||||
|
us-east-1 = "ami-13be557e"
|
||||||
|
us-west-2 = "ami-06b94666"
|
||||||
|
eu-west-1 = "ami-844e0bf7"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user