@@ -111,12 +111,12 @@ Parameters:
111111Conditions :
112112 CreateSNSTopic : !Equals [ !Ref CreateTopic, "true" ]
113113 HasKMSKey : !Not [ !Equals [ !Ref KMSKeyARN, "" ] ]
114- BucketCrossAccount : !And [
115- !Not [ !Equals [ !Ref BucketAccountId, " " ] ],
116- !Not [ !Equals [ !Ref BucketAccountId , !Ref "AWS::AccountId" ] ]
114+ DeployStackSet : !Or [
115+ !Not [ !Equals [ !Ref BucketAccountId, !Ref "AWS::AccountId " ] ],
116+ !Not [ !Equals [ !Ref TopicAccountId , !Ref "AWS::AccountId" ] ]
117117 ]
118118 BucketInTargetAccount : !Equals [ !Ref BucketAccountId, !Ref "AWS::AccountId" ]
119- # Check if KMS key is in a different account from bucket
119+
120120 NeedKMSPolicy : !And [
121121 !Not [ !Equals [ !Ref KMSKeyARN, "" ] ],
122122 !Not [ !Equals [ !Ref KMSAccountId, !Ref BucketAccountId ] ]
@@ -203,7 +203,7 @@ Resources:
203203 # StackSet for cross-account bucket access
204204 BucketAccessStackSet :
205205 Type : AWS::CloudFormation::StackSet
206- Condition : BucketCrossAccount
206+ Condition : DeployStackSet
207207 Properties :
208208 StackSetName : !Sub sysdig-secure-cloudlogs-bucket-access-${NameSuffix}
209209 Description : StackSet to configure S3 bucket and KMS permissions for Sysdig Cloud Logs integration
0 commit comments