Skip to content

Commit

Permalink
Added optional tags for all resources to each module. (#13)
Browse files Browse the repository at this point in the history
* Added "use" tag to subnets.
* Added optional tags for all resources
  • Loading branch information
jamesiarmes authored Aug 13, 2024
1 parent 9aa4dee commit e2ce0b4
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ tofu init -upgrade
| service | Optional service that these resources are supporting. Example: 'api', 'web', 'worker' | `string` | `""` | no |
| skip_final_snapshot | Whether to skip the final snapshot when destroying the database cluster. | `bool` | `false` | no |
| snapshot_identifier | Optional name or ARN of the snapshot to restore the cluster from. Only applicable on create. | `bool` | `false` | no |
| tags | Optional tags to be applied to all resources. | `list` | `[]` | no |


## Outputs
2 changes: 2 additions & 0 deletions kms.tf
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ resource "aws_kms_key" "database" {
partition : data.aws_partition.current.partition,
region : data.aws_region.current.name,
})))

tags = var.tags
}

resource "aws_kms_alias" "database" {
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -51,4 +51,6 @@ module "database" {
one = {}
two = {}
}

tags = var.tags
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -82,6 +82,12 @@ variable "subnets" {
description = "List of subnet ids the database instances may be placed in"
}

variable "tags" {
type = map(string)
description = "Tags to apply to all resources."
default = {}
}

variable "vpc_id" {
type = string
description = "Id of the VPC to launch the database cluster into."

0 comments on commit e2ce0b4

Please sign in to comment.