From e9280f4946d708022d6a4d0b7a3badcf56b6a9ca Mon Sep 17 00:00:00 2001 From: Ed Fricker Date: Thu, 19 Aug 2021 12:01:57 +0100 Subject: [PATCH] db: minor version control, fix for snapshot identifier, new AMIs --- provider/aws/formation/app.json.tmpl | 6 +++ provider/aws/formation/rack.json | 42 +++++++++---------- .../aws/formation/resource/mariadb.json.tmpl | 6 +++ .../formation/resource/memcached.json.tmpl | 7 +++- .../aws/formation/resource/mysql.json.tmpl | 6 +++ .../aws/formation/resource/postgres.json.tmpl | 6 +++ .../aws/formation/resource/redis.json.tmpl | 7 +++- provider/aws/templates/resource/mysql.tmpl | 8 +++- provider/aws/templates/resource/postgres.tmpl | 6 +++ 9 files changed, 70 insertions(+), 24 deletions(-) diff --git a/provider/aws/formation/app.json.tmpl b/provider/aws/formation/app.json.tmpl index e78ccde4b3..ac1d75debc 100644 --- a/provider/aws/formation/app.json.tmpl +++ b/provider/aws/formation/app.json.tmpl @@ -52,6 +52,11 @@ "Parameters" : { {{ template "service-params" .Manifest }} + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "CircuitBreaker": { "Type": "String", "Default": "No", @@ -224,6 +229,7 @@ {{ range $k, $v := (index $ (printf "ResourceParams%s" (upper .Name) ) ) }} "{{$k}}": "{{$v}}", {{ end }} + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "Password": { "Fn::If": [ "BlankResourcePassword", { "Fn::Select": [ 2, { "Fn::Split": [ "/", { "Ref": "AWS::StackId" } ] } ] }, { "Ref": "ResourcePassword" } diff --git a/provider/aws/formation/rack.json b/provider/aws/formation/rack.json index 576a4a4995..bd7962d63b 100644 --- a/provider/aws/formation/rack.json +++ b/provider/aws/formation/rack.json @@ -68,27 +68,27 @@ }, "Mappings": { "RegionConfig": { - "af-south-1": { "Ami": "ami-02d67c60a9a72a4c9", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "098369216593", "Fargate": "Yes" }, - "ap-east-1": { "Ami": "ami-0903490e028d75f33", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "754344448648", "Fargate": "Yes" }, - "ap-northeast-1": { "Ami": "ami-0ffb5f4e03c892bc5", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "582318560864", "Fargate": "No" }, - "ap-northeast-2": { "Ami": "ami-0a09f75d88cac17d3", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "600734575887", "Fargate": "Yes" }, - "ap-northeast-3": { "Ami": "ami-0e47631e1b1fb884c", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "383597477331", "Fargate": "Yes" }, - "ap-south-1": { "Ami": "ami-02704edb2becb49b9", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "718504428378", "Fargate": "Yes" }, - "ap-southeast-1": { "Ami": "ami-0c5ab0d956378c44d", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "114774131450", "Fargate": "Yes" }, - "ap-southeast-2": { "Ami": "ami-0ba6df717ed766b7c", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "783225319266", "Fargate": "Yes" }, - "ca-central-1": { "Ami": "ami-09dab0e05012ef93d", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "985666609251", "Fargate": "No" }, - "eu-central-1": { "Ami": "ami-0ebfeb0108c46be41", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "054676820928", "Fargate": "Yes" }, - "eu-north-1": { "Ami": "ami-0035a9fe772fd6d60", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "897822967062", "Fargate": "Yes" }, - "eu-south-1": { "Ami": "ami-0d78d1b861cca58f3", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "635631232127", "Fargate": "Yes" }, - "eu-west-1": { "Ami": "ami-0fc76c7f5cfa96e89", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "156460612806", "Fargate": "Yes" }, - "eu-west-2": { "Ami": "ami-077f98d933531f865", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "652711504416", "Fargate": "Yes" }, - "eu-west-3": { "Ami": "ami-0c8823759848d625a", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "009996457667", "Fargate": "Yes" }, - "me-south-1": { "Ami": "ami-006655367b29fb81c", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "076674570225", "Fargate": "Yes" }, - "sa-east-1": { "Ami": "ami-0f9e2322459fd12e0", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "507241528517", "Fargate": "Yes" }, - "us-east-1": { "Ami": "ami-0dbd8c88f9060cf71", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "127311923021", "Fargate": "Yes" }, - "us-east-2": { "Ami": "ami-062be0c2f0e7fb6d2", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "033677994240", "Fargate": "Yes" }, - "us-west-1": { "Ami": "ami-09bc3667a66efbf89", "EFS": "Yes", "ThirdAvailabilityZone": "No", "ELBAccountId": "027434742980", "Fargate": "No" }, - "us-west-2": { "Ami": "ami-0a51409a409fbc030", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "797873946194", "Fargate": "Yes" }, + "af-south-1": { "Ami": "ami-04595fb57b8c3064d", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "098369216593", "Fargate": "Yes" }, + "ap-east-1": { "Ami": "ami-04ab87564f47361db", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "754344448648", "Fargate": "Yes" }, + "ap-northeast-1": { "Ami": "ami-07932765b08ae3232", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "582318560864", "Fargate": "No" }, + "ap-northeast-2": { "Ami": "ami-040ef5b25ed8bf593", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "600734575887", "Fargate": "Yes" }, + "ap-northeast-3": { "Ami": "ami-0fd48c913e53119a1", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "383597477331", "Fargate": "Yes" }, + "ap-south-1": { "Ami": "ami-017cab36e4ddda18b", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "718504428378", "Fargate": "Yes" }, + "ap-southeast-1": { "Ami": "ami-0cf02969983d4304c", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "114774131450", "Fargate": "Yes" }, + "ap-southeast-2": { "Ami": "ami-0e3a9308d8f475421", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "783225319266", "Fargate": "Yes" }, + "ca-central-1": { "Ami": "ami-0ebb9f30538a674fd", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "985666609251", "Fargate": "No" }, + "eu-central-1": { "Ami": "ami-0102ef3da1a6c47ca", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "054676820928", "Fargate": "Yes" }, + "eu-north-1": { "Ami": "ami-0e74361b71c3bbc04", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "897822967062", "Fargate": "Yes" }, + "eu-south-1": { "Ami": "ami-0d6fd8fdf5e5747a7", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "635631232127", "Fargate": "Yes" }, + "eu-west-1": { "Ami": "ami-0f81029f3b18d0712", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "156460612806", "Fargate": "Yes" }, + "eu-west-2": { "Ami": "ami-02fee912d20d2f3cd", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "652711504416", "Fargate": "Yes" }, + "eu-west-3": { "Ami": "ami-042e88199f7d67576", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "009996457667", "Fargate": "Yes" }, + "me-south-1": { "Ami": "ami-04109006cb2ed0b66", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "076674570225", "Fargate": "Yes" }, + "sa-east-1": { "Ami": "ami-095d3a8a82e8fadf6", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "507241528517", "Fargate": "Yes" }, + "us-east-1": { "Ami": "ami-0e5fb9632ceee168f", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "127311923021", "Fargate": "Yes" }, + "us-east-2": { "Ami": "ami-0dfa0bf531cde9048", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "033677994240", "Fargate": "Yes" }, + "us-west-1": { "Ami": "ami-08327d538edec6c14", "EFS": "Yes", "ThirdAvailabilityZone": "No", "ELBAccountId": "027434742980", "Fargate": "No" }, + "us-west-2": { "Ami": "ami-02b70ab564d80f9e9", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "797873946194", "Fargate": "Yes" }, "us-gov-east-1": { "Ami": "ami-04f633b669ee7b61c", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "190560391635", "Fargate": "Yes" }, "us-gov-west-1": { "Ami": "ami-90704ef1", "EFS": "Yes", "ThirdAvailabilityZone": "Yes", "ELBAccountId": "048591011584", "Fargate": "Yes" } } diff --git a/provider/aws/formation/resource/mariadb.json.tmpl b/provider/aws/formation/resource/mariadb.json.tmpl index 93078f57be..54797841ae 100644 --- a/provider/aws/formation/resource/mariadb.json.tmpl +++ b/provider/aws/formation/resource/mariadb.json.tmpl @@ -5,6 +5,11 @@ "BlankIops": { "Fn::Equals": [ { "Ref": "Iops" }, "0" ] } }, "Parameters": { + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Class": { "Type": "String", "Default": "db.t2.micro" @@ -71,6 +76,7 @@ "Properties": { "AllocatedStorage": { "Ref": "Storage" }, "AllowMajorVersionUpgrade": "true", + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "DBInstanceClass": { "Ref": "Class" }, "DBInstanceIdentifier": { "Ref": "AWS::StackName" }, "DBName": "app", diff --git a/provider/aws/formation/resource/memcached.json.tmpl b/provider/aws/formation/resource/memcached.json.tmpl index 216a88e1db..81c1eec8d5 100644 --- a/provider/aws/formation/resource/memcached.json.tmpl +++ b/provider/aws/formation/resource/memcached.json.tmpl @@ -1,6 +1,11 @@ { "AWSTemplateFormatVersion" : "2010-09-09", "Parameters": { + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Class": { "Type": "String", "Default": "cache.t2.micro" @@ -50,7 +55,7 @@ "CacheCluster": { "Type": "AWS::ElastiCache::CacheCluster", "Properties": { - "AutoMinorVersionUpgrade": true, + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "CacheNodeType": { "Ref": "Class" }, "CacheSubnetGroupName": { "Ref": "SubnetGroup" }, "Engine": "memcached", diff --git a/provider/aws/formation/resource/mysql.json.tmpl b/provider/aws/formation/resource/mysql.json.tmpl index a2adeba018..c123e692bb 100644 --- a/provider/aws/formation/resource/mysql.json.tmpl +++ b/provider/aws/formation/resource/mysql.json.tmpl @@ -5,6 +5,11 @@ "BlankIops": { "Fn::Equals": [ { "Ref": "Iops" }, "0" ] } }, "Parameters": { + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Class": { "Type": "String", "Default": "db.t2.micro" @@ -71,6 +76,7 @@ "Properties": { "AllocatedStorage": { "Ref": "Storage" }, "AllowMajorVersionUpgrade": "true", + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "DBInstanceClass": { "Ref": "Class" }, "DBInstanceIdentifier": { "Ref": "AWS::StackName" }, "DBName": "app", diff --git a/provider/aws/formation/resource/postgres.json.tmpl b/provider/aws/formation/resource/postgres.json.tmpl index c356ace365..727314d925 100644 --- a/provider/aws/formation/resource/postgres.json.tmpl +++ b/provider/aws/formation/resource/postgres.json.tmpl @@ -6,6 +6,11 @@ "Version9": { "Fn::Equals": [ { "Fn::Select": [ 0, { "Fn::Split": [ ".", { "Ref": "Version" } ] } ] }, "9" ] } }, "Parameters": { + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Class": { "Type": "String", "Default": "db.t2.micro" @@ -72,6 +77,7 @@ "Properties": { "AllocatedStorage": { "Ref": "Storage" }, "AllowMajorVersionUpgrade": "true", + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "DBInstanceClass": { "Ref": "Class" }, "DBInstanceIdentifier": { "Ref": "AWS::StackName" }, "DBName": "app", diff --git a/provider/aws/formation/resource/redis.json.tmpl b/provider/aws/formation/resource/redis.json.tmpl index def84d08bc..e0a6625eae 100644 --- a/provider/aws/formation/resource/redis.json.tmpl +++ b/provider/aws/formation/resource/redis.json.tmpl @@ -4,6 +4,11 @@ "Encrypted": { "Fn::Equals": [{ "Ref": "Encrypted" }, "true"] } }, "Parameters": { + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Class": { "Type": "String", "Default": "cache.t2.micro" @@ -86,7 +91,7 @@ ] }, "AutomaticFailoverEnabled": { "Ref": "Durable" }, - "AutoMinorVersionUpgrade": "true", + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "CacheNodeType": { "Ref": "Class" }, "CacheSubnetGroupName": { "Ref": "SubnetGroup" }, "Engine": "redis", diff --git a/provider/aws/templates/resource/mysql.tmpl b/provider/aws/templates/resource/mysql.tmpl index 5a05d4b059..9746d5f1be 100644 --- a/provider/aws/templates/resource/mysql.tmpl +++ b/provider/aws/templates/resource/mysql.tmpl @@ -12,6 +12,11 @@ "Default" : "10", "Description" : "Allocated storage size (GB)" }, + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Database": { "Type" : "String", "Default" : "app", @@ -110,9 +115,10 @@ "KmsKeyId": { "Fn::If": [ "Encrypted", { "Ref": "EncryptionKey" }, { "Ref": "AWS::NoValue" } ] }, "StorageEncrypted": { "Ref": "Encrypted" }, "AllocatedStorage": { "Ref": "AllocatedStorage" }, + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "DBInstanceClass": { "Ref": "InstanceType" }, "DBInstanceIdentifier": { "Ref": "AWS::StackName" }, - "DBName": { "Ref": "Database" }, + "DBName": { "Fn::If": [ "BlankDatabaseSnapshotIdentifier", { "Ref": "Database" }, { "Ref": "AWS::NoValue" } ] }, "DBSnapshotIdentifier": { "Fn::If": [ "BlankDatabaseSnapshotIdentifier", { "Ref": "AWS::NoValue" }, { "Ref": "DatabaseSnapshotIdentifier" } ] }, "DBSubnetGroupName": { "Ref": "SubnetGroup" }, "Engine": "mysql", diff --git a/provider/aws/templates/resource/postgres.tmpl b/provider/aws/templates/resource/postgres.tmpl index 18d4bb7772..1f0c4dfbe5 100644 --- a/provider/aws/templates/resource/postgres.tmpl +++ b/provider/aws/templates/resource/postgres.tmpl @@ -13,6 +13,11 @@ "Default": "10", "Description": "Allocated storage size (GB)" }, + "AutoMinorVersionUpgrade": { + "Type" : "String", + "Default": "true", + "AllowedValues" : [ "true", "false" ] + }, "Database": { "Type": "String", "Default": "app", @@ -124,6 +129,7 @@ "Type": "AWS::RDS::DBInstance", "Properties": { "AllocatedStorage": { "Ref": "AllocatedStorage" }, + "AutoMinorVersionUpgrade": { "Ref": "AutoMinorVersionUpgrade" }, "DBInstanceClass": { "Ref": "InstanceType" }, "DBInstanceIdentifier": { "Ref": "AWS::StackName" }, "DBName": { "Fn::If": [ "BlankDatabaseSnapshotIdentifier", { "Ref": "Database" }, { "Ref": "AWS::NoValue" } ] },