apigatewayv2-controller and HTTP headers management

huangapple go评论53阅读模式
英文:

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"}

huangapple
  • 本文由 发表于 2023年5月17日 20:14:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76271992.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定