awsgeneric

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsCredentialsAccount = "account"
	AwsCredentialsSession = "session"

	AWSServiceCodeEKS = "eks"
	AWSServiceCodeELB = "elasticloadbalancing"

	// Codes used to identify service quota for AWS resources
	AWSServiceQuotaClusters             = "L-1194D53C"
	AWSServiceQuotaNodeGroupsPerCluster = "L-6D54EA21"
	AWSServiceQuotaNodesPerNodeGroup    = "L-BD136A63"
	AWSServiceQuotaNetworkLBPerRegion   = "L-69A177A2"
)
View Source
const (
	AWS_ACCESS_KEY_ID     = "AWS_ACCESS_KEY_ID"
	AWS_SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY"
	AWS_TOTP_SECRET_KEY   = "aws_totp_secret_key"
)
View Source
const ArnAccountIdIdx = 4
View Source
const AwsSessionTokenRefreshInterval = 12 * time.Hour
View Source
const SessionTokenDurationSecs = 60 * 60 * 24 // 24 hours
View Source
const TotpTokenName = "code"

Variables

View Source
var AWSProps = map[string]*edgeproto.PropertyInfo{
	"AWS_REGION": {
		Name:        "AWS Region",
		Description: "AWS Region",
		Mandatory:   true,
	},

	"FLAVOR_MATCH_PATTERN": &edgeproto.PropertyInfo{
		Name:        "Flavor Match Pattern",
		Description: "Flavors matching this pattern will be used by Cloudlet to bringup VMs",
		Value:       "^[acdhimrtz]\\d+",
	},

	"MEX_ROUTER": {
		Name:        "External Router Type",
		Description: "AWS Router must be " + vmlayer.NoConfigExternalRouter,
		Value:       vmlayer.NoConfigExternalRouter,
	},
	"AWS_OUTPOST_VPC": {
		Name:        "AWS Outpost VPC",
		Description: "Pre-existing VPC for an outpost deployment",
	},
	"AWS_AMI_IAM_OWNER": {
		Name:        "AWS Outpost AMI Owner",
		Description: "IAM Account that owns the base image",
	},
	"AWS_OUTPOST_FLAVORS": {
		Name:        "AWS Outpost Flavors",
		Description: "AWS Outpost Flavors in format flavor1,vcpu,ram,disk;flavor2.. e.g. c5.large,2,4096,40;c5.xlarge,4,8192,40",
	},
	"AWS_USER_ARN": {
		Name:        "AWS User ARN (Amazon Resource Name)",
		Description: "AWS User ARN (Amazon Resource Name)",
	},
}
View Source
var AccessVarProps = map[string]*edgeproto.PropertyInfo{
	AWS_ACCESS_KEY_ID: {
		Name:      "AWS access key",
		Mandatory: true,
	},
	AWS_SECRET_ACCESS_KEY: {
		Name:      "AWS secret key associated with the access key",
		Mandatory: true,
	},
	AWS_TOTP_SECRET_KEY: {
		Name:        "AWS totp secret key",
		Description: "If MFA is enabled, this is the secret key that will be used to generate RFC 6238 TOTP codes. This is the text equivalent of the TOTP QR code for authentication apps.",
		TotpSecret:  true,
	},
}

Functions

This section is empty.

Types

type AWSCluster

type AWSCluster struct {
	Metadata AWSClusterMetadata
}

type AWSClusterMetadata

type AWSClusterMetadata struct {
	Name   string
	Region string
}

type AWSClusterNodeGroup

type AWSClusterNodeGroup struct {
	StackName       string
	Cluster         string
	Name            string
	Status          string
	MaxSize         int
	MinSize         int
	DesiredCapacity int
	InstanceType    string
}

type AWSELB

type AWSELB struct {
	LoadBalancerDescriptions []AWSELBDescription
}

type AWSELBDescription

type AWSELBDescription struct {
	LoadBalancerName     string
	DNSName              string
	Scheme               string
	ListenerDescriptions []ELBListener
}

type AWSFlavor

type AWSFlavor struct {
	Name     string
	Vcpus    uint
	MemoryMb uint
	DiskGb   uint
}

type AWSInstanceType

type AWSInstanceType []interface{}

type AWSQuotas

type AWSQuotas struct {
	Limit  float64
	Metric string
}

type AWSQuotasList

type AWSQuotasList struct {
	Quotas AWSQuotas
}

type AWSServiceQuota

