forked from hyprnz/terraform-aws-data-storage-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputs.tf
92 lines (75 loc) · 3.18 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
output "rds_instance_address" {
description = "The address of the RDS instance"
value = element(concat(aws_db_instance.this.*.address, aws_db_instance.snapshot.*.address, [""]), 0)
}
output "rds_instance_arn" {
description = "The ARN of the RDS instance"
value = element(concat(aws_db_instance.this.*.arn, aws_db_instance.snapshot.*.arn, [""]), 0)
}
output "rds_instance_endpoint" {
description = "The connection endpoint"
value = element(concat(aws_db_instance.this.*.endpoint, aws_db_instance.snapshot.*.endpoint, [""]), 0)
}
output "rds_instance_id" {
description = "The RDS instance ID"
value = element(concat(aws_db_instance.this.*.id, aws_db_instance.snapshot.*.id, [""]), 0)
}
output "rds_db_name" {
description = "The name of the rds database"
value = element(concat(aws_db_instance.this.*.name, aws_db_instance.snapshot.*.name, [""]), 0)
}
output "rds_db_user" {
description = "The RDS db username"
value = element(concat(aws_db_instance.this.*.username, aws_db_instance.snapshot.*.username, [""]), 0)
}
output "rds_db_url" {
description = "The connection url in the format of `engine`://`user`:`password`@`endpoint`/`db_name`"
value = element(concat(aws_db_instance.this.*.username, aws_db_instance.snapshot.*.username, [""]), 0) == "" ? "" : format(
"%s://%s:%s@%s/%s",
var.rds_engine,
element(concat(aws_db_instance.this.*.username, aws_db_instance.snapshot.*.username, [""]), 0),
var.rds_password,
element(concat(aws_db_instance.this.*.endpoint, aws_db_instance.snapshot.*.endpoint, [""]), 0),
element(concat(aws_db_instance.this.*.name, aws_db_instance.snapshot.*.name, [""]), 0),
)
}
output "s3_bucket" {
description = "The name of the bucket"
value = join(",", aws_s3_bucket.this.*.bucket)
}
output "s3_bucket_policy_arn" {
description = "Policy arn to be attached to a execution role defined in the parent module"
value = join(",", aws_iam_policy.s3_datastore_bucket[*].arn)
}
output "dynamodb_table_name" {
description = "DynamoDB table name"
value = join(",", aws_dynamodb_table.this[*].name)
}
output "dynamodb_table_id" {
description = "DynamoDB table ID"
value = join(",", aws_dynamodb_table.this[*].id)
}
output "dynamodb_table_arn" {
description = "DynamoDB table ARN"
value = join(",", aws_dynamodb_table.this[*].arn)
}
output "dynamodb_global_secondary_index_names" {
description = "DynamoDB secondary index names"
value = null_resource.global_secondary_index_names[*].triggers.name
}
output "dynamodb_local_secondary_index_names" {
description = "DynamoDB local index names"
value = null_resource.local_secondary_index_names[*].triggers.name
}
output "dynamodb_table_stream_arn" {
description = "DynamoDB table stream ARN"
value = join(",", aws_dynamodb_table.this[*].stream_arn)
}
output "dynamodb_table_stream_label" {
description = "DynamoDB table stream label"
value = join(",", aws_dynamodb_table.this[*].stream_label)
}
output "dynamodb_table_policy_arn" {
description = "Policy arn to be attached to an execution role defined in the parent module."
value = join("", aws_iam_policy.dynamodb_table_datastore[*].arn)
}