Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPC with VPN throws NullReferenceException #2613

Closed
McDoit opened this issue May 23, 2019 · 4 comments
Closed

VPC with VPN throws NullReferenceException #2613

McDoit opened this issue May 23, 2019 · 4 comments
Labels
bug This issue is a bug.

Comments

@McDoit
Copy link
Contributor

McDoit commented May 23, 2019

Describe the bug
Creating a VPC with a VPN connection throws NullReferenceException

To Reproduce

new VpcNetwork(this, "office-vpc", new VpcNetworkProps
{
    Cidr = "10.0.0.0/16",
    SubnetConfiguration = new ISubnetConfiguration[]
    {
        new SubnetConfiguration { Name = "Public", CidrMask = 24, SubnetType = SubnetType.Public }
    },
    VpnGateway = true,
    VpnGatewayAsn = 65534 - 1,
    VpnConnections = {
        {
            "office",
            new VpnConnectionOptions
            {
                Asn = 65534 - 2,
                Ip = "127.0.0.1"
            }
        },
    },
    VpnRoutePropagation = new ISubnetSelection[] { new SubnetSelection { SubnetType = SubnetType.Public }  }
});

Expected behavior
Create a VPC with a VPN

Works when I create a VPC, without the VpnConnections property, and create the VPN separately afterwards

Version:

  • OS - Win 10
  • Programming Language - C#/dotnet core
  • CDK Version - 0.31
@McDoit McDoit added the bug This issue is a bug. label May 23, 2019
@jogold
Copy link
Contributor

jogold commented May 23, 2019

Not familiar with C#/dotnet syntax but VpnConnections expects an object with keys that are construct id's and values VpnConnectionOptions. I think it should be "office" = new VpnConnectionsOptions...

@McDoit
Copy link
Contributor Author

McDoit commented May 23, 2019

Not familiar with C#/dotnet syntax but VpnConnections expects an object with keys that are construct id's and values VpnConnectionOptions. I think it should be "office" = new VpnConnectionsOptions...

I guess that is what the transformation makes it into
The VpnConnections is a IDictionary<string, IVpnConnectionOptions> in C#

That is the beauty with a strongly typed language, it tells you how to do things ;)

@RomainMuller
Copy link
Contributor

Seems to be the same as #3580

@McDoit
Copy link
Contributor Author

McDoit commented Aug 14, 2019

Indeed, that fixed the issue, thanks!

@McDoit McDoit closed this as completed Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants