Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to define cloudtrail name #1657

Closed
wants to merge 1 commit into from
Closed

Conversation

leijin-lw
Copy link
Contributor

Summary

How did you test this change?

Issue

@leijin-lw leijin-lw requested a review from a team as a code owner September 18, 2024 19:21
@leijin-lw leijin-lw requested review from goodmorninggoaway, PengyuanZhao and mjunglw and removed request for a team September 18, 2024 19:21
@leijin-lw leijin-lw changed the title Update aws.go Allow user to define cloudtrail name Sep 18, 2024
@@ -1050,6 +1050,9 @@ func createCloudtrail(args *GenerateAwsTfConfigurationArgs) (*hclwrite.Block, er
attributes["consolidated_trail"] = true
}
// S3 Bucket attributes
if args.CloudtrailName != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding this? Will the following if args.CloudtrailUseExistingTrail work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we want the user to define the new cloudtrail name. Existing go-sdk is using "lacework-cloudtrail" as default new cloudtrail name and we cannot change it.

There is a bug happen when user failed to delete the old "lacework-cloudtrail" and the new cloudtrail has to be a different name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the code below (line 1054) attributes["cloudtrail_name"] = args.CloudtrailName using the passed in args.CloudtrailName?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get your point. I'll remove the line. attributes["cloudtrail_name"] should not depends onargs.CloudtrailUseExistingTrail

Signed-off-by: Lei Jin <lei.jin@lacework.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants