Deploying EC2 Agents to specific VPC's based on some criteria

Hey, just wondering if the following is somehow possible using the built-in EC2 plugin.

Sample Project Build Configurations

  1. Build -> Default Agent, Default VPC 
  2. Beta Deploy -> Default Agent, Default VPC 
  3. Beta Operational Tests -> Default Agent, Beta VPC 
  4. Staging Deploy -> Default Agent, Default VPC 
  5. Staging Operational Tests -> Default Agent, Staging VPC 
  6. Production Deploy -> Default Agent, Default VPC 
  7. Production Operational Tests -> Default Agent, Production VPC 

I've treid various combinations of Pools, Cloud profiles and agent properties but can't seem to figure it out. 

As a note cloud profiles create ephemeral agents so at times there are no agents and therefore the filter on agent properties doesn't seem to work for me. 

0
1 comment

Hi, to achieve this you need 3 cloud profiles, because you can add the same AMI only once to one cloud profile. You can also use agent name prefix to distinguish agents from different cloud profiles

Cloud Profile #1: Default Agent, Default VPC (prefix: default)

Cloud Profile #2: Default Agent, Staging VPC (prefix: staging)

Cloud Profile #3: Default Agent, Production VPC (prefix: production)

You can also add those agents to different pools if you have separate projects. Alternatively you can use agent requirements.

0

Please sign in to leave a comment.