amazon

package
v0.0.0-...-a80b3ab Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Index

Constants

View Source
const DynamoDBKey = "LockID"
View Source
const EOF = "==EOF"

Variables

This section is empty.

Functions

func Init

func Init(in *input.Input, provider *tarmakv1alpha1.Provider) error

Types

type AWSSGRule

type AWSSGRule struct {
	Comment     string
	Destination string
	Source      string
	Service     string

	Direction  string
	Identifier *string
	FromPort   uint16
	ToPort     uint16
	Protocol   string

	CIDRBlock       *net.IPNet
	SourceSGGroupID string
	SGID            string
}

func GenerateAWSRules

func GenerateAWSRules(role *role.Role) (awsRules []*AWSSGRule, err error)

type Amazon

type Amazon struct {
	// contains filtered or unexported fields
}

func NewFromConfig

func NewFromConfig(tarmak interfaces.Tarmak, conf *tarmakv1alpha1.Provider) (*Amazon, error)

func (*Amazon) AskEnvironmentLocation

func (a *Amazon) AskEnvironmentLocation(init interfaces.Initialize) (location string, err error)

func (*Amazon) AskInstancePoolZones

func (a *Amazon) AskInstancePoolZones(init interfaces.Initialize) (zones []string, err error)

func (*Amazon) AvailabilityZones

func (a *Amazon) AvailabilityZones() (availabiltyZones []string)

This return the availabililty zones that are used for a cluster

func (*Amazon) Cloud

func (a *Amazon) Cloud() string

func (*Amazon) DefaultImage

func (a *Amazon) DefaultImage(version string) (*tarmakv1alpha1.Image, error)

func (*Amazon) DynamoDB

func (a *Amazon) DynamoDB() (DynamoDB, error)

func (*Amazon) EC2

func (a *Amazon) EC2() (EC2, error)

func (*Amazon) EnsureRemoteResources

func (a *Amazon) EnsureRemoteResources() error

func (*Amazon) Environment

func (a *Amazon) Environment() ([]string, error)

This will return necessary environment variables

func (*Amazon) InstanceType

func (a *Amazon) InstanceType(typeIn string) (typeOut string, err error)

This methods converts and possibly validates a generic instance type to a provider specifc

func (*Amazon) KMS

func (a *Amazon) KMS() (KMS, error)

func (*Amazon) KeyName

func (a *Amazon) KeyName() string

func (*Amazon) LegacyPuppetTFName

func (a *Amazon) LegacyPuppetTFName() string

func (*Amazon) ListHosts

func (a *Amazon) ListHosts(c interfaces.Cluster) ([]interfaces.Host, error)

func (*Amazon) ListRegions

func (a *Amazon) ListRegions() (regions []string, err error)

func (*Amazon) Name

func (a *Amazon) Name() string

func (*Amazon) Parameters

func (a *Amazon) Parameters() map[string]string

This parameters should include non sensitive information to identify a provider

func (*Amazon) PublicZone

func (a *Amazon) PublicZone() string

func (*Amazon) QueryImages

func (a *Amazon) QueryImages(tags map[string]string) (images []*tarmakv1alpha1.Image, err error)

func (*Amazon) Region

func (a *Amazon) Region() string

func (*Amazon) RemoteState

func (a *Amazon) RemoteState(namespace string, clusterName string, stackName string) string

func (*Amazon) RemoteStateAvailable

func (a *Amazon) RemoteStateAvailable(bucketName string) (bool, error)

func (*Amazon) RemoteStateBucketAvailable

func (a *Amazon) RemoteStateBucketAvailable() (bool, error)

func (*Amazon) RemoteStateBucketName

func (a *Amazon) RemoteStateBucketName() string

TODO: remove me, deprecated

func (*Amazon) RemoteStateKMSName

func (a *Amazon) RemoteStateKMSName() string

func (*Amazon) RemoteStateName

func (a *Amazon) RemoteStateName() string

func (*Amazon) RemoteStateObjectKey

func (a *Amazon) RemoteStateObjectKey(namespace string, clusterName string) string

