cli: iam destroy (#946)

This commit is contained in:
miampf 2023-02-24 11:36:41 +01:00 committed by GitHub
parent f1b331bbbd
commit 5137e9fa57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 659 additions and 9 deletions

View file

@ -42,6 +42,7 @@ func NewIAMCmd() *cobra.Command {
}
cmd.AddCommand(newIAMCreateCmd())
cmd.AddCommand(newIAMDestroyCmd())
return cmd
}
@ -563,3 +564,18 @@ func parseIDFile(serviceAccountKeyBase64 string) (map[string]string, error) {
}
return out, nil
}
// NewIAMDestroyCmd returns a new cobra.Command for the iam destroy subcommand.
func newIAMDestroyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "destroy",
Short: "Destroy an IAM configuration and delete local terraform files",
Long: "Destroy an IAM configuration and delete local terraform files.",
Args: cobra.ExactArgs(0),
RunE: runIAMDestroy,
}
cmd.Flags().BoolP("yes", "y", false, "destroy the IAM configuration without asking for confirmation")
return cmd
}