-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
65 lines (54 loc) · 1.21 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
provider "aws" {
region = var.aws_region
access_key = "fake_access_key"
secret_key = "fake_secret_key"
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
s3 = "http://localhost:4566"
dynamodb = "http://localhost:4566"
ec2 = "http://localhost:4566"
}
}
resource "aws_vpc" "my_vpc" {
cidr_block = var.vpc_cidr
tags = {
Name = "my-vpc"
}
}
resource "aws_subnet" "my_subnet" {
vpc_id = aws_vpc.my_vpc.id
cidr_block = var.subnet_cidr
tags = {
Name = "my-subnet"
}
}
resource "aws_instance" "my_instance" {
ami = var.ami_id
instance_type = var.instance_type
subnet_id = aws_subnet.my_subnet.id
tags = {
Name = "my-instance"
}
}
resource "aws_s3_bucket" "my_bucket" {
bucket = var.s3_bucket_name
tags = {
Name = "my-bucket"
}
}
resource "aws_dynamodb_table" "my_table" {
name = var.dynamodb_table_name
hash_key = "Id"
billing_mode = "PROVISIONED"
read_capacity = 5
write_capacity = 5
attribute {
name = "Id"
type = "S"
}
tags = {
Name = "MyDynamoDBTable"
}
}