diff --git a/lwgenerate/aws/aws.go b/lwgenerate/aws/aws.go index e188a7ed6..d7fa9ae20 100644 --- a/lwgenerate/aws/aws.go +++ b/lwgenerate/aws/aws.go @@ -1050,9 +1050,11 @@ func createCloudtrail(args *GenerateAwsTfConfigurationArgs) (*hclwrite.Block, er attributes["consolidated_trail"] = true } // S3 Bucket attributes + if args.CloudtrailName != "" { + attributes["cloudtrail_name"] = args.CloudtrailName + } if args.CloudtrailUseExistingTrail { attributes["use_existing_cloudtrail"] = true - attributes["cloudtrail_name"] = args.CloudtrailName attributes["bucket_arn"] = args.ExistingCloudtrailBucketArn } else { if args.BucketName != "" {