-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from yunkon-kim/241112-16
Enhance `output` block and add related `Go struct`
- Loading branch information
Showing
5 changed files
with
112 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
output "sql_db_info" { | ||
value = { | ||
db_instance_identifier = aws_db_instance.db_instance.identifier | ||
db_instance_endpoint = aws_db_instance.db_instance.endpoint | ||
db_instance_port = aws_db_instance.db_instance.port | ||
db_instance_username = aws_db_instance.db_instance.username | ||
db_instance_engine = aws_db_instance.db_instance.engine | ||
db_instance_version = aws_db_instance.db_instance.engine_version | ||
db_instance_vpc_id = var.csp_vnet_id | ||
db_instance_subnet_ids = [var.csp_subnet1_id, var.csp_subnet2_id] | ||
db_security_group_name = "${var.terrarium_id}-rds-sg" | ||
terrarium = { | ||
id = var.terrarium_id | ||
} | ||
aws = { | ||
instance_identifier = aws_db_instance.db_instance.identifier | ||
connection_info = aws_db_instance.db_instance.endpoint | ||
port = var.db_engine_port | ||
admin_username = aws_db_instance.db_instance.username | ||
database_engine = aws_db_instance.db_instance.engine | ||
engine_version = aws_db_instance.db_instance.engine_version | ||
region = var.csp_region | ||
vpc_id = var.csp_vnet_id | ||
subnet_ids = [var.csp_subnet1_id, var.csp_subnet2_id] | ||
security_group_name = "${var.terrarium_id}-rds-sg" | ||
} | ||
} | ||
|
||
description = "Information for connecting to the MySQL RDS instance with dynamic variables." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
output "sql_db_info" { | ||
description = "Information needed to connect and manage the Azure Database for MySQL instance." | ||
value = { | ||
location = azurerm_mysql_flexible_server.instance.location | ||
resource_group_name = azurerm_mysql_flexible_server.instance.resource_group_name | ||
server_name = azurerm_mysql_flexible_server.instance.name | ||
fully_qualified_domain_name = azurerm_mysql_flexible_server.instance.fqdn | ||
administrator_login = azurerm_mysql_flexible_server.instance.administrator_login | ||
# administrator_password = "YOUR_PASSWORD_HERE" # Note: Avoid exposing this directly; consider using a secret management tool | ||
database_name = azurerm_mysql_flexible_database.engine.name | ||
port = 3306 | ||
# ssl_enforcement = azurerm_mysql_flexible_server.example.ssl_enforcement_enabled | ||
terrarium = { | ||
id = var.terrarium_id | ||
} | ||
azure = { | ||
instance_identifier = azurerm_mysql_flexible_server.instance.name | ||
connection_info = azurerm_mysql_flexible_server.instance.fqdn | ||
port = 3306 # var.db_engine_port | ||
admin_username = azurerm_mysql_flexible_server.instance.administrator_login | ||
database_name = azurerm_mysql_flexible_database.engine.name | ||
region = azurerm_mysql_flexible_server.instance.location | ||
resource_group = azurerm_mysql_flexible_server.instance.resource_group_name | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
# Outputs wrapped in SqlDbInstanceInfo object, including public IP | ||
output "sql_db_info" { | ||
value = { | ||
instance_name = google_sql_database_instance.instance.name | ||
database_name = google_sql_database.engine.name | ||
database_user = google_sql_user.admin_user.name | ||
connection_name = google_sql_database_instance.instance.connection_name | ||
public_ip = google_sql_database_instance.instance.public_ip_address | ||
terrarium = { | ||
id = var.terrarium_id | ||
} | ||
gcp = { | ||
instance_identifier = google_sql_database_instance.instance.name | ||
database_name = google_sql_database.engine.name | ||
admin_username = google_sql_user.admin_user.name | ||
connection_info = google_sql_database_instance.instance.connection_name | ||
ip_address = google_sql_database_instance.instance.public_ip_address | ||
port = 3306 # var.db_engine_port | ||
region = google_sql_database_instance.instance.region | ||
} | ||
} | ||
description = "Information for SQL Database instance, including instance name, database name, user, connection name, and public IP address" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
output "sql_db_info" { | ||
description = "Information needed to connect to the MySQL RDS instance." | ||
value = { | ||
service_name = ncloud_mysql.mysql.service_name | ||
server_name_prefix = ncloud_mysql.mysql.server_name_prefix | ||
user_name = ncloud_mysql.mysql.user_name | ||
host_ip = ncloud_mysql.mysql.host_ip | ||
database_name = ncloud_mysql.mysql.database_name | ||
# user_password = ncloud_mysql.mysql.user_password | ||
terrarium = { | ||
id = var.terrarium_id | ||
} | ||
ncp = { | ||
instance_identifier = ncloud_mysql.mysql.service_name | ||
connection_info = ncloud_mysql.mysql.host_ip | ||
admin_username = ncloud_mysql.mysql.user_name | ||
database_name = ncloud_mysql.mysql.database_name | ||
port = 3306 # var.db_engine_port | ||
region = ncloud_mysql.mysql.region // Assume region is available | ||
} | ||
} | ||
# sensitive = true // Mark as sensitive to hide sensitive details like passwords | ||
} |