aws

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSection = ini.DefaultSection

DefaultSection for INI files.

View Source
const GlobalRegion = "aws-global"

GlobalRegion is the region name used for AWS services that do not have a notion of region.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool, o ...FieldOption) *bool

Bool converts the supplied bool for use with the AWS Go SDK.

func BoolValue added in v0.17.0

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func CleanError added in v0.17.0

func CleanError(err error) error

CleanError Will remove the requestID from a awserr.Error and return a new awserr. If not awserr it will return the original error

func CompactAndEscapeJSON added in v0.8.0

func CompactAndEscapeJSON(s string) (string, error)

CompactAndEscapeJSON removes space characters and URL-encodes the JSON string.

func CreateJSONPatch

func CreateJSONPatch(source, destination interface{}) ([]byte, error)

CreateJSONPatch creates a diff JSON object that can be applied to any other JSON object.

func CredentialsIDSecret

func CredentialsIDSecret(data []byte, profile string) (aws.Credentials, error)

CredentialsIDSecret retrieves AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the data which contains aws credentials under given profile Example: [default] aws_access_key_id = <YOUR_ACCESS_KEY_ID> aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>

func DiffEC2Tags added in v0.13.0

func DiffEC2Tags(local []ec2.Tag, remote []ec2.Tag) (add []ec2.Tag, remove []ec2.Tag)

DiffEC2Tags returns []ec2.Tag that should be added or removed.

func DiffLabels added in v0.11.0

func DiffLabels(local, remote map[string]string) (addOrModify map[string]string, remove []string)

DiffLabels returns labels that should be added, modified, or removed.

func DiffTags added in v0.11.0

func DiffTags(local, remote map[string]string) (add map[string]string, remove []string)

DiffTags returns tags that should be added or removed.

func GetConfig added in v0.12.0

func GetConfig(ctx context.Context, c client.Client, mg resource.Managed, region string) (*aws.Config, error)

GetConfig constructs an *aws.Config that can be used to authenticate to AWS API by the AWS clients.

func GetConfigV1 added in v0.15.0

func GetConfigV1(ctx context.Context, c client.Client, mg resource.Managed, region string) (*session.Session, error)

GetConfigV1 constructs an *awsv1.Config that can be used to authenticate to AWS API by the AWSv1 clients.

func Int64

func Int64(v int, o ...FieldOption) *int64

Int64 converts the supplied int for use with the AWS Go SDK.

func Int64Address

func Int64Address(i *int) *int64

Int64Address returns the given *int in the form of *int64.

func Int64Value added in v0.12.0

func Int64Value(v *int64) int64

Int64Value converts the supplied int64 pointer to a int64, returning 0 if the pointer is nil.

func IntAddress

func IntAddress(i *int64) *int

IntAddress converts the supplied int64 pointer to an int pointer, returning nil if the pointer is nil.

func LateInitializeBoolPtr

func LateInitializeBoolPtr(in *bool, from *bool) *bool

LateInitializeBoolPtr returns in if it's non-nil, otherwise returns from which is the backup for the cases in is nil.

func LateInitializeInt64 added in v0.18.0

func LateInitializeInt64(in int64, from int64) int64

LateInitializeInt64 returns in if it's non-zero, otherwise returns from which is the backup for the cases in is zero.

func LateInitializeInt64Ptr added in v0.8.0

func LateInitializeInt64Ptr(in *int64, from *int64) *int64

LateInitializeInt64Ptr returns in if it's non-nil, otherwise returns from which is the backup for the cases in is nil.

func LateInitializeIntPtr

func LateInitializeIntPtr(in *int, from *int64) *int

LateInitializeIntPtr returns in if it's non-nil, otherwise returns from which is the backup for the cases in is nil.

func LateInitializeString

func LateInitializeString(in string, from *string) string

LateInitializeString returns `from` if `in` is empty and `from` is non-nil, in other cases it returns `in`.

func LateInitializeStringPtr

func LateInitializeStringPtr(in *string, from *string) *string

LateInitializeStringPtr returns in if it's non-nil, otherwise returns from which is the backup for the cases in is nil.

func LateInitializeTimePtr added in v0.18.0

func LateInitializeTimePtr(in *metav1.Time, from *time.Time) *metav1.Time

LateInitializeTimePtr returns in if it's non-nil, otherwise returns from which is the backup for the cases in is nil.

func SetResolver added in v0.16.0

func SetResolver(ctx context.Context, mg resource.Managed, cfg *aws.Config) *aws.Config

SetResolver parses annotations from the managed resource and returns a configuration accordingly.

func SetResolverV1 added in v0.16.0

func SetResolverV1(ctx context.Context, mg resource.Managed, cfg *awsv1.Config) *awsv1.Config

SetResolverV1 parses annotations from the managed resource and returns a V1 configuration accordingly.

func String

func String(v string, o ...FieldOption) *string

String converts the supplied string for use with the AWS Go SDK.

func StringValue

func StringValue(v *string) string

StringValue converts the supplied string pointer to a string, returning the empty string if the pointer is nil. TODO(muvaf): is this really meaningful? why not implement it?

func UsePodServiceAccount

func UsePodServiceAccount(ctx context.Context, _ []byte, _, region string) (*aws.Config, error)

UsePodServiceAccount assumes an IAM role configured via a ServiceAccount. https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html

TODO(hasheddan): This should be replaced by the implementation of the Web Identity Token Provider in the following PR after merge and subsequent release of AWS SDK: https://github.com/aws/aws-sdk-go-v2/pull/488

func UsePodServiceAccountV1 added in v0.15.0

func UsePodServiceAccountV1(ctx context.Context, _ []byte, mg resource.Managed, _, region string) (*awsv1.Config, error)

UsePodServiceAccountV1 assumes an IAM role configured via a ServiceAccount. https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html

func UseProvider added in v0.12.0

func UseProvider(ctx context.Context, c client.Client, mg resource.Managed, region string) (*aws.Config, error)

UseProvider to produce a config that can be used to authenticate to AWS. Deprecated: Use UseProviderConfig.

func UseProviderConfig added in v0.12.0

func UseProviderConfig(ctx context.Context, c client.Client, mg resource.Managed, region string) (*aws.Config, error)

UseProviderConfig to produce a config that can be used to authenticate to AWS.

func UseProviderSecret

func UseProviderSecret(_ context.Context, data []byte, profile, region string) (*aws.Config, error)

UseProviderSecret - AWS configuration which can be used to issue requests against AWS API

func UseProviderSecretV1 added in v0.15.0

func UseProviderSecretV1(ctx context.Context, data []byte, mg resource.Managed, profile, region string) (*awsv1.Config, error)

UseProviderSecretV1 retrieves AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the data which contains aws credentials under given profile and produces a *awsv1.Config Example: [default] aws_access_key_id = <YOUR_ACCESS_KEY_ID> aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>

func Wrap added in v0.17.0

func Wrap(err error, msg string) error

Wrap Attempts to remove requestID from awserr before calling Wrap

Types

type AuthMethod

type AuthMethod func(context.Context, []byte, string, string) (*aws.Config, error)

AuthMethod is a method of authenticating to the AWS API

type FieldOption

type FieldOption int

A FieldOption determines how common Go types are translated to the types required by the AWS Go SDK.

const (
	// FieldRequired causes zero values to be converted to a pointer to the zero
	// value, rather than a nil pointer. AWS Go SDK types use pointer fields,
	// with a nil pointer indicating an unset field. Our ToPtr functions return
	// a nil pointer for a zero values, unless FieldRequired is set.
	FieldRequired FieldOption = iota
)

Field options.

Jump to

Keyboard shortcuts

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