generated from habedi/template-python-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
104 lines (97 loc) · 4.55 KB
/
outputs.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
################################################################################
# Networking Outputs
################################################################################
output "vpc_info" {
description = "Details of the VPC and associated networking resources."
value = {
vpc_id = aws_vpc.main.id
vpc_cidr_block = aws_vpc.main.cidr_block
public_subnet_id = aws_subnet.public.id
public_subnet_cidr = aws_subnet.public.cidr_block
private_subnet_az1_id = aws_subnet.private_a.id
private_subnet_az1_cidr = aws_subnet.private_a.cidr_block
private_subnet_az2_id = aws_subnet.private_b.id
private_subnet_az2_cidr = aws_subnet.private_b.cidr_block
internet_gateway_id = aws_internet_gateway.igw.id
}
}
################################################################################
# Database Outputs
################################################################################
output "aurora_postgresql_cluster" {
description = "Aurora PostgreSQL cluster configuration details."
value = {
cluster_id = aws_rds_cluster.aurora_pg.id
cluster_endpoint = aws_rds_cluster.aurora_pg.endpoint
cluster_reader_endpoint = aws_rds_cluster.aurora_pg.reader_endpoint
cluster_engine_version = aws_rds_cluster.aurora_pg.engine_version
db_name = var.db_parameters["db_name"]
master_username = var.db_parameters["username"]
security_group_id = aws_security_group.rds_sg.id
db_subnet_group_name = aws_db_subnet_group.aurora_subnet_group.name
cluster_arn = aws_rds_cluster.aurora_pg.arn
}
}
################################################################################
# Storage Outputs
################################################################################
output "s3_bucket_info" {
description = "Details about the S3 bucket used for database dumps."
value = {
bucket_name = aws_s3_bucket.database_dump.bucket
bucket_arn = aws_s3_bucket.database_dump.arn
region = var.region
dump_file_key = aws_s3_object.database_dump_file.key
dump_file_etag = aws_s3_object.database_dump_file.etag
}
}
################################################################################
# API Services Outputs
################################################################################
output "appsync_api_info" {
description = "Details of the AppSync API configuration."
value = {
api_name = aws_appsync_graphql_api.appsync_api.name
graphql_endpoint = aws_appsync_graphql_api.appsync_api.uris["GRAPHQL"]
api_id = aws_appsync_graphql_api.appsync_api.id
authentication_type = aws_appsync_graphql_api.appsync_api.authentication_type
datasource_name = aws_appsync_datasource.aurora_ds.name
service_role_arn = aws_iam_role.appsync_role.arn
}
}
################################################################################
# SIC Outputs
################################################################################
output "secrets_manager_info" {
description = "Details about the AWS Secrets Manager secret for Aurora PostgreSQL credentials."
value = {
secret_name = aws_secretsmanager_secret.aurora_pg_secret.name
secret_arn = aws_secretsmanager_secret.aurora_pg_secret.arn
secret_version_id = aws_secretsmanager_secret_version.aurora_pg_secret_version.version_id
}
}
output "iam_roles" {
description = "IAM roles created for the infrastructure."
value = {
appsync_role_arn = aws_iam_role.appsync_role.arn
}
}
################################################################################
# Compute Outputs
################################################################################
output "bastion_host_info" {
description = "Details of the bastion host configuration."
value = {
bastion_host_ami_id = var.bastion_host["ami"]
bastion_host_instance_id = aws_instance.bastion_host.id
bastion_host_public_ip = aws_instance.bastion_host.public_ip
bastion_host_key_name = var.key_info["name"]
}
}
################################################################################
# Extra Outputs
################################################################################
output "unique_id" {
description = "Unique ID used for naming resources."
value = random_id.unique.hex
}