PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: pulumi/pulumi-awsx (ts)
Issue: Allow setting "None" in NAT Gateway Strategy for private subnets
There are valid situations whereby you'd want to create valid private subnets but not have NAT Gateways:

```
const vpc = new awsx.ec2.Vpc("natInstance", {
    numberOfAvailabilityZones: 2,
    cidrBlock: "172.20.0.0/22",
    natGateways: {
        strategy: "None"
    }
})
```

One such example is if you're deciding to use NAT instances for cost-effective egresss from a VPC
Pull request description: Do not throw an exception when NAT gateway strategy is None.
Fixes #884 

Patch:
diff --git a/awsx/ec2/vpc.ts b/awsx/ec2/vpc.ts
index ac70ed2b..d004f14a 100644
--- a/awsx/ec2/vpc.ts
+++ b/awsx/ec2/vpc.ts
@@ -347,9 +347,6 @@ export function validateNatGatewayStrategy(
         "If NAT Gateway strategy is 'OnePerAz' or 'Single', both private and public subnets must be declared. The private subnet creates the need for a NAT Gateway, and the public subnet is required to host the NAT Gateway resource.",
       );
     case "none":
-      if (subnets.some((x) => x.type.toLowerCase() === "private")) {
-        throw new Error("If private subnets are specified, NAT Gateway strategy cannot be 'None'.");
-      }
       break;
     default:
       throw new Error(`Unknown NAT Gateway strategy '${natGatewayStrategy}'`);


Test patch:
diff --git a/awsx/ec2/vpc.test.ts b/awsx/ec2/vpc.test.ts
index 4e3f20cd..a60df361 100644
--- a/awsx/ec2/vpc.test.ts
+++ b/awsx/ec2/vpc.test.ts
@@ -91,8 +91,12 @@ describe("validateNatGatewayStrategy", () => {
   );
 
   describe("strategy is None", () => {
-    it("should throw an exception if any private subnets are specified", () =>
-      runTest("None", ["Private"], true, "cannot be 'None'"));
+    // We cannot throw an exception in this case because egress for the private
+    // subnets may be accomplished by methods other than a NAT gateway. Examples
+    // include: NAT instances and centralized egress via TGW in a hub-and-spoke
+    // architecture.
+    it("should not throw an exception if any private subnets are specified", () =>
+      runTest("None", ["Private"], false));
 
     it("should succeed if only public and isolated subnets are specified", () =>
       runTest("None", ["Public", "Isolated"], false));