terraform-aws-modules / terraform-aws-apigateway-v2

Terraform module to create AWS API Gateway v2 (HTTP/WebSocket) 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/apigateway-v2/aws
Apache License 2.0
148 stars 200 forks source link

Domain name and certificate ARN #92

Closed syaldram closed 1 year ago

syaldram commented 1 year ago

Domain name and certificate ARN

The module readme file states most or all inputs are "optional" but the terraform module has a required argument "domain_name" and "certificate_arn". Is there a default domain that can be used which is generated by AWS by default?

If your request is for a new feature, please use the Feature request template.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Reproduction Code [Required]

module "apigateway-v2" { source = "terraform-aws-modules/apigateway-v2/aws" version = "2.2.2" name = "get_views_api" description = "REST API with lambda integration to get dynamoDB data for web application." protocol_type = "HTTP"

cors_configuration = { allow_headers = ["content-type", "x-amz-date", "authorization", "x-api-key", "x-amz-security-token", "x-amz-user-agent"] allow_methods = [""] allow_origins = [""] }

Routes and integrations

integrations = { "POST /" = { lambda_arn = module.get_viewer_count.lambda_function_arn payload_format_version = "2.0" timeout_milliseconds = 12000 credentials_arn = aws_iam_role.apigw_invoke_lambda_role.arn }

"GET /some-route-with-authorizer" = {
  integration_type       = "HTTP_PROXY"
  integration_uri        = module.get_viewer_count.lambda_function_invoke_arn
  credentials_arn        = aws_iam_role.apigw_invoke_lambda_role.arn
}

}

default_stage_access_log_destination_arn = aws_cloudwatch_log_group.apigw_log_group.arn default_stage_access_log_format = "$context.identity.sourceIp $context.requestId"

}

Steps to reproduce the behavior:

Expected behavior

Terraform successful

Actual behavior

Error: Missing required argument Error: Missing required argument

alohamonius commented 1 year ago

You can use create_api_domain_name = false

flavono123 commented 1 year ago

+1 for this since we can create only with an API name in the web console, even though this is not a bug. i think this module should create the random domain and attach the ACM to it by default.

flavono123 commented 1 year ago

You can use create_api_domain_name = false

oh got this lately. working with it 👍

flavono123 commented 1 year ago

@syaldram @bryantbiggs guess solved by https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2/issues/92#issuecomment-1697542065. would be close?

github-actions[bot] commented 11 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.