|
@@ -1,28 +1,30 @@
|
|
|
locals {
|
|
|
+ tmp_output = {
|
|
|
+ "cognito" : {
|
|
|
+ "user_pool" : aws_cognito_user_pool.pool.id,
|
|
|
+ "client_id" : aws_cognito_user_pool_client.client.id,
|
|
|
+ "api_endpoint" : aws_apigatewayv2_api.gateway.api_endpoint
|
|
|
+ },
|
|
|
+ "api_gateway" : {
|
|
|
+ "test_endpoint" : aws_apigatewayv2_stage.test.invoke_url
|
|
|
+ },
|
|
|
+ "test_instances" : {
|
|
|
+ "dns" : aws_instance.test[*].public_dns,
|
|
|
+ "public_ip" : aws_instance.test[*].public_ip,
|
|
|
+ "private_ip" : aws_instance.test[*].private_ip
|
|
|
+ },
|
|
|
+ "elasticache" : {
|
|
|
+ "endpoints" : aws_elasticache_cluster.redis.cache_nodes[*]["address"]
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-output "cognito_user_pool" {
|
|
|
- value = aws_cognito_user_pool.pool.id
|
|
|
-}
|
|
|
-
|
|
|
-output "cognito_client_id" {
|
|
|
- value = aws_cognito_user_pool_client.client.id
|
|
|
-}
|
|
|
-
|
|
|
-output "api_endpoint" {
|
|
|
- value = aws_apigatewayv2_api.gateway.api_endpoint
|
|
|
-}
|
|
|
-
|
|
|
-output "test_api_endpoint" {
|
|
|
- value = aws_apigatewayv2_stage.test.invoke_url
|
|
|
+# Create a file other scripts can read
|
|
|
+resource "local_file" "output" {
|
|
|
+ filename = "${path.module}/terraform_resources.json"
|
|
|
+ content = jsonencode(local.tmp_output)
|
|
|
}
|
|
|
|
|
|
-output "test_instances_dns" {
|
|
|
- value = {
|
|
|
- "DNS" : aws_instance.test[*].public_dns,
|
|
|
- "IP" : aws_instance.test[*].public_ip
|
|
|
- }
|
|
|
+output "resources" {
|
|
|
+ value = local.tmp_output
|
|
|
}
|
|
|
-
|
|
|
-#output "elasticache_endpoint" {
|
|
|
-# value = aws_elasticache_cluster.redis.
|