question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: Ec2Runner VPC selection

See original GitHub issue

I just tried out to use the EC2 runners. Within our accounts we do not have a default VPC which leads to the stack can not be deployed.

const ec2Provider = new Ec2Runner(this, "ec2Runner", {
      subnet: subnets[0],
      spot: true,
    })
10:28:42 AM | CREATE_FAILED        | AWS::ImageBuilder::Image                       | Dev/GitHubRunners/...mage Builder/Image
Resource handler returned message: "Error occurred during operation 'No default VPC for this user. GroupName is only supported for EC2-Classic and default VPC.'." (RequestToken: ...., Handle
rErrorCode: GeneralServiceException)

Currently the Ec2RunnerProps also do not provide the option to set a VPC.

https://github.com/CloudSnorkel/cdk-github-runners/blob/main/src/providers/ec2.ts#L126-L186

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fwerkmeistercommented, Nov 30, 2022

After doing some more analysis it looks like the problem is related to the AmiBuilder where subnet and vpc would need to be passed into as properties if set.

https://github.com/CloudSnorkel/cdk-github-runners/blob/2aae0e6286cda81fb809aa3e02287767e29a6d28/src/providers/ec2.ts#L233

https://github.com/CloudSnorkel/cdk-github-runners/blob/main/src/providers/image-builders/ami.ts#L55-L74

0reactions
kichikcommented, Dec 2, 2022

I’ll create a PR. No need for a new issue.

BTW, I appreciate the bug reports, but you know you can pass your own image builder to get unblocked, right?

    const ec2Provider = new Ec2Runner(this, "ec2Runner", {
      subnet: subnets[0],
      spot: true,
      amiBuilder: new AmiBuilder(this, 'Image Builder', {
        vpc: vpc,
        subnetSelection: vpc.selectSubnets({subnetType: SubnetType.PUBLIC}),
        securityGroup: sg,
      }),
    })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Work with VPCs - Amazon Virtual Private Cloud
Select Dedicated to ensure that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified...
Read more >
feat(ecs-patterns): allow to select vpc subnets for LB fargate ...
feat (ecs-patterns): allow to select vpc subnets for LB fargate service · The logs for this run have expired and are no longer...
Read more >
How to Build a VPC in AWS - AWS in Plain English
In the AWS console, choose VPCs, Select Create VPC. Give it a name example “Yourname-VPC” and enter a CIDR block range example 10.0.0.0/16....
Read more >
kichik - PullAnswer
feat : Ec2Runner VPC selection. 1 Likes 5 Replies. fwerkmeister. 2022-11-30. feat: Ec2Runner VPC selection. 1 Likes 5 Replies. fwerkmeister. 2022-11-30 ...
Read more >
Selecting the Best VPC Network Architecture (CPN208)
Which is better: a single VPC with multiple subnets or multiple accounts with many VPCs? Should you simplify management with a single VPC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found