We have a setup between two AWS accounts, connected via VPC peering. We are using the AWS ec2 plugin, to set up an agent on jenkins.
Our jenkins master is located in VPC A, and we would like to setup an agent in VPC B.
VPC A has peering connection to VPC B, with route tables set up etc.
The problem we have is that, when we specify the subnet ID in jenkins, we get the error:
com.amazonaws.services.ec2.model.AmazonEC2Exception: The subnet ID 'subnet-xxxxxx' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidSubnetID.NotFound; Request ID: ef17dd8c-34d7-4591-b598-2b1338ee531b)
The subnet is a subnet located in VPC B.
Is there a specific way we have to define the subnet in jenkins, since it's from another VPC?