aws

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 42 Imported by: 4

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

View Source
const (
	CloudProvider          = "aws"
	GithubHost             = "github.com"
	GitlabHost             = "gitlab.com"
	KubectlClientVersion   = "v1.25.7"
	LocalhostOS            = runtime.GOOS
	LocalhostArch          = runtime.GOARCH
	TerraformClientVersion = "1.3.8"
	ArgocdHelmChartVersion = "4.10.5"

	ArgocdPortForwardURL = pkg.ArgocdPortForwardURL
	VaultPortForwardURL  = pkg.VaultPortForwardURL
)

Variables

This section is empty.

Functions

func AdjustGitopsRepo

func AdjustGitopsRepo(cloudProvider, clusterName, clusterType, gitopsRepoDir, gitProvider, k1Dir string) error

func AdjustMetaphorRepo

func AdjustMetaphorRepo(destinationMetaphorRepoGitURL, gitopsRepoDir, gitProvider, k1Dir string) error

func DetokenizeGitGitops

func DetokenizeGitGitops(path string, tokens *GitOpsDirectoryValues) error

detokenizeDirectoryRecursively - Translate tokens by values on a given path

func DetokenizeGitMetaphor

func DetokenizeGitMetaphor(path string, tokens *MetaphorTokenValues) error

detokenizeGithubMetaphor - Translate tokens by values on a given path

func DownloadTools

func DownloadTools(awsConfig *AwsConfig, kubectlClientVersion string, terraformClientVersion string) error

func NewAwsV2

func NewAwsV2(region string) aws.Config

func NewAwsV3 added in v0.1.13

func NewAwsV3(region string, accessKeyID string, secretAccessKey string, sessionToken string) aws.Config

func NewClientset

func NewClientset(cluster *eks.Cluster) (*kubernetes.Clientset, error)

func NewRestConfig

func NewRestConfig(cluster *eks.Cluster) (*rest.Config, error)

func PrepareGitRepositories

func PrepareGitRepositories(
	gitProvider string,
	clusterName string,
	clusterType string,
	destinationGitopsRepoGitURL string,
	gitopsDir string,
	gitopsTemplateBranch string,
	gitopsTemplateURL string,
	destinationMetaphorRepoGitURL string,
	k1Dir string,
	gitopsTokens *GitOpsDirectoryValues,
	metaphorDir string,
	metaphorTokens *MetaphorTokenValues,
) error

Types

type ARecord

type ARecord struct {
	Name        string
	RecordType  string
	TTL         *int64
	AliasTarget *route53Types.AliasTarget
}

ARecord stores Route53 A record data

type AWSConfiguration

type AWSConfiguration struct {
	Config aws.Config
}

AWSConfiguration stores session data to organize all AWS functions into a single struct

func (*AWSConfiguration) CheckAvailabilityZones

func (conf *AWSConfiguration) CheckAvailabilityZones(region string) (bool, error)

CheckAvailabilityZones determines whether or not an aws region is compatible with the minimum availability zone requirement specified by consumption of aws Terraform modules

func (*AWSConfiguration) CreateBucket

func (conf *AWSConfiguration) CreateBucket(bucketName string) (*s3.CreateBucketOutput, error)

CreateBucket

func (*AWSConfiguration) DeleteEKSSecurityGroups

func (conf *AWSConfiguration) DeleteEKSSecurityGroups(region string, eksClusterName string) error

DeleteEKSSecurityGroups deletes security groups associated with an EKS cluster

func (*AWSConfiguration) DeleteElasticLoadBalancer

func (conf *AWSConfiguration) DeleteElasticLoadBalancer(elbdp ElbDeletionParameters) error

DeleteElasticLoadBalancer deletes an Elastic Load Balancer associated with an EKS cluster

func (*AWSConfiguration) DeleteSecurityGroup

func (conf *AWSConfiguration) DeleteSecurityGroup(region string, sgid string) error

DeleteSecurityGroup deletes a security group

func (*AWSConfiguration) GetCallerIdentity

func (conf *AWSConfiguration) GetCallerIdentity() (*sts.GetCallerIdentityOutput, error)

func (*AWSConfiguration) GetECRAuthToken

func (conf *AWSConfiguration) GetECRAuthToken() (string, error)

func (*AWSConfiguration) GetHostedZone added in v0.1.17

func (conf *AWSConfiguration) GetHostedZone(hostedZoneID string) (*route53.GetHostedZoneOutput, error)

GetHostedZone returns an object detailing a hosted zone

func (*AWSConfiguration) GetHostedZoneID

func (conf *AWSConfiguration) GetHostedZoneID(hostedZoneName string) (string, error)

GetHostedZoneID returns the ID of a hosted zone if valid

func (*AWSConfiguration) GetIamRole

func (conf *AWSConfiguration) GetIamRole(roleName string) (*iam.GetRoleOutput, error)

func (*AWSConfiguration) GetKmsKeyID

