-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
83 lines (74 loc) · 1.98 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.16"
}
}
required_version = ">= 1.2.0"
}
provider "aws" {
region = "us-east-1"
profile = "atn-developer"
}
resource "aws_elastic_beanstalk_application" "eb_app" {
name = "saysdont-app"
description = "Saysdont music promo website"
}
resource "aws_elastic_beanstalk_environment" "eb_app_env" {
name = "etienne-site"
application = aws_elastic_beanstalk_application.eb_app.name
solution_stack_name = "64bit Amazon Linux 2023 v6.1.7 running Node.js 20"
setting {
namespace = "aws:autoscaling:launchconfiguration"
name = "IamInstanceProfile"
value = "aws-elasticbeanstalk-ec2-role"
}
setting {
namespace = "aws:autoscaling:launchconfiguration"
name = "DisableIMDSv1"
value = "true"
}
setting {
namespace = "aws:autoscaling:asg"
name = "MinSize"
value = "1"
}
setting {
namespace = "aws:autoscaling:asg"
name = "MaxSize"
value = "1"
}
setting {
namespace = "aws:elasticbeanstalk:environment"
name = "EnvironmentType"
value = "LoadBalanced"
}
setting {
namespace = "aws:elasticbeanstalk:environment"
name = "LoadBalancerType"
value = "application"
}
setting {
namespace = "aws:ec2:instances"
name = "InstanceTypes"
value = "t4g.small"
}
setting {
namespace = "aws:elasticbeanstalk:environment:proxy"
name = "ProxyServer"
value = "apache"
}
}
# Reference the existing hosted zone for saysdont.com
data "aws_route53_zone" "saysdont" {
name = "saysdont.com."
private_zone = false
}
resource "aws_route53_record" "eb_dns" {
zone_id = data.aws_route53_zone.saysdont.id
name = "app.saysdont.com"
type = "CNAME"
ttl = "300"
records = [aws_elastic_beanstalk_environment.eb_app_env.endpoint_url]
}