From 2592e1901e184503c8a1faa7f1d786b14743c7b1 Mon Sep 17 00:00:00 2001 From: Igor Karpukhin Date: Thu, 29 Jun 2023 09:19:53 +0300 Subject: [PATCH] Fixed AWS KMS normalization (#1018) --- pkg/controller/atlasproject/encryption_at_rest.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/atlasproject/encryption_at_rest.go b/pkg/controller/atlasproject/encryption_at_rest.go index 5adcfcd3fa..74f7035665 100644 --- a/pkg/controller/atlasproject/encryption_at_rest.go +++ b/pkg/controller/atlasproject/encryption_at_rest.go @@ -85,6 +85,10 @@ func syncEncryptionAtRestsInAtlas(ctx *workflow.Context, projectID string, proje } func normalizeAwsKms(ctx *workflow.Context, projectID string, awsKms *mongodbatlas.AwsKms) error { + if awsKms == nil || awsKms.Enabled == nil || !*awsKms.Enabled { + return nil + } + // verify if role ID is set as AtlasObjectID matched, err := regexp.MatchString(ObjectIDRegex, awsKms.RoleID) if err != nil {