func (*Amazon) Remove

func (a *Amazon) Remove() error

func (*Amazon) Reset

func (a *Amazon) Reset()

this clears all cached state from the provider

func (*Amazon) Route53

func (a *Amazon) Route53() (Route53, error)

func (*Amazon) S3

func (a *Amazon) S3() (S3, error)

func (*Amazon) SecretsKMSName

func (a *Amazon) SecretsKMSName() string

func (*Amazon) Session

func (a *Amazon) Session() (*session.Session, error)

func (*Amazon) String

func (a *Amazon) String() string

func (*Amazon) UploadConfiguration

func (a *Amazon) UploadConfiguration(cluster interfaces.Cluster, stateFile io.ReadSeeker, md5Hash string) error

This uploads the main configuration to the S3 bucket

func (*Amazon) Validate

func (a *Amazon) Validate() error

func (*Amazon) Variables

func (a *Amazon) Variables() map[string]interface{}

func (*Amazon) VaultKV

func (a *Amazon) VaultKV() (kv.Service, error)

func (*Amazon) VaultKVWithParams

func (a *Amazon) VaultKVWithParams(kmsKeyID, unsealKeyName string) (kv.Service, error)

func (*Amazon) Verify

func (a *Amazon) Verify() error

func (*Amazon) VerifyAWSCredentials

func (a *Amazon) VerifyAWSCredentials() error

Check if AWS credentials are setup correctly. AWS GO SDK doesn't have an default check if access is successfull. We check if we can query the region without errors

func (*Amazon) VolumeType

func (a *Amazon) VolumeType(typeIn string) (typeOut string, err error)

This methods converts and possibly validates a generic volume type to a provider specifc

type EC2

type EC2 interface {
	DescribeInstances(input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
	ImportKeyPair(input *ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error)
	DescribeKeyPairs(input *ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error)
	DescribeAvailabilityZones(input *ec2.DescribeAvailabilityZonesInput) (*ec2.DescribeAvailabilityZonesOutput, error)
	DescribeRegions(input *ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error)
	DescribeReservedInstancesOfferings(input *ec2.DescribeReservedInstancesOfferingsInput) (*ec2.DescribeReservedInstancesOfferingsOutput, error)
	DescribeImages(input *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error)
}

type KMS

type KMS interface {
	CreateAlias(input *kms.CreateAliasInput) (*kms.CreateAliasOutput, error)
	CreateKey(input *kms.CreateKeyInput) (*kms.CreateKeyOutput, error)
	DescribeKey(input *kms.DescribeKeyInput) (*kms.DescribeKeyOutput, error)
}

type Route53

type Route53 interface {
	CreateHostedZone(input *route53.CreateHostedZoneInput) (*route53.CreateHostedZoneOutput, error)
	GetHostedZone(input *route53.GetHostedZoneInput) (*route53.GetHostedZoneOutput, error)
	ListHostedZonesByName(input *route53.ListHostedZonesByNameInput) (*route53.ListHostedZonesByNameOutput, error)
}

type S3

type S3 interface {
	HeadBucket(input *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
	CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
	DeleteBucket(input *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
	GetBucketVersioning(input *s3.GetBucketVersioningInput) (*s3.GetBucketVersioningOutput, error)
	GetBucketLocation(input *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)
	GetBucketEncryption(input *s3.GetBucketEncryptionInput) (*s3.GetBucketEncryptionOutput, error)
	PutBucketVersioning(input *s3.PutBucketVersioningInput) (*s3.PutBucketVersioningOutput, error)
	PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)
	PutBucketEncryption(input *s3.PutBucketEncryptionInput) (*s3.PutBucketEncryptionOutput, error)
	GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
	DeleteObject(input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
	ListObjects(input *s3.ListObjectsInput) (*s3.ListObjectsOutput, error)
	ListObjectVersions(input *s3.ListObjectVersionsInput) (*s3.ListObjectVersionsOutput, error)
	DeleteObjects(input *s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error)
}

Jump to

Keyboard shortcuts

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