connector

package
v0.176.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 28 Imported by: 4

Documentation

Overview

Package connector Canonicalize code adopted from https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/2a9ee95fecab59fab41a0b646a63227d66113434/pkg/arn/arn.go At 2022.06.08 to break dependency on aws-iam-authenticator. At the time of adoption the code hasn't changed in over 2 years.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonicalize added in v0.104.0

func Canonicalize(arn string) (string, error)

Canonicalize validates IAM resources are appropriate for the authenticator and converts STS assumed roles into the IAM role resource.

Supported IAM resources are:

  • AWS account: arn:aws:iam::123456789012:root
  • IAM user: arn:aws:iam::123456789012:user/Bob
  • IAM role: arn:aws:iam::123456789012:role/S3Access
  • IAM Assumed role: arn:aws:sts::123456789012:assumed-role/Accounting-Role/Mary (converted to IAM role)
  • Federated user: arn:aws:sts::123456789012:federated-user/Bob

func GetManifestFilenames

func GetManifestFilenames() ([]string, error)

GetManifestFilenames gets the filenames for EKS Connector manifests

func ValidProviders

func ValidProviders() []ekstypes.ConnectorConfigProvider

ValidProviders returns a list of supported providers.

func WriteResources

func WriteResources(fs afero.Fs, manifestList *ManifestList) error

WriteResources writes the EKS Connector resources to the current directory.

Types

type EKSConnector

type EKSConnector struct {
	Provider         provider
	ManifestTemplate ManifestTemplate
}

func (*EKSConnector) DeregisterCluster

func (c *EKSConnector) DeregisterCluster(ctx context.Context, clusterName string) error

DeregisterCluster deregisters the cluster and removes associated IAM resources.

func (*EKSConnector) RegisterCluster

func (c *EKSConnector) RegisterCluster(ctx context.Context, cluster ExternalCluster) (*ManifestList, error)

RegisterCluster registers the specified external cluster with EKS and returns a list of Kubernetes resources for EKS Connector.

type ExternalCluster

type ExternalCluster struct {
	Name             string
	Provider         string
	ConnectorRoleARN string
}

type ManifestFile

type ManifestFile struct {
	Data     []byte
	Filename string
}

type ManifestList

type ManifestList struct {
	ConnectorResources     ManifestFile
	ClusterRoleResources   ManifestFile
	ConsoleAccessResources ManifestFile
	Expiry                 time.Time
	IAMIdentityARN         string
}

type ManifestTemplate

type ManifestTemplate struct {
	Connector     ManifestFile
	ClusterRole   ManifestFile
	ConsoleAccess ManifestFile
}

ManifestTemplate holds the manifest templates for EKS Connector.

func GetManifestTemplate

func GetManifestTemplate() (ManifestTemplate, error)

GetManifestTemplate returns the resources for EKS Connector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL