util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountIdKey = "accountId"
)
View Source
const (
	// FirstSeenTagKey A tag used to set custom AWS Tags to resources that do not support `created at` timestamp> - EIP & ECS Clusters.
	// This is used in relation to the `--older-than <duration>` filtering that `cloud-nuke` allows.
	// Due to its destructive nature, `cloud-nuke` has been configured not to delete AWS resources without known creation time,
	// and instead tag them with the `firstSeenTagKey`.
	// The next time `cloud-nuke aws --older-than <duration>` is run, it will use the tag to determine if the AWS resource should be deleted or not.
	FirstSeenTagKey = "cloud-nuke-first-seen"
)

Variables

This section is empty.

Functions

func ConvertAutoScalingTagsToMap

func ConvertAutoScalingTagsToMap(tags []*autoscaling.TagDescription) map[string]string

func ConvertEC2TagsToMap

func ConvertEC2TagsToMap(tags []*ec2.Tag) map[string]string

func ConvertIAMTagsToMap

func ConvertIAMTagsToMap(tags []*iam.Tag) map[string]string

func ConvertRDSTagsToMap

func ConvertRDSTagsToMap(tags []*rds.Tag) map[string]string

func ConvertS3TagsToMap

func ConvertS3TagsToMap(tags []*s3.Tag) map[string]string

func ConvertStringPtrTagsToMap

func ConvertStringPtrTagsToMap(tags map[string]*string) map[string]string

func Difference

func Difference(a, b []*string) []*string

Difference returns the elements in `a` that aren't in `b`.

func FormatTimestamp

func FormatTimestamp(timestamp time.Time) string

func GetCurrentAccountId

func GetCurrentAccountId(session *session.Session) (string, error)

func IsFirstSeenTag

func IsFirstSeenTag(key *string) bool

func ParseTimestamp

func ParseTimestamp(timestamp *string) (*time.Time, error)

func Split

func Split(identifiers []string, limit int) [][]string

func UniqueID

func UniqueID() string

Returns a unique (ish) id we can attach to resources and tfstate files so they don't conflict with each other Uses base 62 to generate a 6 character string that's unlikely to collide with the handful of tests we run in parallel. Based on code here: http://stackoverflow.com/a/9543797/483528

Types

This section is empty.

Jump to

Keyboard shortcuts

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