Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertAutoScalingTagsToMap(tags []autoscaling.TagDescription) map[string]string
- func ConvertEC2TagsToMap(tags []*ec2.Tag) map[string]string
- func ConvertIAMTagsToMap(tags []iam.Tag) map[string]string
- func ConvertNetworkFirewallTagsToMap(tags []networkfirewalltypes.Tag) map[string]string
- func ConvertRDSTypeTagsToMap(tags []rdstypes.Tag) map[string]string
- func ConvertS3TypesTagsToMap(tags []s3types.Tag) map[string]string
- func ConvertStringPtrTagsToMap(tags map[string]*string) map[string]string
- func ConvertTypesTagsToMap(tags []types.Tag) map[string]string
- func Difference(a, b []*string) []*string
- func FormatTimestamp(timestamp time.Time) string
- func GetBoolFromContext(ctx context.Context, key string) (bool, error)
- func GetCurrentAccountId(session *session.Session) (string, error)
- func GetEC2ResourceNameTagValue[T *ec2.Tag | types.Tag](tags []T) *string
- func GetOrCreateFirstSeen(ctx context.Context, client interface{}, identifier *string, ...) (*time.Time, error)
- func IsFirstSeenTag(key *string) bool
- func ParseTimestamp(timestamp *string) (*time.Time, error)
- func RemoveNewlines(s string) string
- func Split(identifiers []string, limit int) [][]string
- func TransformAWSError(err error) error
- func Truncate(s string, maxLen int) string
- func UniqueID() string
- type ResourceExecutionTimeout
Constants ¶
const AWSAccessDeniedException string = "AccessDeniedException"
const (
AccountIdKey = "accountId"
)
const AwsDryRunSuccess string = "Request would have succeeded, but DryRun flag is set."
const (
ExcludeFirstSeenTagKey = "exclude-first-seen-tag"
)
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 ¶
var ErrContextExecutionTimeout = errors.New("error:EXECUTION_TIMEOUT")
var ErrDeleteProtectionEnabled = errors.New("error:DeleteProtectionEnabled")
var ErrDifferentOwner = errors.New("error:DIFFERENT_OWNER")
var ErrInSufficientPermission = errors.New("error:INSUFFICIENT_PERMISSION")
var ErrInterfaceIDNotFound = errors.New("error:InterfaceIdNotFound")
var ErrInvalidPermisionNotFound = errors.New("error:InvalidPermission.NotFound")
var ErrResourceNotFoundException = errors.New("error:ErrResourceNotFoundException")
Functions ¶
func ConvertAutoScalingTagsToMap ¶ added in v0.33.0
func ConvertAutoScalingTagsToMap(tags []autoscaling.TagDescription) map[string]string
func ConvertEC2TagsToMap ¶ added in v0.33.0
func ConvertIAMTagsToMap ¶ added in v0.33.0
func ConvertNetworkFirewallTagsToMap ¶ added in v0.36.0
func ConvertNetworkFirewallTagsToMap(tags []networkfirewalltypes.Tag) map[string]string
func ConvertRDSTypeTagsToMap ¶ added in v0.38.0
func ConvertS3TypesTagsToMap ¶ added in v0.38.0
func ConvertStringPtrTagsToMap ¶ added in v0.33.0
func ConvertTypesTagsToMap ¶ added in v0.38.0
func Difference ¶ added in v0.33.0
Difference returns the elements in `a` that aren't in `b`.
func FormatTimestamp ¶ added in v0.33.0
func GetBoolFromContext ¶ added in v0.36.0
func GetCurrentAccountId ¶ added in v0.13.0
func GetEC2ResourceNameTagValue ¶ added in v0.34.0
func GetOrCreateFirstSeen ¶ added in v0.36.0
func IsFirstSeenTag ¶ added in v0.33.0
func RemoveNewlines ¶ added in v0.34.0
RemoveNewlines will delete all the newlines in a given string, which is useful for making error messages "sit" more nicely within their specified table cells in the terminal
func TransformAWSError ¶ added in v0.34.0
TransformAWSError this function is used to handle AWS errors and mapping them to a custom error message This could be part of a larger error-handling strategy that interacts with AWS services, providing a more human-readable error message for certain conditions ref : https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html
func Truncate ¶ added in v0.34.0
Truncate accepts a string and a max length. If the max length is less than the string's current length, then only the first maxLen characters of the string are returned
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 ¶
type ResourceExecutionTimeout ¶ added in v0.35.0
func (ResourceExecutionTimeout) Error ¶ added in v0.35.0
func (err ResourceExecutionTimeout) Error() string