Documentation ¶
Index ¶
- Constants
- func AwsCABundlesFile() (filePath string, err error)
- func AwsCredentialsFile() (filePath string, err error)
- func EncodeFileFromEnv(envKey string) (string, error)
- func LoadConfig(ctx context.Context, opts ...AwsConfigOpt) (aws.Config, error)
- func NewEC2Client(config aws.Config) *ec2.Client
- func NewSnowballClient(config aws.Config) *snowballdevice.Client
- func ParseDeviceIPs(r io.Reader) ([]string, error)
- func ParseDeviceIPsFromFile(filePath string) ([]string, error)
- func SnowEndpointResolver(deviceIP string) aws.EndpointResolverWithOptionsFunc
- type AwsConfigOpt
- type Client
- func (c *Client) EC2ImageExists(ctx context.Context, imageID string) (bool, error)
- func (c *Client) EC2ImportKeyPair(ctx context.Context, keyName string, keyMaterial []byte) error
- func (c *Client) EC2KeyNameExists(ctx context.Context, keyName string) (bool, error)
- func (c *Client) IsSnowballDeviceUnlocked(ctx context.Context) (bool, error)
- func (c *Client) SnowballDeviceSoftwareVersion(ctx context.Context) (string, error)
- type Clients
- type EC2Client
- type ServiceEndpoint
- type SnowballDeviceClient
Constants ¶
const ( EksaAwsCredentialsFileKey = "EKSA_AWS_CREDENTIALS_FILE" EksaAwsCABundlesFileKey = "EKSA_AWS_CA_BUNDLES_FILE" )
Variables ¶
This section is empty.
Functions ¶
func AwsCABundlesFile ¶
func AwsCredentialsFile ¶
func EncodeFileFromEnv ¶
func LoadConfig ¶
LoadConfig reads the optional aws configurations, and populates an AWS Config with the values from the configurations.
func NewSnowballClient ¶ added in v0.12.0
func NewSnowballClient(config aws.Config) *snowballdevice.Client
func ParseDeviceIPsFromFile ¶
func SnowEndpointResolver ¶
func SnowEndpointResolver(deviceIP string) aws.EndpointResolverWithOptionsFunc
Types ¶
type AwsConfigOpt ¶
type AwsConfigOpt = config.LoadOptionsFunc
func AwsConfigOptSet ¶
func AwsConfigOptSet(opts ...AwsConfigOpt) AwsConfigOpt
func WithCustomCABundleFile ¶
func WithCustomCABundleFile(certsFile string) AwsConfigOpt
WithCustomCABundleFile is a helper function to construct functional options that reads an aws certificates file and sets CustomCABundle on config's LoadOptions.
func WithSnowEndpointAccess ¶
func WithSnowEndpointAccess(deviceIP string, certsFile, credsFile string) AwsConfigOpt
WithSnowEndpointAccess gathers all the config's LoadOptions for snow, which includes snowball ec2 endpoint, snow credentials for a specific profile, and CA bundles for accessing the https endpoint.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the single API client to make operations call to aws services
func NewClientFromEC2 ¶
NewClientFromEC2 is mainly used for EC2 related unit tests
func NewClientFromSnowball ¶ added in v0.12.0
func NewClientFromSnowball(snowballdevice SnowballDeviceClient) *Client
NewClientFromSnowball is mainly used for Snowballdevice related unit tests
func (*Client) EC2ImageExists ¶
EC2ImageExists calls aws sdk ec2.DescribeImages with filter imageID to fetch a specified images (AMIs, AKIs, and ARIs) available. Returns (false, nil) if the image does not exist, (true, nil) if image exists, and (false, err) if there is an non 400 status code error from ec2.DescribeImages.
func (*Client) EC2ImportKeyPair ¶
EC2ImportKeyPair calls aws sdk ec2.ImportKeyPair to import a key pair to ec2.
func (*Client) EC2KeyNameExists ¶
EC2KeyNameExists calls aws sdk ec2.DescribeKeyPairs with filter keyName to fetch a specified key pair available in aws. Returns (false, nil) if the key pair does not exist, (true, nil) if key pair exists, and (false, err) if there is an error from ec2.DescribeKeyPairs.
func (*Client) IsSnowballDeviceUnlocked ¶ added in v0.12.0
type EC2Client ¶
type EC2Client interface { DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) DescribeKeyPairs(ctx context.Context, params *ec2.DescribeKeyPairsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeKeyPairsOutput, error) ImportKeyPair(ctx context.Context, params *ec2.ImportKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.ImportKeyPairOutput, error) }
type ServiceEndpoint ¶
type SnowballDeviceClient ¶ added in v0.12.0
type SnowballDeviceClient interface { DescribeDevice(ctx context.Context, params *snowballdevice.DescribeDeviceInput, optFns ...func(*snowballdevice.Options)) (*snowballdevice.DescribeDeviceOutput, error) DescribeDeviceSoftware(ctx context.Context, params *snowballdevice.DescribeDeviceSoftwareInput, optFns ...func(*snowballdevice.Options)) (*snowballdevice.DescribeDeviceSoftwareOutput, error) }