Skip to content

Commit

Permalink
feat: Support bucket encryption for existing cloudtrail
Browse files Browse the repository at this point in the history
Signed-off-by: Lei Jin <[email protected]>
  • Loading branch information
leijin-lw committed Sep 5, 2024
1 parent e5ecd21 commit dc95d0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/content_library_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func TestLoadLCLNotFound(t *testing.T) {
_, err := cli.LoadLCL()
assert.Equal(
t,
"unable to load Lacework Content Library: component not installed",
"unable to load Lacework Content Library: Lacework Content Library is not installed",
err.Error(),
)
}
Expand Down
2 changes: 2 additions & 0 deletions integration/aws_generation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ func TestGenerationAwsNoninteractive(t *testing.T) {
aws.WithCloudtrailUseExistingTrail(true),
aws.WithCloudtrailName(cloudtrailName),
aws.WithExistingCloudtrailBucketArn(s3BucketArn),
aws.WithBucketEncryptionEnabled(true),
aws.WithBucketSSEKeyArn(kmsArn),
aws.WithCloudtrailUseExistingSNSTopic(true),
aws.WithExistingSnsTopicArn(snsTopicArn),
aws.WithSnsTopicEncryptionEnabled(true),
Expand Down
14 changes: 7 additions & 7 deletions lwgenerate/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1058,14 +1058,14 @@ func createCloudtrail(args *GenerateAwsTfConfigurationArgs) (*hclwrite.Block, er
if args.BucketName != "" {
attributes["bucket_name"] = args.BucketName
}
if args.BucketEncryptionEnabledSet {
if args.BucketEncryptionEnabled {
if args.BucketSseKeyArn != "" {
attributes["bucket_sse_key_arn"] = args.BucketSseKeyArn
}
} else {
attributes["bucket_encryption_enabled"] = false
}
if args.BucketEncryptionEnabledSet {
if args.BucketEncryptionEnabled {
if args.BucketSseKeyArn != "" {
attributes["bucket_sse_key_arn"] = args.BucketSseKeyArn
}
} else {
attributes["bucket_encryption_enabled"] = false
}
}
if args.S3BucketNotification {
Expand Down

0 comments on commit dc95d0a

Please sign in to comment.