英文:
apigatewayv2-controller and HTTP headers management
问题
我尝试通过控制器管理我的AWS HTTP API网关及其资源。由于HTTP头部的操作,我感到困惑。
我需要覆盖头部 Host: my.local.host
。
我使用 Integration
清单来管理它:
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
name: integration-my
namespace: rental-connect
spec:
apiRef:
from:
name: adopt-api-gateway-my
connectionID: id
integrationType: HTTP_PROXY
connectionType: VPC_LINK
integrationURI: arn:aws:elasticloadbalancing:eu-central-1:...
integrationMethod: ANY
payloadFormatVersion: "1.0"
requestParameters: <这里我需要帮助>
英文:
I try to manage my AWS HTTP API gateway and its resources by the controller. I got a confusion due to manipulation by the HTTP header.
I need to overwrite the header Host: my.local.host
.
I use Integration
manifest to manage it:
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
name: integration-my
namespace: rental-connect
spec:
apiRef:
from:
name: adopt-api-gateway-my
connectionID: id
integrationType: HTTP_PROXY
connectionType: VPC_LINK
integrationURI: arn:aws:elasticloadbalancing:eu-central-1:...
integrationMethod: ANY
payloadFormatVersion: "1.0"
requestParameters: <here I need help>
I suppose requestParameters
can help me. But I have absolutely no idea in what format I can use it.
Any ideas?
答案1
得分: 0
我自己找到了一个解决方案:
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
name: integration-my
namespace: rental-connect
spec:
apiRef:
from:
name: adopt-api-gateway-my
connectionID: id
integrationType: HTTP_PROXY
connectionType: VPC_LINK
integrationURI: arn:aws:elasticloadbalancing:eu-central-1:...
integrationMethod: ANY
payloadFormatVersion: "1.0"
requestParameters: {"overwrite:header.Host": "my.hostname.com"}
英文:
I found a solution myself:
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
name: integration-my
namespace: rental-connect
spec:
apiRef:
from:
name: adopt-api-gateway-my
connectionID: id
integrationType: HTTP_PROXY
connectionType: VPC_LINK
integrationURI: arn:aws:elasticloadbalancing:eu-central-1:...
integrationMethod: ANY
payloadFormatVersion: "1.0"
requestParameters: {"overwrite:header.Host": "my.hostname.com"}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论