Documentation ¶
Overview ¶
Package awsutil provide common helper utilities to interact with AWS.
Index ¶
- func MakeAPILogMessage(op string, in interface{}) message.Fields
- type BaseClient
- type ClientOptions
- func (o *ClientOptions) GetConfig(ctx context.Context) (*aws.Config, error)
- func (o *ClientOptions) GetCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, error)
- func (o *ClientOptions) SetCredentialsProvider(creds aws.CredentialsProvider) *ClientOptions
- func (o *ClientOptions) SetHTTPClient(hc config.HTTPClient) *ClientOptions
- func (o *ClientOptions) SetRegion(region string) *ClientOptions
- func (o *ClientOptions) SetRetryOptions(opts utility.RetryOptions) *ClientOptions
- func (o *ClientOptions) SetRole(role string) *ClientOptions
- func (o *ClientOptions) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeAPILogMessage ¶
MakeAPILogMessage creates a message to log information about an API call.
Types ¶
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
BaseClient provides various helpers to set up and use AWS clients for various services.
func NewBaseClient ¶
func NewBaseClient(opts ClientOptions) BaseClient
NewBaseClient creates a new base AWS client from the client options.
func (*BaseClient) GetRetryOptions ¶
func (c *BaseClient) GetRetryOptions() utility.RetryOptions
GetRetryOptions returns the retry options for the client.
type ClientOptions ¶
type ClientOptions struct { // CredsProvider is a credentials provider, which may be used to either connect to // the AWS API directly, or authenticate to STS to retrieve temporary // credentials to access the API (if Role is specified). // If not specified the AWS SDK will attempt to retrieve one from its credentials chain. CredsProvider aws.CredentialsProvider // Role is the STS role that should be used to perform authorized actions. // If specified, Creds will be used to retrieve temporary credentials from // STS. Role *string // Region is the geographical region where API calls should be made. Region *string // RetryOpts sets the retry policy for API requests. RetryOpts *utility.RetryOptions // HTTPClient is the HTTP client to use to make requests. // If not specified the AWS SDK's default client will be used. HTTPClient config.HTTPClient // contains filtered or unexported fields }
ClientOptions represent AWS client options such as authentication and making requests.
func NewClientOptions ¶
func NewClientOptions() *ClientOptions
NewClientOptions returns new unconfigured client options.
func (*ClientOptions) GetConfig ¶
GetConfig gets the authenticated config to perform authorized API actions.
func (*ClientOptions) GetCredentialsProvider ¶
func (o *ClientOptions) GetCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, error)
GetCredentialsProvider retrieves the appropriate credentials provider to use for the client.
func (*ClientOptions) SetCredentialsProvider ¶
func (o *ClientOptions) SetCredentialsProvider(creds aws.CredentialsProvider) *ClientOptions
SetCredentialsProvider sets the client's credentials provider.
func (*ClientOptions) SetHTTPClient ¶
func (o *ClientOptions) SetHTTPClient(hc config.HTTPClient) *ClientOptions
SetHTTPClient sets the HTTP client to use.
func (*ClientOptions) SetRegion ¶
func (o *ClientOptions) SetRegion(region string) *ClientOptions
SetRegion sets the client's geographical region.
func (*ClientOptions) SetRetryOptions ¶
func (o *ClientOptions) SetRetryOptions(opts utility.RetryOptions) *ClientOptions
SetRetryOptions sets the client's retry options.
func (*ClientOptions) SetRole ¶
func (o *ClientOptions) SetRole(role string) *ClientOptions
SetRole sets the client's role to assume.
func (*ClientOptions) Validate ¶
func (o *ClientOptions) Validate() error
Validate sets defaults for unspecified options.