Thread
#aws
    f

    few-mechanic-54967

    1 week ago
    Can anyone give me an example for creating vpc using awsx. For now I create vpc using aws classic. I just need 1 route table(have 3 subnets public associate) and 1 route table(have 3 subnets private associate). How this code translate/if i want using awsx. ``````
    g

    green-stone-37839

    1 week ago
    It would be something like this:
    new awsx.ec2.Vpc("vpc", {
            cidrBlock: "your_desired_cidr",
            numberOfAvailabilityZones: 3,
            numberOfNatGateways: 3,
            subnets: [
                {
                    type: "public",
                },
                {
                    type: "private"
                }]
        });
    s

    salmon-account-74572

    1 week ago
    Let us know if you need the above in a different language.
    @few-mechanic-54967 Try removing the
    subnets
    section; I think the default is to create both private and public subnets, and I suspect that
    subnets
    section is being interpreted to create one public and one private.
    f

    few-mechanic-54967

    1 week ago
    The result still same. Have you look to deep awsx code?, there is loop 1 subnet 1 route tables, so I think it is impossible to group 3 subnet to 1 route table only.
    s

    salmon-account-74572

    1 week ago
    Why does the number of route tables matter, if the routes are configured correctly?
    f

    few-mechanic-54967

    1 week ago
    that's why there is a subnet associate if the purpose is, among other things, to group.
    s

    salmon-account-74572

    1 week ago
    If you want more explicit control over route tables and route table associations, then I’d stick with using AWS instead of AWSx.
    f

    few-mechanic-54967

    1 week ago
    Agree