-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.tf
69 lines (54 loc) · 1.38 KB
/
data.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
# EC2[for Migration] AMI info
data "aws_ami" "instance_image_setup" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"] # Canonical
}
data "aws_ami" "instance_image_lamp" {
most_recent = true
# id = ami-0cb0b94275d5b4aec
filter {
name = "name"
values = ["al2023-ami-2023.5.20240916.0-kernel-6.1-x86_64"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["137112412989"] # Amazon Linux 2023
}
# 2
data "aws_db_snapshot" "snapshot_for_rds" {
db_instance_identifier = var.snapshot_db_identifier
most_recent = true
snapshot_type = "manual"
}
# To Retrieve the snapshot, which is prepared manually and most recently.
data "aws_route53_zone" "domain_name" {
name = var.my_domain
private_zone = false
}
# #apex domain / public DNS(route53)
data "aws_elb_service_account" "main" {}
data "aws_iam_policy_document" "policy_configuration" {
statement {
principals {
type = "AWS"
identifiers = [data.aws_elb_service_account.main.arn]
}
actions = [
"s3:PutObject",
]
resources = [
aws_s3_bucket.log_bucket.arn,
"${aws_s3_bucket.log_bucket.arn}/*",
]
}
}