type AWSServiceQuota struct {
	Adjustable bool
	Name       string
	Value      float64
	Code       string
}

type AwsCredentialsType

type AwsCredentialsType string

type AwsGenericPlatform

type AwsGenericPlatform struct {
	Properties *infracommon.InfraProperties
	// AccountAccessVars are fixed for the account credentials used to access the APIs
	AccountAccessVars map[string]string
	// SessionAccessVars must be renewed periodically via MFA
	SessionAccessVars map[string]string
}

func (*AwsGenericPlatform) GatherCloudletInfo

func (a *AwsGenericPlatform) GatherCloudletInfo(ctx context.Context, flavorMatchPattern string, info *edgeproto.CloudletInfo) error

GatherCloudletInfo gets flavor info from AWS

func (*AwsGenericPlatform) GetAWSELBs

func (a *AwsGenericPlatform) GetAWSELBs(ctx context.Context) (*AWSELB, error)

func (*AwsGenericPlatform) GetAwsAccessKeyId

func (a *AwsGenericPlatform) GetAwsAccessKeyId() string

func (*AwsGenericPlatform) GetAwsAccountAccessVars

func (a *AwsGenericPlatform) GetAwsAccountAccessVars(ctx context.Context, accessApi platform.AccessApi) error

func (*AwsGenericPlatform) GetAwsAmiIamOwner

func (a *AwsGenericPlatform) GetAwsAmiIamOwner() string

func (*AwsGenericPlatform) GetAwsFlavorMatchPattern

func (a *AwsGenericPlatform) GetAwsFlavorMatchPattern() string

func (*AwsGenericPlatform) GetAwsOutpostFlavors

func (a *AwsGenericPlatform) GetAwsOutpostFlavors() string

func (*AwsGenericPlatform) GetAwsOutpostVPC

func (a *AwsGenericPlatform) GetAwsOutpostVPC() string

func (*AwsGenericPlatform) GetAwsRegion

func (a *AwsGenericPlatform) GetAwsRegion() string

func (*AwsGenericPlatform) GetAwsSecretAccessKey

func (a *AwsGenericPlatform) GetAwsSecretAccessKey() string

func (*AwsGenericPlatform) GetAwsSessionToken

func (a *AwsGenericPlatform) GetAwsSessionToken(ctx context.Context, accessApi platform.AccessApi) error

GetAwsSessionToken gets a totp code from the vault and then gets an AWS session token

func (*AwsGenericPlatform) GetAwsSessionTokenWithCode

func (a *AwsGenericPlatform) GetAwsSessionTokenWithCode(ctx context.Context, code string) error

GetAwsSessionTokenWithCode uses the provided code to get session token details from AWS

func (*AwsGenericPlatform) GetAwsUserArn

func (a *AwsGenericPlatform) GetAwsUserArn() string

func (*AwsGenericPlatform) GetFlavorList

func (a *AwsGenericPlatform) GetFlavorList(ctx context.Context, flavorMatchPattern string) ([]*edgeproto.FlavorInfo, error)

func (*AwsGenericPlatform) GetServiceQuotas

func (a *AwsGenericPlatform) GetServiceQuotas(ctx context.Context, svcCode string) ([]AWSServiceQuota, error)

func (*AwsGenericPlatform) GetUserAccountIdFromArn

func (a *AwsGenericPlatform) GetUserAccountIdFromArn(ctx context.Context, arn string) (string, error)

func (*AwsGenericPlatform) IsAwsOutpost

func (a *AwsGenericPlatform) IsAwsOutpost() bool

func (*AwsGenericPlatform) RefreshAwsSessionToken

func (a *AwsGenericPlatform) RefreshAwsSessionToken(pfconfig *pf.PlatformConfig)

RefreshAwsSessionToken periodically gets a new session token

func (*AwsGenericPlatform) TimedAwsCommand

func (a *AwsGenericPlatform) TimedAwsCommand(ctx context.Context, credType AwsCredentialsType, name string, p ...string) ([]byte, error)

type AwsSessionCredentials

type AwsSessionCredentials struct {
	AccessKeyId     string
	SecretAccessKey string
	SessionToken    string
	Expiration      string
}

type AwsSessionData

type AwsSessionData struct {
	Credentials AwsSessionCredentials
}

type ELBListener

type ELBListener struct {
	Protocol         string
	LoadBalancerPort int
	InstanceProtocol string
	InstancePort     int
}

Jump to

Keyboard shortcuts

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