Skip to content

Commit

Permalink
Merge pull request #6 from kesarevs/v5.0.0-provider-changes
Browse files Browse the repository at this point in the history
V5.0.0 provider changes
  • Loading branch information
chrkv authored Aug 2, 2024
2 parents b7a122c + 70c4e7d commit be5f25b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
23 changes: 22 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ output "hosted_zone_id" {
}

output "rds_id" {
/*
Deprecated:
Since aws provider v5.0.0 `aws_db_instance.id` returns resource id instead of instance id.
Consider to use `rds_identifier` or `rds_arn` instead.
For the details see https://github.com/hashicorp/terraform-provider-aws/pull/31232.
*/
description = "RDS Resource ID (for aws provider >= v5.0.0) or instance id (for aws provider < v5.0.0)."
value = local.resource_id
}

output "rds_resource_id" {
description = "RDS Resource ID"
value = local.resource_id
}

output "rds_arn" {
description = "The RDS ARN"
value = local.arn
}

output "rds_identifier" {
description = "The RDS instance ID"
value = local.rds_id
value = local.identifier
}
10 changes: 6 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,23 @@ locals {
vpc_id = data.aws_subnet.default.vpc_id
address = local.parameter_group_name == "" ? join("", aws_db_instance.default.*.address) : join("", aws_db_instance.parameterized.*.address)
hosted_zone_id = local.parameter_group_name == "" ? join("", aws_db_instance.default.*.hosted_zone_id) : join("", aws_db_instance.parameterized.*.hosted_zone_id)
rds_id = local.parameter_group_name == "" ? join("", aws_db_instance.default.*.id) : join("", aws_db_instance.parameterized.*.id)
resource_id = local.parameter_group_name == "" ? join("", aws_db_instance.default.*.id) : join("", aws_db_instance.parameterized.*.id)
identifier = local.parameter_group_name == "" ? join("", aws_db_instance.default.*.identifier) : join("", aws_db_instance.parameterized.*.identifier)
arn = local.parameter_group_name == "" ? join("", aws_db_instance.default.*.arn) : join("", aws_db_instance.parameterized.*.arn)
storage_type = var.storage_type
iam_database_authentication_enabled = var.iam_database_authentication_enabled
logs_set = compact([
logs_set = compact([
var.enable_audit_log ? "audit" : "",
var.enable_error_log ? "error" : "",
var.enable_general_log ? "general" : "",
var.enable_slowquery_log ? "slowquery" : "",
])
enhanced_monitoring_interval = var.enhanced_monitoring_interval
performance_insights_enabled = var.performance_insights_enabled
tags = merge({
tags = merge({
Name = var.name,
Module = "RDS MySQL"
ModuleVersion = "v0.5.0"
ModuleVersion = "v0.5.1"
ModuleSource = "https://github.com/jetbrains-infra/terraform-aws-rds-mysql"
}, var.tags)
}

0 comments on commit be5f25b

Please sign in to comment.