Skip to content

Commit

Permalink
RDS encryption is not supported for SQL Server Express Edition. See h…
Browse files Browse the repository at this point in the history
  • Loading branch information
brtrvn committed May 27, 2021
1 parent dcaed06 commit 64b5959
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions resources/tenant-onboarding-rds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Conditions:
Fn::Or:
- Condition: CreateDatabase
- Condition: BootstrapFile
SupportsEncryption: !Not [!Equals [!Ref RDSEngine, 'sqlserver-ex']]
Resources:
RDSSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Expand Down Expand Up @@ -127,7 +128,7 @@ Resources:
- CidrIp: 0.0.0.0/0
IpProtocol: '-1'
EncryptionKey:
# Condition: UseDatabaseEncryption
Condition: SupportsEncryption
DeletionPolicy: Retain
Type: AWS::KMS::Key
Properties:
Expand Down Expand Up @@ -217,7 +218,7 @@ Resources:
- Key: Tenant
Value: !Ref TenantId
EncryptionKeyAlias:
# Condition: UseDatabaseEncryption
Condition: SupportsEncryption
Type: AWS::KMS::Alias
Properties:
AliasName: !Sub alias/sb-${Environment}-${TenantId}
Expand Down Expand Up @@ -250,8 +251,8 @@ Resources:
# PreferredMaintenanceWindow: sat:22:30-sun:02:00
# PreferredBackupWindow: sat:22:30-sun:02:00
##
KmsKeyId: !GetAtt EncryptionKey.Arn
StorageEncrypted: True
KmsKeyId: !If [SupportsEncryption, !GetAtt EncryptionKey.Arn, !Ref 'AWS::NoValue']
StorageEncrypted: !If [SupportsEncryption, True, False]
Port: !Ref RDSPort
MasterUsername: !Ref RDSMasterUsername
MasterUserPassword:
Expand Down Expand Up @@ -294,8 +295,8 @@ Resources:
MultiAZ: false
Engine: !Ref RDSEngine
EngineVersion: !Ref RDSEngineVersion
KmsKeyId: !GetAtt EncryptionKey.Arn
StorageEncrypted: True
KmsKeyId: !If [SupportsEncryption, !GetAtt EncryptionKey.Arn, !Ref 'AWS::NoValue']
StorageEncrypted: !If [SupportsEncryption, True, False]
LicenseModel:
Fn::If:
- SqlServer
Expand Down

0 comments on commit 64b5959

Please sign in to comment.