Skip to content

Commit

Permalink
Merge pull request #1 from mbevc1/20241010_reset_warning
Browse files Browse the repository at this point in the history
feat: Confirm before resetting LZ
  • Loading branch information
mbevc1 authored Oct 10, 2024
2 parents b2cc531 + f9be8c0 commit 63249d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/lz/landingzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ func formatPath(path []string) string {
}

func ResetLandingZone(ctx context.Context, cfg aws.Config) {
var lzArn string
// CT client
ct := controltower.NewFromConfig(cfg)

Expand All @@ -258,7 +259,14 @@ func ResetLandingZone(ctx context.Context, cfg aws.Config) {
log.Fatalf("failed to list landing zones, %v", e)
}

lzArn := ""
// Check for confirmation
color.HiYellow("**WARNING**")
c := util.AskForConfirmation(fmt.Sprintf("Are you sure you want to reset your LZ?"))

if !c {
return
}

if len(res.LandingZones) > 0 {
lzArn = aws.ToString(res.LandingZones[0].Arn)
fmt.Printf("Found Landing Zone with ARN: %s\n", lzArn)
Expand Down

0 comments on commit 63249d3

Please sign in to comment.