func (conf *AWSConfiguration) GetKmsKeyID(keyAlias string) (string, error)

func (*AWSConfiguration) GetLoadBalancersForDeletion

func (conf *AWSConfiguration) GetLoadBalancersForDeletion(eksClusterName string) ([]ElbDeletionParameters, error)

GetLoadBalancersForDeletion gets all load balancers and returns details for a load balancer associated with the target EKS cluster

func (*AWSConfiguration) GetServiceQuotas

func (conf *AWSConfiguration) GetServiceQuotas(services []string) (map[string][]QuotaDetailResponse, error)

GetServiceQuotas

func (*AWSConfiguration) ListBuckets

func (conf *AWSConfiguration) ListBuckets() (*s3.ListBucketsOutput, error)

func (*AWSConfiguration) ListCompatibleRegions

func (conf *AWSConfiguration) ListCompatibleRegions() ([]string, error)

ListCompatibleRegions returns aws regions that have the minimum number of availability zones required to support the kubefirst platform

func (*AWSConfiguration) ListQuotas

func (*AWSConfiguration) TestHostedZoneLiveness

func (conf *AWSConfiguration) TestHostedZoneLiveness(hostedZoneName string) bool

TestHostedZoneLiveness checks Route53 for the liveness test record

type AwsConfig

type AwsConfig struct {
	ArgoWorkflowsDir                string
	DestinationGitopsRepoHttpsURL   string
	DestinationGitopsRepoGitURL     string
	DestinationMetaphorRepoHttpsURL string
	DestinationMetaphorRepoGitURL   string
	GitopsDir                       string
	GitProvider                     string
	K1Dir                           string
	Kubeconfig                      string
	KubectlClient                   string
	KubefirstBotSSHPrivateKey       string
	KubefirstConfig                 string
	LogsDir                         string
	MetaphorDir                     string
	RegistryAppName                 string
	RegistryYaml                    string
	SSLBackupDir                    string
	TerraformClient                 string
	ToolsDir                        string
}

func GetConfig

func GetConfig(clusterName string, domainName string, gitProvider string, gitOwner string) *AwsConfig

todo move shared values to pkg. or break into common shared configs across git GetConfig - load default values from kubefirst installer

type ElbDeletionParameters

type ElbDeletionParameters struct {
	ElbName                 string
	ElbSourceSecurityGroups []string
}

ElbDeletionParameters describes an Elastic Load Balancer name and source security group to delete

type ElbTags

type ElbTags struct {
	Key   string
	Value string
}

ElbTags describes a pair of tags assigned to an Elastic Load Balancer

type GitOpsDirectoryValues

type GitOpsDirectoryValues struct {
	AlertsEmail               string
	AtlantisAllowList         string
	CloudProvider             string
	CloudRegion               string
	ClusterId                 string
	ClusterName               string
	ClusterType               string
	DomainName                string
	Kubeconfig                string
	KubefirstArtifactsBucket  string
	KubefirstStateStoreBucket string
	KubefirstTeam             string
	KubefirstVersion          string

	ArgoCDIngressURL               string
	ArgoCDIngressNoHTTPSURL        string
	ArgoWorkflowsIngressURL        string
	ArgoWorkflowsIngressNoHTTPSURL string
	AtlantisIngressURL             string
	AtlantisIngressNoHTTPSURL      string
	ChartMuseumIngressURL          string
	VaultIngressURL                string
	VaultIngressNoHTTPSURL         string
	VouchIngressURL                string

	AtlantisWebhookURL   string
	AwsIamArnAccountRoot string
	AwsKmsKeyId          string
	AwsNodeCapacityType  string
	AwsAccountID         string

	GitDescription       string
	GitNamespace         string
	GitProvider          string
	GitRunner            string
	GitRunnerDescription string
	GitRunnerNS          string
	GitURL               string

	GitHubHost  string
	GitHubOwner string
	GitHubUser  string

	GitlabHost         string
	GitlabOwner        string
	GitlabOwnerGroupID int
	GitlabUser         string

	GitOpsRepoAtlantisWebhookURL string
	GitOpsRepoGitURL             string
	GitOpsRepoNoHTTPSURL         string

	ContainerRegistryURL string
	UseTelemetry         string
}

todo standardize on field names

type MetaphorTokenValues

type MetaphorTokenValues struct {
	ClusterName                   string
	CloudRegion                   string
	ContainerRegistryURL          string
	DomainName                    string
	MetaphorDevelopmentIngressURL string
	MetaphorStagingIngressURL     string
	MetaphorProductionIngressURL  string
}

type QuotaDetailResponse

type QuotaDetailResponse struct {
	QuotaName  string
	QuotaValue float64
}

type TXTRecord

type TXTRecord struct {
	Name          string
	Value         string
	SetIdentifier *string
	Weight        *int64
	TTL           int64
}

TXTRecord stores Route53 TXT record data

Jump to

Keyboard shortcuts

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