-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
67 lines (53 loc) · 1.27 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
66
67
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.27.0"
}
}
}
provider "aws" {
# Configuration options
profile = "default"
region = "us-east-1"
}
# This is our aws budget
resource "aws_budgets_budget" "budget" {
name = var.budget_name
budget_type = "COST"
limit_amount = "1000"
limit_unit = "USD"
time_period_end = "2087-06-15_00:00"
time_period_start = "2020-02-12_00:00"
time_unit = "MONTHLY"
cost_filters = {
Service = "Amazon Elastic Compute Cloud - Compute"
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 100
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = ["[email protected]"]
}
}
# This is our EC2 resource
resource "aws_instance" "web" {
ami = var.ami_id
count = var.instance_count
instance_type = var.instance_type
tags = {
Name = var.environment
}
}
#This is our s3 bucket
resource "aws_s3_bucket" "bucket" {
bucket = var.asset_bucket_name
acl = "private"
tags = {
Environment = var.environment
}
}
output "server_ip" {
value = aws_instance.web.*.public_dns
}