REGIONAL 处于活动状态时无法为 EDGE 导入证书
Cannot import certificates for EDGE while REGIONAL is active
我正在尝试为我的 apigateway 使用 eu-central-1 颁发的证书,该证书是区域性的并且在同一区域工作。
我的terraform代码如下:
//ACM Certificate
provider "aws" {
region = "eu-central-1"
alias = "eu-central-1"
}
resource "aws_acm_certificate" "certificate" {
provider = "aws.eu-central-1"
domain_name = "*.kumite.xyz"
validation_method = "EMAIL"
}
//Apigateway
resource "aws_api_gateway_rest_api" "kumite_writer_api" {
name = "kumite_writer_api"
endpoint_configuration {
types = ["REGIONAL"]
}
}
resource "aws_api_gateway_domain_name" "domain_name" {
certificate_arn = aws_acm_certificate.certificate.arn
domain_name = "recorder.kumite.xyz"
endpoint_configuration {
types = ["REGIONAL"]
}
}
不幸的是,我经常遇到这个错误:
Error: Error creating API Gateway Domain Name: BadRequestException: Cannot import certificates for EDGE while REGIONAL is active.
我在这里缺少什么?我认为我的 ApiGateway 不是 EDGE 而是 REGIONAL,所以找不到错误的意义...
将 certificate_arn
更改为 regional_certificate_arn
。
来自 documentation(强调我的):
When referencing an AWS-managed certificate, the following arguments are supported:
certificate_arn
- (Optional) The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with certificate_name, certificate_body, certificate_chain, certificate_private_key, regional_certificate_arn, and regional_certificate_name.
regional_certificate_arn
- (Optional) The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with certificate_arn, certificate_name, certificate_body, certificate_chain, and certificate_private_key.
我正在尝试为我的 apigateway 使用 eu-central-1 颁发的证书,该证书是区域性的并且在同一区域工作。
我的terraform代码如下:
//ACM Certificate
provider "aws" {
region = "eu-central-1"
alias = "eu-central-1"
}
resource "aws_acm_certificate" "certificate" {
provider = "aws.eu-central-1"
domain_name = "*.kumite.xyz"
validation_method = "EMAIL"
}
//Apigateway
resource "aws_api_gateway_rest_api" "kumite_writer_api" {
name = "kumite_writer_api"
endpoint_configuration {
types = ["REGIONAL"]
}
}
resource "aws_api_gateway_domain_name" "domain_name" {
certificate_arn = aws_acm_certificate.certificate.arn
domain_name = "recorder.kumite.xyz"
endpoint_configuration {
types = ["REGIONAL"]
}
}
不幸的是,我经常遇到这个错误:
Error: Error creating API Gateway Domain Name: BadRequestException: Cannot import certificates for EDGE while REGIONAL is active.
我在这里缺少什么?我认为我的 ApiGateway 不是 EDGE 而是 REGIONAL,所以找不到错误的意义...
将 certificate_arn
更改为 regional_certificate_arn
。
来自 documentation(强调我的):
When referencing an AWS-managed certificate, the following arguments are supported:
certificate_arn
- (Optional) The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with certificate_name, certificate_body, certificate_chain, certificate_private_key, regional_certificate_arn, and regional_certificate_name.regional_certificate_arn
- (Optional) The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with certificate_arn, certificate_name, certificate_body, certificate_chain, and certificate_private_key.