tfstate in s3
This commit is contained in:
parent
ef982d0ed1
commit
e666b64c97
2 changed files with 31 additions and 2 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,8 +3,8 @@
|
||||||
**/.terraform/*
|
**/.terraform/*
|
||||||
|
|
||||||
# .tfstate files
|
# .tfstate files
|
||||||
#*.tfstate
|
*.tfstate
|
||||||
#*.tfstate.*
|
*.tfstate.*
|
||||||
|
|
||||||
# Crash log files
|
# Crash log files
|
||||||
crash.log
|
crash.log
|
||||||
|
|
29
project3/base.tf
Normal file
29
project3/base.tf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
terraform {
|
||||||
|
backend "s3"{
|
||||||
|
bucket = "terraformsanofieu"
|
||||||
|
region = "eu-west-2"
|
||||||
|
key = "cedric/project3.tfstate"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "aws" {
|
||||||
|
region = "eu-west-2"
|
||||||
|
}
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue