简体   繁体   English

如何在 Terraform 中为 Apigatewayv2 output 自定义域端点配置 url?

[英]How to output a custom domain endpoint configuration url in Terraform for Apigatewayv2?

**SOLVED: the output I was seeking can be found in the resource aws_apigatewayv2_domain_name from the attribute target_domain_name (which is nested under domain_name_configuration. **已解决:我正在寻找的 output 可以在属性 target_domain_name(嵌套在 domain_name_configuration 下)的资源 aws_apigatewayv2_domain_name 中找到。

I am looking to find a way to add an output in my Terraform module to get the url of the custom domain name route53 url that is automatically created by AWS when I create a custom domain in Api Gateway.我正在寻找一种方法来在我的 Terraform 模块中添加一个 output,以获取自定义域名 route53 url 的 url,这是当我在 Api 网关中创建自定义域时由 AWS 自动创建的。 (ex. d-uq5rzcek63.execute-api.us-east-1.amazonaws.com). (例如 d-uq5rzcek63.execute-api.us-east-1.amazonaws.com)。 Does anyone know how to access that value as an output?有谁知道如何以 output 的形式访问该值?

Here is the block of code building the custom domain:这是构建自定义域的代码块:

resource "aws_apigatewayv2_domain_name" "module_domain" {
  domain_name = "exampledomain.com"
  domain_name_configuration {
    certificate_arn = "arn:aws:acm:us-east-1:000000000000:certificate/xxxx11x-x11x-11xx-11x1-11xxx111xxx1"
    endpoint_type   = "REGIONAL"
    security_policy = "TLS_1_2"
  }
}

Refer to screenshot of where this value can be found in console.请参阅在控制台中可以找到此值的位置的屏幕截图。

This can be obtained using invoke_url from aws_apigatewayv2_stage , or using api_endpoint from aws_apigatewayv2_api .这可以使用aws_apigatewayv2_stage中的aws_apigatewayv2_stage或使用aws_apigatewayv2_api中的aws_apigatewayv2_api

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ApiGatewayV2 如何通过 CloudFormation 设置“执行角色” - ApiGatewayV2 how to set the "Execution Role" via CloudFormation AWS::ApiGatewayV2::Api - 简单的 WebSocket 配置抛出 INVALID_API_KEY(禁止) - AWS::ApiGatewayV2::Api - Simple WebSocket configuration throwing INVALID_API_KEY (forbidden) 如何在 Terraform output 中获取 cosmos db gremlin 端点 - How to get cosmos db gremlin endpoint in Terraform output 使用 terraform 如何将自定义域添加到 Azure 前门 - use terraform how to add custom domain to Azure front door 我将如何为 Terraform 上的 AWS Elastic Beanstalk 定义 URL/域? - How would I define the URL/Domain for AWS Elastic Beanstalk on Terraform? Terraform AzureRM 不断修改 API 使用默认端点的代理配置进行管理 - Terraform AzureRM Continually Modifying API Management with Proxy Configuration for Default Endpoint 将 Godaddy 自定义域映射到 Azure CDN 端点 - Mapping Godaddy custom domain to Azure CDN endpoint 如何修复 Terraform 提供程序配置不存在 - How to fix Terraform Provider configuration not present 如何覆盖 AWS Amplify Api 域端点 - How to override AWS Amplify Api domain endpoint 在 Terraform 中,如何从列表中获取 output 的值? - In Terraform, how to output values from a list?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM