- We need to have Go installed.
- We need to have the right credentials of AWS in the system where the script will run, see more here and here to understand how to set the AWS credentials.
- We can use this script to clean the environment variables of the AWS lambdas.
- We can use this script to disable AWS cloud watch events.
- We can use this script to delete S3 buckets by a term used as a prefix.
Inside the project folder run the below command:
go run *.go
# OR
go build *.go
./aws_utils {disable_rules | clean_envs | clean_s3}
- The file
event_watch_rule.go
has the logic to disable the triggers of some lambdas. - The file
lambda_env.go
has the logic to remove the environment variables. - The file
clean_s3_buckets.go
has the logic to delete S3 buckets by a term.
- turn the scripts into a CLI tool.
- [clean_s3_buckets] make the buckets empty before the delete operation.
- [lambda_env | event_watch_rule] get the variables as the function names, the names of environment variables, and the stages as inputs in the environment where the script is running or over the CLI arguments.