This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for enabling TMC integration using ENABLE_TMC_CLOUD_PROVIDER_PERMISSIONS=true as well as adding the generate-cloudformation-template subcommand to `management-cluster permissions aws`, which will allow users to apply CloudFormation by themselves, or convert the template into IAM policies or Terraform. Signed-off-by: Naadir Jeewa <jeewan@vmware.com>
- Loading branch information
1 parent
86aefec
commit deb083b
Showing
18 changed files
with
1,426 additions
and
113 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
cmd/cli/plugin/managementcluster/permissions_aws_generate.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2021 VMware, Inc. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var generateAWSCloudFormationTemplateCmd = &cobra.Command{ | ||
Use: "generate-cloudformation-template", | ||
Short: "Generate AWS CloudFormation Template", | ||
Long: `Generate AWS CloudFormation Template`, | ||
RunE: generateCloudFormationTemplate, | ||
} | ||
|
||
func init() { | ||
generateAWSCloudFormationTemplateCmd.Flags().StringVarP(&setAWSPermissionsOps.clusterConfigFile, "file", "f", "", "Optional, configuration file from which to read the aws credentials. Falls back to using the default AWS credentials chain if not provided.") | ||
awsPermissionsCmd.AddCommand(generateAWSCloudFormationTemplateCmd) | ||
} | ||
|
||
func generateCloudFormationTemplate(cmd *cobra.Command, args []string) error { | ||
forceUpdateTKGCompatibilityImage := false | ||
tkgctlClient, err := newTKGCtlClient(forceUpdateTKGCompatibilityImage) | ||
if err != nil { | ||
return err | ||
} | ||
template, err := tkgctlClient.GenerateAWSCloudFormationTemplate(setAWSPermissionsOps.clusterConfigFile) | ||
if err != nil { | ||
return err | ||
} | ||
fmt.Println(template) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.