This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "eu-west-1" # Dublin | |
} | |
provider "aws" { | |
alias = "paris" | |
region = "eu-west-3" # Paris | |
} | |
provider "aws" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "terraform_remote_state" "remote_state" { | |
backend = "s3" | |
config { | |
bucket = "my-bucket" | |
key = "s3-key" | |
region = "eu-west-1" | |
} | |
} | |
resource "aws_eip" "eip" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "vpc" { | |
source = "git::https://github.com/orga/vpc.git" | |
cidr = "192.168.28.0/24" | |
subnet_count = 3 | |
} | |
resource "aws_security_group" "security-group" { | |
name = "my-security-group" | |
description = "Custom security group" | |
vpc_id = "${module.vpc.vpc_id}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "aws_vpc" "default_vpc" { | |
Default = true # Gather default VPC | |
} | |
output "default_vpc_cidr"{ | |
value="${data.aws_vpc.default_vpc.cidr_block}" | |
} | |
output "default_vpc_id"{ | |
value="${data.aws_vpc.default_vpc.id}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My_instance_1: | |
Type: AWS::EC2::Instance | |
Properties: #… | |
My_instance_2: | |
Type: AWS::EC2::Instance | |
Properties: # … | |
My_instance_3: | |
Type: AWS::EC2::Instance | |
Properties: #… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_instance" "my_instance" { | |
count = 3 | |
#… | |
} |