-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Description
First of all thanks mate for developing and maintaining such a good extension, i want to know it is possible to allow rotating traffic for *.example.com ?
i tried doing it in following way but failed and since you have better idea of the code and also as it is written in python2 i thought it would right to get advice from you.
- create a subdomain variable with default value "www"
self.deploy_response = self.awsclient.create_deployment(
restApiId=self.restAPIId,
stageName=STAGE_NAME,
variables={
'subdomain': 'www'
}
)
- use the variable in integration
self.awsclient.put_integration(
restApiId=self.create_api_response['id'],
resourceId=get_resource_response['items'][0]['id'],
type='HTTP_PROXY',
httpMethod='ANY',
integrationHttpMethod='ANY',
uri=self.getTargetProtocol()+'://${stageVariables.subdomain}'+ '/',
connectionType='INTERNET',
requestParameters={
'integration.request.path.proxy':'method.request.path.proxy',
'integration.request.header.X-Forwarded-For': 'method.request.header.X-My-X-Forwarded-For'
}
)
- Map the request header value containing subdomain to subdomain variable
self.awsclient.update_stage(
restApiId=self.restAPIId,
stageName=STAGE_NAME,
patchOperations=[
{
'op': 'replace',
'path': '/variables/subdomain',
'value': "$input.params('X-My-X-Forwarded-For')"
}
]
)
Metadata
Metadata
Assignees
Labels
No labels