0

Am able to launch a elb via terraform and in output file stored the dns name of that ELB. Now I want to integrate that url with my api gateway via terraform, but unable to do that.

resource "aws_api_gateway_rest_api" "demo" {
  name = "${var.api_name}"

  invoke_url = "${var.invoke_url}" 

  endpoint_configuration {
    types = ["${var.api_type}"]
  }
}

invoke_url = "${module.elb.elb_dns_name}

api-gateway url should be like - http://xxx.aws.elb.com/api

Aniket
  • 495
  • 1
  • 5
  • 16
  • What have you tried? Did you get an error? Did something not work? Can you edit your question to include a [mcve] and the full error output if you get anything? – ydaetskcoR Mar 04 '20 at 09:44

1 Answers1

0

As you've probably gathered invoke_url is not a valid argument on the rest API.

I would recommend following this article to see how custom domain names can be attached to API Gateway instances via the AWS console.

Once you've understand that, you should be able to reverse-engineer the necessary terraform using resources like api_gateway_domain_name.

mjgpy3
  • 8,597
  • 5
  • 30
  • 51