Repository: gruntwork-io/terragrunt (language: go)

Issue:
Bump aws-sdk-go to >= v1.47.11
Hello, team.

**Describe the solution you'd like**
I'd like `aws-sdk-go` to be bumped to at least [v1.47.11](https://github.com/aws/aws-sdk-go/releases/tag/v1.47.11) so that it supports new-ish credentials chain introduced with [EKS Pod Identity](https://docs.aws.amazon.com/eks/latest/userguide/pod-id-minimum-sdk.html)

Currently we are using terragrunt version 

```
$ terragrunt --version
terragrunt version v0.54.12
```

and during execution of following code

```
aws_account_id = lookup(jsondecode(get_env("TF_VAR_aws_account_ids", "{}")), local.workspace, get_aws_account_id())
```

I get the following error

```
ERRO[0000] Error: Error in function call

ERRO[0000]   on /home/runner/_work/ec2-runner/ec2-runner/terragrunt.hcl line 7, in locals:
ERRO[0000]    7:   aws_account_id       = lookup(jsondecode(get_env("TF_VAR_aws_account_ids", "{}")), local.workspace, get_aws_account_id())
ERRO[0000]
ERRO[0000] Call to function "get_aws_account_id" failed: Error finding AWS credentials (did you set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables?): NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors.

ERRO[0000] Encountered error while evaluating locals in file /home/runner/_work/ec2-runner/ec2-runner/terragrunt.hcl
ERRO[0000] /home/runner/_work/ec2-runner/ec2-runner/terragrunt.hcl:7,103-122: Error in function call; Call to function "get_aws_account_id" failed: Error finding AWS credentials (did you set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables?): NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors.
ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1
```

even though I can fetch creds by running

```
$ aws sts get-caller-identity --no-cli-pager
{
    "UserId": "AROAWOWMFQSCMZGF4MNLA:eks-alpha-eks-runner-3b4e4766-2af7-4bf6-952c-bc36f7a8413a",
    "Account": "************",
    "Arn": "arn:aws:sts::************:assumed-role/GitHubDeployerRole/eks-alpha-eks-runner-3b4e4766-2af7-4bf6-952c-bc36f7a8413a"
}
```

**Describe alternatives you've considered**
I can work around this issue by using defined `TF_VAR_aws_account_ids` so that code does not fallback to `get_aws_account_id()`

Thank you.



Discussion / hints:
Hm, I ensured that `TF_VAR_aws_account_ids` is populated, yet for some reason terragrunt still tries to execute `get_aws_account_id()`.

Replaced `get_aws_account_id()` with dummy value and code executed correctly, without outputting `dummy`, i.e. confirming that code extracts value from `TF_VAR_aws_account_ids`

After working around issues with `get_aws_account_id()` when I try to execute `terragrunt plan` I get following error

```
$ terragrunt init
2024/01/10 12:59:28 Ignoring, HTTP credential provider invalid endpoint host, "169.254.170.23", only loopback hosts are allowed. <nil>
ERRO[0000] Error finding AWS credentials (did you set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables?): NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1
```

yet `terraform plan` executes correctly, so issue is not with underlying terraform.

Fix patch:
diff --git a/go.mod b/go.mod
index ef19632997..26d83a0f6a 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.21
 
 require (
 	cloud.google.com/go/storage v1.30.1
-	github.com/aws/aws-sdk-go v1.46.6
+	github.com/aws/aws-sdk-go v1.49.17
 	github.com/creack/pty v1.1.17
 	github.com/fatih/structs v1.1.0
 	github.com/go-errors/errors v1.4.2
diff --git a/go.sum b/go.sum
index 154c8600c6..105045cf7d 100644
--- a/go.sum
+++ b/go.sum
@@ -322,6 +322,8 @@ github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zK
 github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
 github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8=
 github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.49.17 h1:Cc+7LgPjKeJkF2SdNo1IkpQ5Dfl9HCZEVw9OP3CPuEI=
+github.com/aws/aws-sdk-go v1.49.17/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
 github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4=
 github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
 github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=


Test patch: