1
0
Fork 0
terraform-training/03_remote_state/base.tf

43 lines
820 B
Terraform
Raw Normal View History

2020-05-12 14:20:14 +02:00
terraform {
backend "s3"{
bucket = "terraformsanofieu"
region = "eu-west-2"
key = "cedric/project3.tfstate"
2020-05-12 15:00:59 +02:00
dynamodb_table = "terraform-state-lock-cedric"
2020-05-12 14:20:14 +02:00
}
}
provider "aws" {
region = "eu-west-2"
}
2020-05-12 15:00:59 +02:00
resource "aws_dynamodb_table" "terraform-state-lock" {
name = "terraform-state-lock-cedric"
hash_key = "LockID"
write_capacity = 20
read_capacity = 20
attribute {
name = "LockID"
type = "S"
}
}
2020-05-12 14:20:14 +02:00
resource "aws_instance" "cedric-instance3" {
ami = "ami-01a6e31ac994bbc09"
instance_type = "t2.micro"
key_name = "cedric"
tags = {
Name = "cedric-instance3"
}
}
resource "aws_instance" "cedric-instance4" {
ami = "ami-01a6e31ac994bbc09"
instance_type = "t2.micro"
key_name = "cedric"
tags = {
Name = "cedric-instance4"
}
}