awsconfig

package
v0.0.0-...-e2c53ed Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 3

README

Package cloudeng.io/aws/awsconfig

import cloudeng.io/aws/awsconfig

Package awsconfig provides support for obtaining configuration and associated credentials information for use with AWS.

Functions

Func AccountID
func AccountID(ctx context.Context, cfg aws.Config) (string, error)

AccountID uses the sts service to obtain the calling processes Amazon Account ID (number).

Func DebugPrintConfig
func DebugPrintConfig(ctx context.Context, out io.Writer, cfg aws.Config) error

DebugPrintConfig dumps the aws.Config to help with debugging configuration issues. It displays the types of the fields that can't be directly printed.

Func Load
func Load(ctx context.Context, opts ...ConfigOption) (aws.Config, error)

Load attempts to load configuration information from multiple sources, including the current process' environment, shared configuration files (by default $HOME/.aws) and also from ec2 instance metadata (currently for the AWS region).

Func LoadUsingFlags
func LoadUsingFlags(ctx context.Context, cl AWSFlags) (aws.Config, error)

LoadUsingFlags calls awsconfig.Load with options controlled by the the specified flags.

Types

Type AWSFlags
type AWSFlags struct {
	AWS            bool   `subcmd:"aws,false,set to enable AWS functionality" yaml:"aws"`
	AWSProfile     string `subcmd:"aws-profile,,aws profile to use for config/authentication" yaml:"aws_profile"`
	AWSRegion      string `subcmd:"aws-region,,'aws region to use for API calls, overrides the region set in the profile'" yaml:"aws_region"`
	AWSConfigFiles string `subcmd:"aws-config-files,,comma separated list of config files to use in place of those commonly found in $HOME/.aws" yaml:"aws_config_files,flow"`
}

AWSFlags defines commonly used flags that control AWS behaviour.

Type ConfigOption
type ConfigOption func(o *options)

ConfigOption represents an option to Load.

Functions
func ConfigOptionsFromFlags(cl AWSFlags) []ConfigOption

ConfigOptionsFromFlags returns the ConfigOptions implied by the flags. NOTE: it always includes config.WithEC2IMDSRegion so that the region information is retrieved from EC2 IMDS when it's not found by other means.

func WithConfigOptions(fn ...func(*config.LoadOptions) error) ConfigOption

WithConfigOptions will pass the supplied options from the aws config package.

Documentation

Overview

Package awsconfig provides support for obtaining configuration and associated credentials information for use with AWS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountID

func AccountID(ctx context.Context, cfg aws.Config) (string, error)

AccountID uses the sts service to obtain the calling processes Amazon Account ID (number).

func DebugPrintConfig

func DebugPrintConfig(ctx context.Context, out io.Writer, cfg aws.Config) error

DebugPrintConfig dumps the aws.Config to help with debugging configuration issues. It displays the types of the fields that can't be directly printed.

func Load

func Load(ctx context.Context, opts ...ConfigOption) (aws.Config, error)

Load attempts to load configuration information from multiple sources, including the current process' environment, shared configuration files (by default $HOME/.aws) and also from ec2 instance metadata (currently for the AWS region).

func LoadUsingFlags

func LoadUsingFlags(ctx context.Context, cl AWSFlags) (aws.Config, error)

LoadUsingFlags calls awsconfig.Load with options controlled by the the specified flags.

Types

type AWSFlags

type AWSFlags struct {
	AWS            bool   `subcmd:"aws,false,set to enable AWS functionality" yaml:"aws" cmd:"set to true enable AWS functionality"`
	AWSProfile     string `` /* 136-byte string literal not displayed */
	AWSRegion      string `` /* 178-byte string literal not displayed */
	AWSConfigFiles string `` /* 243-byte string literal not displayed */
}

AWSFlags defines commonly used flags that control AWS behaviour.

type ConfigOption

type ConfigOption func(o *options)

ConfigOption represents an option to Load.

func ConfigOptionsFromFlags

func ConfigOptionsFromFlags(cl AWSFlags) []ConfigOption

ConfigOptionsFromFlags returns the ConfigOptions implied by the flags. NOTE: it always includes config.WithEC2IMDSRegion so that the region information is retrieved from EC2 IMDS when it's not found by other means.

func WithConfigOptions

func WithConfigOptions(fn ...func(*config.LoadOptions) error) ConfigOption

WithConfigOptions will pass the supplied options from the aws config package.

Jump to

Keyboard shortcuts

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