Skip to content

Not a Issue But More of an Feature Request to Allow Wildcard Subdomain #64

@BitThr3at

Description

@BitThr3at

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.

  1. create a subdomain variable with default value "www"
			self.deploy_response = self.awsclient.create_deployment(
				restApiId=self.restAPIId,
				stageName=STAGE_NAME,
				variables={
    			    'subdomain': 'www'  
    			}
		
			)
  1. 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'
				}
			)
  1. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions