Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Bump up AWS & Terraform Requirements #2

Open
wants to merge 7 commits into
base: test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module "rds-cluster-aws-terraform" {

| Name | Version |
|------|---------|
| aws | ~> 2.0 |
| aws | ~> 4.0 |

## Inputs

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ resource "random_password" "password" {

locals {
cluster_identifier = length(var.cluster_identifier) == 0 ? format("%s-%s-rds-cluster", var.service_name, var.environment) : var.cluster_identifier
tags = merge(var.tags, map("Name", format("%s-%s-rds-cluster", var.service_name, var.environment)))
tags = merge(var.tags, {"Name" = format("%s-%s-rds-cluster", var.service_name, var.environment)})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't name any kind of RDS instance as a cluster

master_password = var.master_password != "" ? var.master_password : random_password.password[0].result
final_snapshot_identifier = length(var.final_snapshot_identifier) != 0 ? var.final_snapshot_identifier : format("%s-%s-snapshot", var.service_name, var.environment)
}
1 change: 1 addition & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ output "master_username" {

output "master_password" {
value = aws_rds_cluster.rds_cluster[0].master_password
sensitive = true
}

#output "hosted_zone_id" {
Expand Down
4 changes: 4 additions & 0 deletions provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
provider "aws" {
profile = var.aws_profile
region = var.aws_region
}
15 changes: 8 additions & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ variable "environment" {
variable "aws_region" {
type = string
description = "AWS Region for develop infra"
default = "us-east-1"
}

variable "aws_profile" {
type = string
description = "The AWS Profile"
}

variable "enable" {
Expand All @@ -33,13 +39,11 @@ variable "cluster_identifier" {

variable "engine" {
type = string
default = "aurora"
description = "The name of the database engine to be used for this DB cluster"
}

variable "engine_version" {
type = string
default = ""
description = "The database engine version"
}

Expand Down Expand Up @@ -68,7 +72,7 @@ variable "database_name" {

variable "master_username" {
type = string
default = "admin"
default = "sradmin"
description = "Username for the master DB user"

}
Expand Down Expand Up @@ -250,8 +254,7 @@ variable "scaling_configuration" {
}
variable "vpc_id" {
type = string
description = ""
default = ""
description = "VPC to launch the DB in"
}

variable "timeouts" {
Expand All @@ -274,7 +277,6 @@ variable "subnet_group_name_prefix" {

variable "subnet_ids" {
type = list
default = []
description = "A list of VPC subnet IDs (db_subnet_group)"
}

Expand Down Expand Up @@ -388,7 +390,6 @@ variable "cidr_blocks_allowed" {

variable "cluster_family" {
type = string
default = "aurora5.6"
description = "The family of the DB cluster parameter group"
}

Expand Down
5 changes: 2 additions & 3 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
provider "aws" { region = var.aws_region }
terraform {
required_version = "~> 0.12"
required_version = "~> 1.2"
required_providers {
aws = "~> 2.0"
aws = "~> 4.0"
}
}