Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added new vpc tag #39

Merged
merged 3 commits into from
Jul 31, 2023
Merged
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 _example/MariaDb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "aws" {
####----------------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/PostgreSQL/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "aws" {
####----------------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/complete-mssql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "aws" {
####----------------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/complete-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "aws" {
####----------------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/oracle_db/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "aws" {
####----------------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/replica-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "aws" {

module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand Down
17 changes: 4 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,20 @@
locals {
monitoring_role_arn = var.enabled_monitoring_role ? aws_iam_role.enhanced_monitoring[0].arn : var.monitoring_role_arn

final_snapshot_identifier = var.skip_final_snapshot ? null : "${var.final_snapshot_identifier_prefix}-${var.identifier}-${try(random_id.snapshot_identifier[0].hex, "")}"

identifier = var.use_identifier_prefix ? null : var.identifier
identifier_prefix = var.use_identifier_prefix ? "${var.identifier}-" : null

final_snapshot_identifier = var.skip_final_snapshot ? null : "${var.final_snapshot_identifier_prefix}-${var.identifier}-${try(random_id.snapshot_identifier[0].hex, "")}"
identifier = var.use_identifier_prefix ? null : var.identifier
identifier_prefix = var.use_identifier_prefix ? "${var.identifier}-" : null
monitoring_role_name = var.monitoring_role_use_name_prefix ? null : var.monitoring_role_name
monitoring_role_name_prefix = var.monitoring_role_use_name_prefix ? "${var.monitoring_role_name}-" : null
db_subnet_group_name = var.enabled_db_subnet_group ? join("", aws_db_subnet_group.this.*.id) : var.db_subnet_group_name

Check warning on line 30 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 30 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 30 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 30 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

# Replicas will use source metadata
username = var.replicate_source_db != null ? null : var.username
password = var.password == "" ? join("", random_id.password.*.b64_url) : var.password

Check warning on line 34 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 34 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 34 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 34 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets
engine = var.replicate_source_db != null ? null : var.engine
engine_version = var.replicate_source_db != null ? null : var.engine_version

name = var.use_name_prefix ? null : var.name
name = var.use_name_prefix ? null : var.name
// name_prefix = var.use_name_prefix ? "${var.name}-" : null

description = coalesce(var.option_group_description, format("%s option group", var.name))
}

Expand All @@ -61,7 +57,6 @@
name = module.labels.id
description = local.description
subnet_ids = var.subnet_ids

tags = merge(
module.labels.tags,
var.db_subnet_group_tags
Expand All @@ -77,7 +72,6 @@
name = module.labels.id
description = local.description
family = var.family

dynamic "parameter" {
for_each = var.parameters
content {
Expand All @@ -86,7 +80,6 @@
apply_method = lookup(parameter.value, "apply_method", null)
}
}

tags = merge(
module.labels.tags,
var.db_parameter_group_tags,
Expand All @@ -109,7 +102,6 @@
option_group_description = local.description
engine_name = var.engine_name
major_engine_version = var.major_engine_version

dynamic "option" {
for_each = var.options
content {
Expand All @@ -118,7 +110,6 @@
version = lookup(option.value, "version", null)
db_security_group_memberships = lookup(option.value, "db_security_group_memberships", null)
vpc_security_group_memberships = lookup(option.value, "vpc_security_group_memberships", null)

dynamic "option_settings" {
for_each = lookup(option.value, "option_settings", [])
content {
Expand Down Expand Up @@ -155,7 +146,7 @@

name = "/aws/rds/instance/${module.labels.id}/${each.value}"
retention_in_days = var.cloudwatch_log_group_retention_in_days
kms_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default.*.arn) : var.kms_key_id

Check warning on line 149 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

Check warning on line 149 in main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

List items should be accessed using square brackets

tags = merge(
module.labels.tags,
Expand Down