Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Use splat syntax to access attributes for resources with count set.
Browse files Browse the repository at this point in the history
[#153534525]
  • Loading branch information
Genevieve LEsperance committed Dec 9, 2017
1 parent b0a6af9 commit 7ff1bf6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions ops_manager/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
output "bucket" {
value = "${aws_s3_bucket.ops_manager_bucket.bucket}"
value = "${element(concat(aws_s3_bucket.ops_manager_bucket.*.bucket, list("")), 0)}"
}

output "public_ip" {
value = "${aws_eip.ops_manager.public_ip}"
value = "${element(concat(aws_eip.ops_manager.*.public_ip, list("")), 0)}"
}

output "dns" {
value = "${aws_route53_record.ops_manager.name}"
value = "${element(concat(aws_route53_record.ops_manager.*.name, list("")), 0)}"
}

output "optional_dns" {
value = "${element(concat(aws_route53_record.optional_ops_manager.*.name, list("")), 0)}"
}

output "security_group_id" {
value = "${aws_security_group.ops_manager_security_group.id}"
value = "${element(concat(aws_security_group.ops_manager_security_group.*.id, list("")), 0)}"
}

output "ssh_private_key" {
value = "${tls_private_key.ops_manager.private_key_pem}"
value = "${element(concat(tls_private_key.ops_manager.*.private_key_pem, list("")), 0)}"
}

output "ssh_public_key_name" {
value = "${aws_key_pair.ops_manager.key_name}"
value = "${element(concat(aws_key_pair.ops_manager.*.key_name, list("")), 0)}"
}

output "ops_manager_private_ip" {
value = "${aws_instance.ops_manager.private_ip}"
value = "${element(concat(aws_instance.ops_manager.*.private_ip, list("")), 0)}"
}
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ output "iam_user_secret_access_key" {
}

output "rds_address" {
value = "${aws_db_instance.rds.address}"
value = "${element(concat(aws_db_instance.rds.*.address, list("")), 0)}"
}

output "rds_port" {
value = "${aws_db_instance.rds.port}"
value = "${element(concat(aws_db_instance.rds.*.port, list("")), 0)}"
}

output "rds_username" {
value = "${aws_db_instance.rds.username}"
value = "${element(concat(aws_db_instance.rds.*.username, list("")), 0)}"
}

output "rds_password" {
value = "${aws_db_instance.rds.password}"
value = "${element(concat(aws_db_instance.rds.*.password, list("")), 0)}"
}

output "ops_manager_security_group_id" {
Expand Down

0 comments on commit 7ff1bf6

Please sign in to comment.