-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
43 lines (35 loc) · 795 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
backend "s3" {
bucket = "gothicrazielsbucket01"
key = "terraform.tfstate"
region = "eu-west-2"
}
}
provider "aws" {
region = "eu-west-2" # London region
}
resource "aws_s3_bucket" "terraform_state" {
bucket = "gothicrazielsbucket01"
lifecycle {
prevent_destroy = false
}
}
resource "aws_s3_bucket_versioning" "terraform_state" {
bucket = aws_s3_bucket.terraform_state.id
versioning_configuration {
status = "Enabled"
}
}
resource "aws_instance" "example_instance" {
ami = "ami-0b0315b28716929af" # Bitnami image for Amazon Linux 2 in eu-west-2
instance_type = "t2.micro"
tags = {
Name = "Example Instance"
}
}