From 2655a193855fa768dcbc1284392db5b67b79640e Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 22 Apr 2024 14:39:52 +0800 Subject: [PATCH] refactor: refactor AWS env variable handling in main - Simplify AWS environment variable lists by removing redundant `AWS_` prefixed variables in `main.go` Signed-off-by: Bo-Yi Wu --- main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index ef486ca..85100bd 100644 --- a/main.go +++ b/main.go @@ -39,28 +39,27 @@ func main() { &cli.StringFlag{ Name: "region", Usage: "AWS Region", - EnvVars: []string{"PLUGIN_REGION", "PLUGIN_AWS_REGION", "AWS_REGION", "INPUT_AWS_REGION"}, - Value: "us-east-1", + EnvVars: []string{"PLUGIN_REGION", "PLUGIN_AWS_REGION", "INPUT_AWS_REGION"}, }, &cli.StringFlag{ Name: "access-key", Usage: "AWS ACCESS KEY", - EnvVars: []string{"PLUGIN_ACCESS_KEY", "PLUGIN_AWS_ACCESS_KEY_ID", "AWS_ACCESS_KEY_ID", "INPUT_AWS_ACCESS_KEY_ID"}, + EnvVars: []string{"PLUGIN_ACCESS_KEY", "PLUGIN_AWS_ACCESS_KEY_ID", "INPUT_AWS_ACCESS_KEY_ID"}, }, &cli.StringFlag{ Name: "secret-key", Usage: "AWS SECRET KEY", - EnvVars: []string{"PLUGIN_SECRET_KEY", "PLUGIN_AWS_SECRET_ACCESS_KEY", "AWS_SECRET_ACCESS_KEY", "INPUT_AWS_SECRET_ACCESS_KEY"}, + EnvVars: []string{"PLUGIN_SECRET_KEY", "PLUGIN_AWS_SECRET_ACCESS_KEY", "INPUT_AWS_SECRET_ACCESS_KEY"}, }, &cli.StringFlag{ Name: "session-token", Usage: "AWS Session token", - EnvVars: []string{"PLUGIN_SESSION_TOKEN", "PLUGIN_AWS_SESSION_TOKEN", "AWS_SESSION_TOKEN", "INPUT_AWS_SESSION_TOKEN"}, + EnvVars: []string{"PLUGIN_SESSION_TOKEN", "PLUGIN_AWS_SESSION_TOKEN", "INPUT_AWS_SESSION_TOKEN"}, }, &cli.StringFlag{ Name: "aws-profile", Usage: "AWS profile", - EnvVars: []string{"PLUGIN_PROFILE", "PLUGIN_AWS_PROFILE", "AWS_PROFILE", "INPUT_AWS_PROFILE"}, + EnvVars: []string{"PLUGIN_PROFILE", "PLUGIN_AWS_PROFILE", "INPUT_AWS_PROFILE"}, }, &cli.StringFlag{ Name: "function-name",