Documentation
¶
Index ¶
Constants ¶
const ( OldFlowSupportRole = "role/RH-Technical-Support-Access" CustomerRoleArnName = "Target-Role-Arn" OrgRoleArnName = "Org-Role-Arn" )
const EnvBrowserDefault = "BACKPLANE_DEFAULT_OPEN_BROWSER"
EnvBrowserDefault environment variable that indicates if open by browser is set as default
const MAX_SESSION_TIMEOUT_DURATION = 60 // in minutes
MAX_SESSION_TIMEOUT_DURATION maximum session duration in minutes This is limited by AWS STS maximum duration for assumed roles of 60 minutes
Variables ¶
var ( CreateClientSet func(*rest.Config) (kubernetes.Interface, error) = createClientSet GetInstanceID func(node string, config *rest.Config) (string, error) = getInstanceID StartSSMsession func(cmd *cobra.Command, argv []string) error = startSSMsession ExecCommand func(name string, arg ...string) *exec.Cmd = exec.Command NewFromConfig func(cfg aws.Config) SSMClient = NewFromConfigVar GetCurrentKubeconfig func() (*rest.Config, error) = getCurrentKubeconfig FetchCloudCredentials func() (*bpCredentials.AWSCredentialsResponse, error) = fetchCloudCredentials )
var AssumeRoleSequence = awsutil.AssumeRoleSequence
var AssumeRoleWithJWT = awsutil.AssumeRoleWithJWT
var CheckEgressIP = checkEgressIPImpl
CheckEgressIP checks the egress IP of the client This is a wrapper around checkEgressIPImpl to allow for easy mocking
var CloudCmd = &cobra.Command{ Use: "cloud", Short: "Cluster cloud provider access", Args: cobra.NoArgs, DisableAutoGenTag: true, Run: help, }
var ConsoleCmd = &cobra.Command{ Use: "console [CLUSTERID|EXTERNAL_ID|CLUSTER_NAME|CLUSTER_NAME_SEARCH]", Short: "Requests a link to cluster's cloud provider's console", Long: `Requests a link that utilizes temporary cloud credentials for the cluster's cloud provider's web console. This allows us to be able to perform operations such as debugging an issue, troubleshooting a customer misconfiguration, or directly access the underlying cloud infrastructure. If no cluster identifier is provided, the currently logged in cluster will be used.`, Example: " backplane cloud console\n backplane cloud console <id>\n backplane cloud console %test%\n backplane cloud console <external_id>", Args: cobra.RangeArgs(0, 1), Aliases: []string{"link", "web"}, RunE: runConsole, SilenceUsage: true, }
ConsoleCmd represents the cloud credentials command
var CredentialsCmd = &cobra.Command{ Use: "credentials [CLUSTERID|EXTERNAL_ID|CLUSTER_NAME|CLUSTER_NAME_SEARCH]", Short: "Requests a set of temporary cloud credentials for the cluster's cloud provider", Long: `Requests a set of temporary cloud credentials for the cluster's cloud provider. This allows us to be able to perform operations such as debugging an issue, troubleshooting a customer misconfiguration, or directly access the underlying cloud infrastructure. If no cluster identifier is provided, the currently logged in cluster will be used.`, Example: " backplane cloud credentials\n backplane cloud credentials <id>\n backplane cloud credentials %test%\n backplane cloud credentials <external_id>", Args: cobra.RangeArgs(0, 1), Aliases: []string{"creds", "cred"}, RunE: runCredentials, SilenceUsage: true, }
CredentialsCmd represents the cloud credentials command
var GetBackplaneClusterFromConfig = utils.DefaultClusterUtils.GetBackplaneClusterFromConfig
var GetBackplaneConfiguration = bpconfig.GetBackplaneConfiguration
var GetCallerIdentity = func(client *sts.Client) error { _, err := client.GetCallerIdentity(context.TODO(), &sts.GetCallerIdentityInput{}) return err }
var NewStaticCredentialsProvider = credentials.NewStaticCredentialsProvider
var SSMSessionCmd = &cobra.Command{ Use: "ssm", Short: "Start an AWS SSM session for a node", Long: "Start an AWS SSM session for the specified node provided to debug.", Args: cobra.ArbitraryArgs, RunE: func(cmd *cobra.Command, args []string) error { return startSSMsession(cmd, args) }, }
var StsClient = awsutil.StsClient
Functions ¶
This section is empty.
Types ¶
type ConsoleResponse ¶
type ConsoleResponse struct {
ConsoleLink string `json:"ConsoleLink" yaml:"ConsoleLink"`
}
func (*ConsoleResponse) String ¶
func (r *ConsoleResponse) String() string
type QueryConfig ¶ added in v0.1.20
type QueryConfig struct {
config.BackplaneConfiguration
OcmConnection *ocmsdk.Connection
Cluster *cmv1.Cluster
}
QueryConfig Wrapper for the configuration needed for cloud requests
func (*QueryConfig) GetAWSV2Config ¶ added in v0.1.20
func (cfg *QueryConfig) GetAWSV2Config() (aws.Config, error)
GetAWSV2Config allows consumers to get an aws-sdk-go-v2 Config to programmatically access the AWS API
func (*QueryConfig) GetCloudConsole ¶ added in v0.1.20
func (cfg *QueryConfig) GetCloudConsole() (*ConsoleResponse, error)
GetCloudConsole returns Cloud Credentials Response
func (*QueryConfig) GetCloudCredentials ¶ added in v0.1.20
func (cfg *QueryConfig) GetCloudCredentials() (bpCredentials.Response, error)
GetCloudCredentials returns Cloud Credentials Response
type SSMClient ¶ added in v0.1.40
type SSMClient interface {
StartSession(ctx context.Context, params *ssm.StartSessionInput, optFns ...func(*ssm.Options)) (*ssm.StartSessionOutput, error)
}
Define SSMClient interface