Skip to content

Commit

Permalink
Revert upstream changes triggering LB panic (#3426)
Browse files Browse the repository at this point in the history
This reverts the following upstream PRs:
hashicorp/terraform-provider-aws#35671
hashicorp/terraform-provider-aws#35678
as a quick fix to mitigate
#3421 until we root-cause it.

Details on my findings so far:
#3421 (comment)
It looks to me like the issue originates somewhere in our handling of
nulls/empty in the bridge, so seems unlikely to get fixed today.

It also adds a test for LB listeners. I've verified that the test
triggers the panic without the patches and that the patches resolve it.
  • Loading branch information
VenelinMartinov committed Feb 14, 2024
1 parent 6cef7e7 commit 32a25bf
Show file tree
Hide file tree
Showing 37 changed files with 5,420 additions and 918 deletions.
12 changes: 12 additions & 0 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,18 @@ func TestRegress2555(t *testing.T) {
integration.ProgramTest(t, &test)
}

func TestRegress3421(t *testing.T) {
test := getJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: "regress-3421",
SkipRefresh: true,
},
)
// Disable envRegion mangling
test.Config = nil
integration.ProgramTest(t, &test)
}

func getJSBaseOptions(t *testing.T) integration.ProgramTestOptions {
envRegion := getEnvRegion(t)
baseJS := integration.ProgramTestOptions{
Expand Down
2 changes: 2 additions & 0 deletions examples/regress-3421/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin/
/node_modules/
7 changes: 7 additions & 0 deletions examples/regress-3421/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: regress-3421
runtime: nodejs
description: A minimal AWS TypeScript Pulumi program
config:
pulumi:tags:
value:
pulumi:template: aws-typescript
50 changes: 50 additions & 0 deletions examples/regress-3421/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import * as aws from "@pulumi/aws";

const vpc = new aws.ec2.Vpc("main", { cidrBlock: "10.0.0.0/16" });

const currentRegion = aws.getRegion({})
const subnet = new aws.ec2.Subnet("main", {
vpcId: vpc.id,
cidrBlock: "10.0.12.0/24",
availabilityZone: currentRegion.then(region => region.name + "a")
});

const subnet2 = new aws.ec2.Subnet("subnet2", {
vpcId: vpc.id,
cidrBlock: "10.0.5.0/24",
availabilityZone: currentRegion.then(region => region.name + "b")
});

const secGroup = new aws.ec2.SecurityGroup("allowTls", {
description: "Allow TLS inbound traffic and all outbound traffic",
vpcId: vpc.id,
tags: {
Name: "allow_tls",
},
});

const loadbalancer = new aws.lb.LoadBalancer("payload-lb", {
loadBalancerType: "application",
securityGroups: [secGroup.id],
subnets: [subnet.id, subnet2.id],
internal: true,
});

const targetGroup = new aws.lb.TargetGroup("payload-tg", {
port: 80,
protocol: "HTTP",
targetType: "ip",
vpcId: vpc.id,
});

new aws.lb.Listener("payload-lb-listner-http", {
loadBalancerArn: loadbalancer.arn,
port: 80,
protocol: "HTTP",
defaultActions: [
{
type: "forward",
targetGroupArn: targetGroup.arn,
},
],
});
12 changes: 12 additions & 0 deletions examples/regress-3421/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "regress-3421",
"main": "index.ts",
"devDependencies": {
"@types/node": "^18"
},
"dependencies": {
"@pulumi/pulumi": "^3.0.0",
"@pulumi/aws": "^6.0.0",
"@pulumi/awsx": "^2.0.2"
}
}
18 changes: 18 additions & 0 deletions examples/regress-3421/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.ts"
]
}
Loading

0 comments on commit 32a25bf

Please sign in to comment.