-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
48 lines (36 loc) · 939 Bytes
/
main.tf
File metadata and controls
48 lines (36 loc) · 939 Bytes
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
44
45
46
47
48
/* DERIVED --------------------------------------*/
provider "aws" {
region = "us-east-1"
access_key = data.pass_password.aws_access_key.password
secret_key = data.pass_password.aws_secret_key.password
}
/* DATA -----------------------------------------*/
terraform {
backend "s3" {
bucket = "dapps-terraform-state"
key = "infra-dapps"
region = "us-east-1"
encrypt = true
}
}
/* INVENTORY ------------------------------------*/
resource "aws_s3_bucket" "tf-state" {
bucket = "dapps-terraform-state"
acl = "private"
tags = {
Name = "Terraform State Store"
}
policy = file("files/s3-policy.json")
versioning {
enabled = true
}
lifecycle {
prevent_destroy = true
}
}
/* ACCESS ---------------------------------------*/
resource "aws_key_pair" "admin" {
key_name = "admin-key"
public_key = file("files/jakub.pub")
}
data "aws_caller_identity" "current" {}