Documentation ¶
Index ¶
- Constants
- Variables
- func AssumeRoleEnvironmentVariables(logger *multilogger.Logger, roleArn, sessionName string, assumeDuration *int) (map[string]string, error)
- func CheckS3Status(sourceBucketInfo *BucketInfo, folder string) error
- func ConvertS3Path(path string) (string, error)
- func CreateAwsConfig(awsRegion, awsProfile string) (*aws.Config, error)
- func GetSSMParameter(parameterName, region string) (string, error)
- func GetSSMParametersByPath(path, region string) (result []types.Parameter, err error)
- func InitAwsConfig(awsProfile string) (*aws.Config, error)
- func SaveS3Status(bucketInfo *BucketInfo, folder string) (err error)
- type BucketInfo
Constants ¶
const ( EnvAssumedRole = "TERRAGRUNT_ASSUMED_ROLE" EnvTokenExpiration = "TERRAGRUNT_TOKEN_EXPIRATION" EnvTokenDuration = "TERRAGRUNT_TOKEN_DURATION" )
Environment variables used to publish the assumed role expiration date
const CacheFile = ".terragrunt.cache"
CacheFile is the name of the file that hold the S3 source configuration for the folder
Variables ¶
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 ¶
ConvertS3Path returns an S3 compatible path
func CreateAwsConfig ¶ added in v2.7.0
CreateAwsConfig returns an AWS config object for the given region, ensuring that the credentials are available
func GetSSMParameter ¶
GetSSMParameter returns the value from the parameters store
func GetSSMParametersByPath ¶
GetSSMParametersByPath returns values from the parameters store matching the path
func InitAwsConfig ¶ added in v2.7.0
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 ¶
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