Skip to content

Commit 0f9e401

Browse files
committed
Upgrade terraform version to 0.14 and update
1 parent 4b5613a commit 0f9e401

File tree

9 files changed

+50
-39
lines changed

9 files changed

+50
-39
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.30.0
3+
rev: v1.45.0
44
hooks:
55
- id: terraform_fmt
66

77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v3.1.0
8+
rev: v3.4.0
99
hooks:
1010
- id: check-merge-conflict
1111
- id: trailing-whitespace

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Cloud Drove
3+
Copyright (c) 2021 Cloud Drove
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-elasticache
1616
# Badges to display
1717
badges:
1818
- name: "Terraform"
19-
image: "https://img.shields.io/badge/terraform-v0.13-green"
19+
image: "https://img.shields.io/badge/terraform-v0.14-green"
2020
url: "https://www.terraform.io"
2121
- name: "Licence"
2222
image: "https://img.shields.io/badge/License-MIT-blue.svg"
@@ -40,7 +40,7 @@ usage : |-
4040
module "redis" {
4141
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.13.0"
4242
name = "redis"
43-
application = "clouddrove"
43+
repository = "clouddrove"
4444
environment = "test"
4545
label_order = ["environment", "application", "name"]
4646
engine = "redis"

_example/memcached/example.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ provider "aws" {
33
}
44

55
module "vpc" {
6-
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.13.0"
6+
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=0.14"
77

88
name = "vpc"
9-
application = "clouddrove"
9+
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
1010
environment = "test"
11-
label_order = ["environment", "application", "name"]
11+
label_order = ["name", "environment"]
1212

1313
cidr_block = "172.16.0.0/16"
1414
}
1515

1616
module "subnets" {
17-
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git"
17+
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=0.14"
1818

1919
name = "subnets"
20-
application = "clouddrove"
20+
repository = "https://registry.terraform.io/modules/clouddrove/subnet/aws/0.14.0"
2121
environment = "test"
22-
label_order = ["environment", "application", "name"]
22+
label_order = ["name", "environment"]
2323

2424
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
2525
vpc_id = module.vpc.vpc_id
@@ -30,12 +30,12 @@ module "subnets" {
3030
}
3131

3232
module "memcached-sg" {
33-
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git"
33+
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=0.14"
3434

3535
name = "ssh"
36-
application = "clouddrove"
36+
repository = "https://registry.terraform.io/modules/clouddrove/security-group/aws/0.14.0"
3737
environment = "test"
38-
label_order = ["environment", "application", "name"]
38+
label_order = ["name", "environment"]
3939

4040
vpc_id = module.vpc.vpc_id
4141
allowed_ip = [module.vpc.vpc_cidr_block]
@@ -46,9 +46,9 @@ module "memcached" {
4646
source = "./../../"
4747

4848
name = "memcached"
49-
application = "clouddrove"
49+
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
5050
environment = "test"
51-
label_order = ["environment", "application", "name"]
51+
label_order = ["name", "environment"]
5252

5353
cluster_enabled = true
5454
engine = "memcached"

_example/redis-cluster/example.tf

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ module "vpc" {
66
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.13.0"
77

88
name = "vpc"
9-
application = "clouddrove"
9+
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
1010
environment = "test"
11-
label_order = ["environment", "application", "name"]
11+
label_order = ["name", "environment"]
1212

1313
cidr_block = "172.16.0.0/16"
1414
}
@@ -17,10 +17,9 @@ module "subnets" {
1717
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git"
1818

1919
name = "subnets"
20-
application = "clouddrove"
20+
repository = "https://registry.terraform.io/modules/clouddrove/subnet/aws/0.14.0"
2121
environment = "test"
22-
label_order = ["environment", "application", "name"]
23-
22+
label_order = ["name", "environment"]
2423
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
2524
vpc_id = module.vpc.vpc_id
2625
type = "public"
@@ -33,9 +32,9 @@ module "redis-sg" {
3332
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git"
3433

3534
name = "ssh"
36-
application = "clouddrove"
35+
repository = "https://registry.terraform.io/modules/clouddrove/security-group/aws/0.14.0"
3736
environment = "test"
38-
label_order = ["environment", "application", "name"]
37+
label_order = ["name", "environment"]
3938

4039
vpc_id = module.vpc.vpc_id
4140
allowed_ip = [module.vpc.vpc_cidr_block]
@@ -46,9 +45,9 @@ module "redis-cluster" {
4645
source = "./../../"
4746

4847
name = "cluster"
49-
application = "clouddrove"
48+
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
5049
environment = "test"
51-
label_order = ["environment", "application", "name"]
50+
label_order = ["name", "environment"]
5251

5352
cluster_replication_enabled = true
5453
engine = "redis"

_example/redis/example.tf

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ module "vpc" {
66
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.13.0"
77

88
name = "vpc"
9-
application = "clouddrove"
9+
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
1010
environment = "test"
11-
label_order = ["environment", "application", "name"]
12-
11+
label_order = ["name", "environment"]
1312
cidr_block = "172.16.0.0/16"
1413
}
1514

1615
module "subnets" {
1716
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git"
1817

1918
name = "subnets"
20-
application = "clouddrove"
19+
repository = "https://registry.terraform.io/modules/clouddrove/subnet/aws/0.14.0"
2120
environment = "test"
22-
label_order = ["environment", "application", "name"]
21+
label_order = ["name", "environment"]
2322

2423
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
2524
vpc_id = module.vpc.vpc_id
@@ -33,9 +32,9 @@ module "redis-sg" {
3332
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git"
3433

3534
name = "ssh"
36-
application = "clouddrove"
35+
repository = "https://registry.terraform.io/modules/clouddrove/security-group/aws/0.14.0"
3736
environment = "test"
38-
label_order = ["environment", "application", "name"]
37+
label_order = ["name", "environment"]
3938

4039
vpc_id = module.vpc.vpc_id
4140
allowed_ip = [module.vpc.vpc_cidr_block]
@@ -45,9 +44,9 @@ module "redis-sg" {
4544
module "redis" {
4645
source = "./../../"
4746
name = "redis"
48-
application = "clouddrove"
47+
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
4948
environment = "test"
50-
label_order = ["environment", "application", "name"]
49+
label_order = ["name", "environment"]
5150

5251
replication_enabled = true
5352
engine = "redis"

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
# tags for resources. You can use terraform-labels to implement a strict
99
# naming convention.
1010
module "labels" {
11-
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.13.0"
11+
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=0.14"
1212

1313
enabled = var.enable
1414
name = var.name
15-
application = var.application
15+
repository = var.repository
1616
environment = var.environment
1717
managedby = var.managedby
1818
label_order = var.label_order

variables.tf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ variable "name" {
66
description = "Name (e.g. `app` or `cluster`)."
77
}
88

9-
variable "application" {
9+
variable "repository" {
1010
type = string
1111
default = ""
12-
description = "Application (e.g. `cd` or `clouddrove`)."
12+
description = "Terraform current module repo"
13+
14+
validation {
15+
# regex(...) fails if it cannot find a match
16+
condition = can(regex("^https://", var.repository))
17+
error_message = "The module-repo value must be a valid Git repo link."
18+
}
1319
}
1420

1521
variable "environment" {
@@ -58,6 +64,7 @@ variable "engine" {
5864
variable "replication_group_id" {
5965
default = ""
6066
description = "The replication group identifier This parameter is stored as a lowercase string."
67+
sensitive = true
6168
}
6269

6370
variable "automatic_failover_enabled" {
@@ -73,6 +80,7 @@ variable "engine_version" {
7380
variable "port" {
7481
default = ""
7582
description = "the port number on which each of the cache nodes will accept connections."
83+
sensitive = true
7684
}
7785

7886
variable "node_type" {
@@ -83,6 +91,7 @@ variable "node_type" {
8391
variable "security_group_ids" {
8492
default = []
8593
description = "One or more VPC security groups associated with the cache cluster."
94+
sensitive = true
8695
}
8796

8897
variable "security_group_names" {
@@ -98,6 +107,7 @@ variable "snapshot_arns" {
98107
variable "snapshot_name" {
99108
default = ""
100109
description = "The name of a snapshot from which to restore data into the new node group. Changing the snapshot_name forces a new resource."
110+
sensitive = true
101111
}
102112

103113
variable "snapshot_window" {
@@ -113,6 +123,7 @@ variable "snapshot_retention_limit" {
113123
variable "notification_topic_arn" {
114124
default = ""
115125
description = "An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to."
126+
sensitive = true
116127
}
117128

118129
variable "apply_immediately" {
@@ -123,6 +134,7 @@ variable "apply_immediately" {
123134
variable "subnet_ids" {
124135
default = []
125136
description = "List of VPC Subnet IDs for the cache subnet group."
137+
sensitive = true
126138
}
127139

128140
variable "description" {
@@ -215,6 +227,7 @@ variable "num_node_groups" {
215227
variable "kms_key_id" {
216228
default = ""
217229
description = "The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if at_rest_encryption_enabled = true."
230+
sensitive = true
218231
}
219232

220233
variable "parameter_group_name" {

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Terraform version
22
terraform {
3-
required_version = ">= 0.13"
3+
required_version = ">= 0.15"
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"

0 commit comments

Comments
 (0)