aws

package
v0.0.0-...-8b292c0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 6 Imported by: 3

README

AWS Library

Documentation

Overview

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

Index

Constants

View Source
const (
	// InvalidStorageClassTypeErrorCode is an error code that represents an
	// unsupported or invalid StorageClassType was used
	InvalidStorageClassTypeErrorCode = 11000
)
View Source
const (
	// LISTKEYS represents the operation to get the list of keys from a bucket
	LISTKEYS = iota
)

Variables

View Source
var (
	// ErrInvalidS3Operation is used when an invalid AWSS3Operation has been used
	ErrInvalidS3Operation = fmt.Errorf("%d: invalid S3Operation", 3001)
)
View Source
var (
	// ErrInvalidStorageClassType is used when an invalid Storage Class Type has
	// been used
	ErrInvalidStorageClassType = fmt.Errorf("error: %d - invalid storage class type",
		InvalidStorageClassTypeErrorCode)
)

Functions

This section is empty.

Types

type ConnectConfig

type ConnectConfig struct {
	Keys           ConnectConfigKeys `json:"connectkeys" yaml:"connectkeys"`
	Profile        string            `json:"profile" yaml:"profile"`
	Region         string            `json:"region" yaml:"region" env:"AWS_DEFAULT_REGION"`
	Endpoint       string            `json:"endpoint" yaml:"endpoint"`
	S3UsePathStyle bool              `json:"s3usepathstyle" yaml:"s3usepathstyle"`
	EmptyCreds     bool              `json:"emptycreds" yaml:"emptycreds"`
}

ConnectConfig represents the object used to create AWS Config objects used to create service client connections

func (ConnectConfig) GenerateAWSConfig

func (conn ConnectConfig) GenerateAWSConfig() aws.Config

GenerateAWSConfig uses the current values set in the connect object to create and return an AWS Config object

type ConnectConfigKeys

type ConnectConfigKeys struct {
	AccessKeyID     string `json:"accesskey" yaml:"accesskey" env:"AWS_ACCESS_KEY_ID"`
	SecretAccessKey string `json:"secretaccesskey" yaml:"secretaccesskey" env:"AWS_SECRET_ACCESS_KEY"`
	Token           string `json:"awstoken" yaml:"awstoken" env:"AWS_ACCESS_TOKEN"`
}

ConnectConfigKeys holds the public and secret keys used to create an AWS session

func GetConnectConfigKeysFromString

func GetConnectConfigKeysFromString(credentials string) ConnectConfigKeys

GetConnectConfigKeysFromString takes a formatted string and converts the string to a ConnectConfigKeys

type CustomEndpointResolver

type CustomEndpointResolver struct {
	AlternativeEndpoint string
}

CustomEndpointResolver provides a simple mechanism to set a different endpoint for connecting to AWS locally, through a proxy, or simply connecting to a Localstack instance

func (CustomEndpointResolver) ResolveEndpoint

func (resolver CustomEndpointResolver) ResolveEndpoint(service, region string) (aws.Endpoint, error)

ResolveEndpoint is a requirement to staisfy the EndpointResolver interface and returns AWS Endpoint for the service call to connect to

type LambdaContext

type LambdaContext struct {
	FunctionName       string `json:"functionName"`
	FunctionVersion    string `json:"functionVersion"`
	InvokedFunctionARN string `json:"invokedFunctionArn"`
	MemoryLimitInMB    string `json:"memoryLimitInMB"`
	AWSRequestID       string `json:"awsRequestId"`
	LogGroupName       string `json:"logGroupName"`
	LogStreamName      string `json:"logStreamName"`
	InvokeID           string `json:"invokeid"`
}

LambdaContext is the object representation of an AWS LmabdaContext object passed to a function handler during execution

type S3Operation

type S3Operation int

S3Operation is the operation Enum that defines the different operations that can be can be executed against the service

func S3OperationFromString

func S3OperationFromString(operation string) (resource S3Operation, err error)

S3OperationFromString converts a string to the appropriate AWSS3Operation value otherwise an error is returned

func (S3Operation) String

func (operation S3Operation) String() string

String takes the the current AWSS3Operation enum and returns the string representation

type S3StorageClassType

type S3StorageClassType int

S3StorageClassType represents an Enum type for the different types of supported S3 Storage classes

const (
	// STANDARD type represents the standard S3 storage class
	STANDARD S3StorageClassType = iota
	// REDUCEDREDUNDANCY represents the S3 storage class that is for non-critical
	// and reproducible data. Durability of this class is 99.99% relative to
	// 99.999999999% with the other storage classes
	REDUCEDREDUNDANCY
	// STANDARDIA represents the S3 storage class that has the same availability
	// performance as the STANDARD storage class but is priced for less frequently
	// accessed data
	STANDARDIA
	// ONEZONEIA represents the S3 storage class that has the same availability
	// performance as the STANDARD storage class but is priced for less frequently
	// accessed data and exists in only one availability zone
	ONEZONEIA
	// INTELLIGENTTIERING represents the S3 storage class that optimizes the
	// different tiers for the object storage to better optimize cost
	INTELLIGENTTIERING
	// GLACIER represents the S3 storage class that is "frozen" storage and is
	// treated as archive data that has specific access restrictions based on need
	// of availability
	GLACIER
	// DEEPARCHIVE represents the S3 storage class that is "frozen" storage and is
	// treated as archive data that has specific access restrictions based on need
	// of availability and is only access 1 or twice a year
	DEEPARCHIVE
)

func StorageClassTypeFromString

func StorageClassTypeFromString(storageClassType string) (storageClass S3StorageClassType, err error)

StorageClassTypeFromString converts a string to the appropriate StorageClassTypeFromString value otherwise an error is returned

func (S3StorageClassType) String

func (storageClassType S3StorageClassType) String() string

String takes the the current StorageClassType enum and returns the string representation

Directories

Path Synopsis
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
service
eventbridge
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
route53
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
s3
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
********************************************************************************** The MIT License (MIT) Copyright (c) 2022 Sean Beard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Jump to

Keyboard shortcuts

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