cn-terraform / terraform-aws-ecs-fargate

AWS ECS Fargate Terraform Module
https://registry.terraform.io/modules/cn-terraform/ecs-fargate
Apache License 2.0
87 stars 56 forks source link

Error: getting Caller Identity: RequestError: send request failed #75

Open hisashiyamaguchi opened 1 year ago

hisashiyamaguchi commented 1 year ago

I'm trying to apply this to my AWS account, and getting an error. If someone has the same or similar issues and have already identified workarounds, I would like to know the detail.

$ aws-vault exec hisashi --no-session -- terraform apply
module.test.module.ecs-fargate-service.module.ecs-alb[0].data.aws_elb_service_account.default: Reading...
module.test.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].data.aws_caller_identity.current: Reading...
module.test.module.ecs-fargate-service.module.ecs-alb[0].data.aws_elb_service_account.default: Read complete after 0s [id=033677994240]
module.test.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].data.aws_caller_identity.current: Still reading... [10s elapsed]
module.test.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].data.aws_caller_identity.current: Still reading... [20s elapsed]
╷
│ Error: getting Caller Identity: RequestError: send request failed
│ caused by: Post "http://localstack:4566/": dial tcp: lookup localstack on 8.8.8.8:53: no such host
│
│   with module.test.module.ecs-fargate-service.module.ecs-alb[0].module.lb_logs_s3[0].data.aws_caller_identity.current,
│   on .terraform/modules/test.ecs-fargate-service.ecs-alb.lb_logs_s3/main.tf line 47, in data "aws_caller_identity" "current":
│   47: data "aws_caller_identity" "current" {}
│

$ terraform --version
Terraform v1.3.9
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.24.0
+ provider registry.terraform.io/hashicorp/local v2.2.3
+ provider registry.terraform.io/hashicorp/random v3.3.2
JaredDarling commented 11 months ago

It appears you are trying to run locally. You can modify your OS hosts file and add localstack as an alias to localhost

An alternative is to modify the terraform.tf in example/tests and change localstack to localhost and run the localstack Docker container a locally, which is intended.