collector

package module
v0.0.0-...-ddc10ec Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 14 Imported by: 0

README

Deprecated AWS Lambda Function Collector

A toolchain to scan the deprecated AWS Lambda functions.

This tool aims to collect the functions which run on the deprecated runtime in the specific AWS accounts/regions according to the "Lambda runtimes" information: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

Usage: CLI

Usage of deprecated_lambda_func_collector:
  -all-regions
        scan all lambda supported regions; this parameter take priority over the -regions
  -assume-role-arn string
        a role ARN for assume-role
  -output string
        the output format: "json", "csv", or "tsv" (default "json")
  -regions string
        target regions to scan; this value can have multiple regions as comma-separated string
  -without-future-planned-deprecation
        exclude the future planned deprecations from the result

Example:

$ AWS_PROFILE="YOUR-AWS-PROFILE" deprecated_lambda_func_collector --regions="ap-northeast-1,us-east-1"

NOTE: as the above, AWS_PROFILE is required to specify the target AWS environment.

CLI output Example:

[
  {
    "arn": "arn:aws:lambda:ap-northeast-1:123456789012:function:go-function",
    "deprecated_runtime": "go1.x",
    "deprecation_date": "Dec 31, 2023"
  },
  ...,
  {
    "arn": "arn:aws:lambda:us-east-1:123456789012:function:node14-function",
    "deprecated_runtime": "nodejs14.x",
    "deprecation_date": "Nov 27, 2023"
  }
]

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllLambdaSupportedRegions = []Region{
	"us-east-2",
	"us-east-1",
	"us-west-1",
	"us-west-2",
	"af-south-1",
	"ap-east-1",
	"ap-south-2",
	"ap-southeast-3",
	"ap-southeast-4",
	"ap-south-1",
	"ap-northeast-3",
	"ap-northeast-2",
	"ap-southeast-1",
	"ap-southeast-2",
	"ap-northeast-1",
	"ca-central-1",
	"eu-central-1",
	"eu-west-1",
	"eu-west-2",
	"eu-south-1",
	"eu-west-3",
	"eu-south-2",
	"eu-north-1",
	"eu-central-2",
	"il-central-1",
	"me-south-1",
	"me-central-1",
	"sa-east-1",
}

Functions

This section is empty.

Types

type CSVPresenter

type CSVPresenter struct {
	Delimiter rune
}

func (*CSVPresenter) Render

func (p *CSVPresenter) Render(deprecatedFunctions []*DeprecatedFunction) (string, error)

type DeprecatedFunction

type DeprecatedFunction struct {
	Conf            types.FunctionConfiguration
	DeprecationDate string
}

func CollectDeprecatedLambdaFunctions

func CollectDeprecatedLambdaFunctions(ctx context.Context, regions []Region, includeFuturePlanned bool, assumeRoleARN string, extractor *DeprecatedFunctionExtractor) ([]*DeprecatedFunction, error)

type DeprecatedFunctionExtractor

type DeprecatedFunctionExtractor struct {
	// contains filtered or unexported fields
}

func NewDeprecatedFunctionExtractor

func NewDeprecatedFunctionExtractor() (*DeprecatedFunctionExtractor, error)

func (*DeprecatedFunctionExtractor) Extract

func (f *DeprecatedFunctionExtractor) Extract(configurations []types.FunctionConfiguration, includeFuturePlanned bool) []*DeprecatedFunction

type DeprecatedRuntime

type DeprecatedRuntime struct {
	DeprecatedRuntimeToDate map[string]string
}

type DeprecatedRuntimeSource

type DeprecatedRuntimeSource struct {
	Runtime         string `yaml:"runtime"`
	DeprecationDate string `yaml:"deprecation_date"`
	Planned         bool   `yaml:"planned"`
}

type JSONPresenter

type JSONPresenter struct {
}

func (*JSONPresenter) Render

func (p *JSONPresenter) Render(deprecatedFunctions []*DeprecatedFunction) (string, error)

type Output

type Output struct {
	ARN               string `json:"arn"`
	DeprecatedRuntime string `json:"deprecated_runtime"`
	DeprecationDate   string `json:"deprecation_date"`
}

func TransformToOutput

func TransformToOutput(deprecatedFunctions []*DeprecatedFunction) []Output

type Presenter

type Presenter interface {
	Render(deprecatedFunctions []*DeprecatedFunction) (string, error)
}

type Region

type Region string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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