awshelper

package
Version: v2.7.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvAssumedRole     = "TERRAGRUNT_ASSUMED_ROLE"
	EnvTokenExpiration = "TERRAGRUNT_TOKEN_EXPIRATION"
	EnvTokenDuration   = "TERRAGRUNT_TOKEN_DURATION"
)

Environment variables used to publish the assumed role expiration date

View Source
const CacheFile = ".terragrunt.cache"

CacheFile is the name of the file that hold the S3 source configuration for the folder

Variables

View Source
var ErrS3PathNotFoundError = errors.New("HeadObject failed on the given object")

ErrS3PathNotFoundError is the error that will be returned if an object doesn't exist in S3

Functions

func AssumeRoleEnvironmentVariables

func AssumeRoleEnvironmentVariables(logger *multilogger.Logger, roleArn, sessionName string, assumeDuration *int) (map[string]string, error)

AssumeRoleEnvironmentVariables returns a set of key value pair to use as environment variables to assume a different role

func CheckS3Status

func CheckS3Status(sourceBucketInfo *BucketInfo, folder string) error

CheckS3Status compares the saved status with the current version of the bucket folder returns true if the objects has not changed

func ConvertS3Path

func ConvertS3Path(path string) (string, error)

ConvertS3Path returns an S3 compatible path

func CreateAwsConfig added in v2.7.0

func CreateAwsConfig(awsRegion, awsProfile string) (*aws.Config, error)

CreateAwsConfig returns an AWS config object for the given region, ensuring that the credentials are available

func GetSSMParameter

func GetSSMParameter(parameterName, region string) (string, error)

GetSSMParameter returns the value from the parameters store

func GetSSMParametersByPath

func GetSSMParametersByPath(path, region string) (result []types.Parameter, err error)

GetSSMParametersByPath returns values from the parameters store matching the path

func InitAwsConfig added in v2.7.0

func InitAwsConfig(awsProfile string) (*aws.Config, error)

InitAwsConfig configures environment variables to ensure that all following AWS operations will be able to be executed using the proper credentials. Some calls to terraform library are not able to handle shared config properly. This also ensures that the session remains alive in case of MFA is required avoiding asking for MFA on each AWS calls.

func SaveS3Status

func SaveS3Status(bucketInfo *BucketInfo, folder string) (err error)

SaveS3Status save the current state of the S3 bucket folder in the directory

Types

type BucketInfo

type BucketInfo struct {
	BucketName string
	Region     string
	Key        string
}

BucketInfo represents the basic information relative to an S3 URL

func GetBucketObjectInfoFromURL

func GetBucketObjectInfoFromURL(url string) (*BucketInfo, error)

GetBucketObjectInfoFromURL retrieve the components of the bucket (name, key, region) from an URL

func (*BucketInfo) String

func (b *BucketInfo) String() string

Path returns a valid path from a bucket object

Jump to

Keyboard shortcuts

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