fierce-dinner-20116
03/25/2019, 4:58 PM@ggilmore
from https://github.com/pulumi/pulumi-awsx/issues/187#issuecomment-476290735lemon-spoon-91807
03/25/2019, 6:14 PMfierce-dinner-20116
03/25/2019, 6:18 PMlemon-spoon-91807
03/25/2019, 6:20 PMfierce-dinner-20116
03/25/2019, 6:21 PMlemon-spoon-91807
03/25/2019, 6:56 PMawait aws.ec2.getSubnetIds({ vpcId });
publicSubnetIds, privateSubnetIds, publicSubnets, privateSubnets
fierce-dinner-20116
03/25/2019, 6:58 PMPromise.all(vpc.publicSubnetIds, vpc.privateSubnetIds)
?lemon-spoon-91807
03/25/2019, 6:59 PMfierce-dinner-20116
03/25/2019, 6:59 PMlemon-spoon-91807
03/25/2019, 6:59 PMfierce-dinner-20116
03/25/2019, 7:00 PM/**
* The subnets to attach to the EKS cluster. If either vpcId or subnetIds is unset, the cluster will use the
* default VPC's subnets. If the list of subnets includes both public and private subnets, the Kubernetes API
* server and the worker nodes will only be attached to the private subnets. See
* <https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html> for more details.
*/
subnetIds?: pulumi.Input<pulumi.Input<string>[]>;
If the list of subnets includes both public and private subnets, the Kubernetes API server and the worker nodes will only be attached to the private subnets.
lemon-spoon-91807
03/25/2019, 7:00 PMpulumi.all([vpc.publicSubnetIds, vpc.privateSubnetIds]).apply(([ids1, ids2]) => [...ids1, ...ids2])
fierce-dinner-20116
03/25/2019, 7:00 PMlemon-spoon-91807
03/25/2019, 7:00 PMfierce-dinner-20116
03/25/2019, 7:01 PMlemon-spoon-91807
03/25/2019, 7:01 PMfierce-dinner-20116
03/25/2019, 7:01 PMlemon-spoon-91807
03/25/2019, 7:01 PMfierce-dinner-20116
03/25/2019, 7:07 PMlemon-spoon-91807
03/25/2019, 7:19 PMfierce-dinner-20116
03/25/2019, 7:19 PMlemon-spoon-91807
03/25/2019, 7:19 PMType Name Status
+ pulumi:pulumi:Stack containers-fargate-cyfartest created
+ ├─ awsx:x:ec2:NatGateway eksNetwork-1 created
+ │ ├─ aws:ec2:Eip eksNetwork-1 created
+ │ └─ aws:ec2:NatGateway eksNetwork-1 created
+ ├─ awsx:x:ec2:NatGateway eksNetwork-0 created
+ │ ├─ aws:ec2:Eip eksNetwork-0 created
+ │ └─ aws:ec2:NatGateway eksNetwork-0 created
+ ├─ awsx:x:ec2:Vpc eksNetwork created
+ │ ├─ awsx:x:ec2:Subnet eksNetwork-public-1 created
+ │ │ ├─ aws:ec2:RouteTable eksNetwork-public-1 created
+ │ │ ├─ aws:ec2:Subnet eksNetwork-public-1 created
+ │ │ └─ aws:ec2:RouteTableAssociation eksNetwork-public-1 created
+ │ ├─ awsx:x:ec2:Subnet eksNetwork-private-0 created
+ │ │ ├─ aws:ec2:RouteTable eksNetwork-private-0 created
+ │ │ ├─ aws:ec2:Subnet eksNetwork-private-0 created
+ │ │ └─ aws:ec2:RouteTableAssociation eksNetwork-private-0 created
+ │ ├─ awsx:x:ec2:Subnet eksNetwork-public-0 created
+ │ │ ├─ aws:ec2:RouteTable eksNetwork-public-0 created
+ │ │ ├─ aws:ec2:Subnet eksNetwork-public-0 created
+ │ │ └─ aws:ec2:RouteTableAssociation eksNetwork-public-0 created
+ │ ├─ awsx:x:ec2:InternetGateway eksNetwork created
+ │ │ └─ aws:ec2:InternetGateway eksNetwork created
+ │ └─ awsx:x:ec2:Subnet eksNetwork-private-1 created
+ │ ├─ aws:ec2:Subnet eksNetwork-private-1 created
+ │ ├─ aws:ec2:RouteTable eksNetwork-private-1 created
+ │ └─ aws:ec2:RouteTableAssociation eksNetwork-private-1 created
+ ├─ aws:ec2:Vpc eksNetwork created
+ ├─ aws:ec2:Route eksNetwork-public-0-ig created
+ ├─ aws:ec2:Route eksNetwork-public-1-ig created
+ ├─ aws:ec2:Route eksNetwork-private-0-nat-0 created
+ └─ aws:ec2:Route eksNetwork-private-1-nat-1 created
Resources:
+ 31 created
Duration: 2m14s
Permalink: <https://app.pulumi.com/CyrusNajmabadi/containers-fargate/cyfartest/updates/7>
cyrusn@DESKTOP-3IRRNND ~/go/src/github.com/pulumi/pulumi-awsx/nodejs/awsx/examples/fargate[(v0.17.1) ?
fierce-dinner-20116
03/25/2019, 7:20 PMlemon-spoon-91807
03/25/2019, 7:20 PMpulumi destroy
, followed by a pulumi stack rm
would do itfierce-dinner-20116
03/25/2019, 7:22 PMlemon-spoon-91807
03/25/2019, 7:22 PMfierce-dinner-20116
03/25/2019, 7:23 PMlemon-spoon-91807
03/25/2019, 7:25 PMfierce-dinner-20116
03/25/2019, 7:26 PMpulumi destroy
and pulumi stack rm
and was able to repro itgRPC binary module
error (you can see this in the recording). Running yarn
fixed the issue.
I’ve seen this off an on the entire time that I’ve been trying Pulumi - afaict there is no consistent reason for why it keeps occurringlemon-spoon-91807
03/25/2019, 7:29 PMfierce-dinner-20116
03/25/2019, 7:29 PMlemon-spoon-91807
03/25/2019, 7:30 PMIt is not a problem of missing quotation marks, but missing --region option when the instance is running in a region other than the default one (one hour waster for a useless error message .. )
fierce-dinner-20116
03/25/2019, 7:31 PMlemon-spoon-91807
03/25/2019, 7:32 PMfierce-dinner-20116
03/25/2019, 7:34 PMDiagnostics:
aws:ec2:RouteTable (eksNetwork-private-1):
error: Plan apply failed: Error creating route table: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 1806cadc-e093-485b-82ab-e0870158451c
aws:ec2:Subnet (eksNetwork-public-0):
error: Plan apply failed: Error creating subnet: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 71004bec-bfcb-414b-b51c-a294872066f6
aws:ec2:RouteTable (eksNetwork-public-0):
error: Plan apply failed: Error creating route table: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 13871371-fa69-4b35-a400-caedd2673827
aws:ec2:InternetGateway (eksNetwork):
error: Plan apply failed: 1 error occurred:
* creating urn:pulumi:dev::eks-cluster::awsx:x:ec2:Vpc$awsx:x:ec2:InternetGateway$aws:ec2/internetGateway:InternetGateway::eksNetwork: error attaching EC2 Internet Gateway (igw-092ec2d27430da2eb): InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 68f9c6b7-2308-488a-b7cb-031b3dc66d45
aws:ec2:RouteTable (eksNetwork-public-1):
error: Plan apply failed: Error creating route table: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 4073579f-3de7-41c1-90bc-e9be2633a0dc
aws:ec2:Subnet (eksNetwork-public-1):
error: Plan apply failed: Error creating subnet: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 8daaead9-ffae-42ed-bd9f-4a58303cb640
aws:ec2:RouteTable (eksNetwork-private-0):
error: Plan apply failed: Error creating route table: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 23639c85-25ba-4a2b-8dcf-a93723bf119c
aws:ec2:Subnet (eksNetwork-private-0):
error: Plan apply failed: Error creating subnet: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 7a3b1b8d-4430-4e56-b63a-ab8f4cf5202c
aws:ec2:Subnet (eksNetwork-private-1):
error: Plan apply failed: Error creating subnet: InvalidVpcID.NotFound: The vpc ID 'vpc-074ae14ff6f818703' does not exist
status code: 400, request id: 683d91a2-4500-46d3-b8a0-196d2e2cfc97
pulumi destroy
before changing the config?lemon-spoon-91807
03/25/2019, 7:36 PMfierce-dinner-20116
03/25/2019, 7:38 PMlemon-spoon-91807
03/25/2019, 7:39 PMfierce-dinner-20116
03/25/2019, 7:39 PMlemon-spoon-91807
03/25/2019, 7:41 PMfierce-dinner-20116
03/25/2019, 7:43 PMlemon-spoon-91807
03/25/2019, 7:43 PMfierce-dinner-20116
03/25/2019, 7:43 PMlemon-spoon-91807
03/25/2019, 7:43 PMfierce-dinner-20116
03/25/2019, 7:45 PMpulumi destroy
and just pulumi up again
?If you signed up for an AWS account on or after May 17, 2017, the default region when you access a resource from the AWS Management Console is US East (Ohio) (us-east-2); for older accounts, the default region is either US West (Oregon) (us-west-2) or US East (N. Virginia) (us-east-1). For more information, see Regions and Endpoints.
us-west-2
is our defaultlemon-spoon-91807
03/25/2019, 7:45 PMpulumi stack rm
fierce-dinner-20116
03/25/2019, 7:47 PMus-east-2
in this commit https://github.com/ggilmore/pulumi-eip-repro/commit/a471be14c49f882d3a7ee6fbd54e47e4c6c397b2 (per your suggestion)lemon-spoon-91807
03/25/2019, 7:47 PMpulumi config set ...
fierce-dinner-20116
03/25/2019, 7:48 PMlemon-spoon-91807
03/25/2019, 7:48 PMfierce-dinner-20116
03/25/2019, 7:48 PMpulumi destroy
and pulumi stack rm --preserve-config
lemon-spoon-91807
03/25/2019, 7:48 PMfierce-dinner-20116
03/25/2019, 7:49 PMPulumi.dev.yaml
file as welllemon-spoon-91807
03/25/2019, 7:50 PMfierce-dinner-20116
03/25/2019, 7:51 PMconfig:
aws:region: us-east-2
pulumi up
?lemon-spoon-91807
03/25/2019, 7:52 PMfierce-dinner-20116
03/25/2019, 7:55 PMlemon-spoon-91807
03/25/2019, 7:56 PMfierce-dinner-20116
03/25/2019, 7:56 PMlemon-spoon-91807
03/25/2019, 7:57 PMfierce-dinner-20116
03/25/2019, 7:57 PMlemon-spoon-91807
03/25/2019, 7:57 PMfierce-dinner-20116
03/25/2019, 7:58 PMlemon-spoon-91807
03/25/2019, 8:00 PMfierce-dinner-20116
03/25/2019, 8:02 PMlemon-spoon-91807
03/25/2019, 8:02 PMfierce-dinner-20116
03/25/2019, 8:04 PMlemon-spoon-91807
03/25/2019, 8:05 PMfierce-dinner-20116
03/25/2019, 8:05 PMlemon-spoon-91807
03/25/2019, 8:11 PMfierce-dinner-20116
03/25/2019, 8:14 PM~/.aws/config
(not ~/.aws/credentials
):
[default]
region = us-west-2
lemon-spoon-91807
03/25/2019, 8:19 PMfierce-dinner-20116
03/25/2019, 8:19 PMaws configure list
and have no default region setlemon-spoon-91807
03/25/2019, 8:26 PMfierce-dinner-20116
03/25/2019, 8:27 PMlemon-spoon-91807
03/25/2019, 8:27 PMfierce-dinner-20116
03/25/2019, 8:27 PMlemon-spoon-91807
03/25/2019, 8:27 PMfierce-dinner-20116
03/25/2019, 8:34 PMlemon-spoon-91807
03/25/2019, 8:36 PMfierce-dinner-20116
03/25/2019, 8:41 PMlemon-spoon-91807
03/25/2019, 8:41 PMfierce-dinner-20116
03/25/2019, 8:42 PMlemon-spoon-91807
03/25/2019, 8:45 PMfierce-dinner-20116
03/25/2019, 8:45 PMlemon-spoon-91807
03/25/2019, 8:45 PMfierce-dinner-20116
03/25/2019, 8:46 PMlemon-spoon-91807
03/25/2019, 8:46 PMnode_modules/@pulumi/awsx/ec2/natGateway.js
this.elasticIP = new aws.ec2.Eip(name, {
tags: { Name: name },
}, parentOpts);
this.elasticIP = new aws.ec2.Eip(name, {
vpc: true,
tags: { Name: name },
}, parentOpts);
fierce-dinner-20116
03/25/2019, 8:49 PMlemon-spoon-91807
03/25/2019, 8:52 PM"use strict";
// Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// <http://www.apache.org/licenses/LICENSE-2.0>
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Object.defineProperty(exports, "__esModule", { value: true });
const aws = require("@pulumi/aws");
const pulumi = require("@pulumi/pulumi");
const x = require("..");
class NatGateway extends pulumi.ComponentResource {
constructor(name, vpc, args, opts) {
super("awsx:x:ec2:NatGateway", name, {}, opts || { parent: vpc });
const parentOpts = { parent: this };
this.vpc = vpc;
if (isExistingNatGatewayArgs(args)) {
this.natGateway = args.natGateway;
}
else {
// from <https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html>
//
// you must also specify an Elastic IP address to associate with the NAT gateway
// when you create it. After you've created a NAT gateway, you must update the route
// table associated with one or more of your private subnets to point Internet-bound
// traffic to the NAT gateway. This enables instances in your private subnets to
// communicate with the internet.
this.elasticIP = new aws.ec2.Eip(name, {
tags: { Name: name },
}, parentOpts);
const subnetId = x.ec2.Subnet.isSubnetInstance(args.subnet)
? args.subnet.id
: args.subnet;
this.natGateway = new aws.ec2.NatGateway(name, Object.assign({}, args, { subnetId, allocationId: this.elasticIP.id }), parentOpts);
}
this.registerOutputs();
}
route(name, opts) {
this.elasticIP = new aws.ec2.Eip(name, {
fierce-dinner-20116
03/25/2019, 8:54 PMlemon-spoon-91807
03/25/2019, 8:54 PMfierce-dinner-20116
03/25/2019, 8:54 PMlemon-spoon-91807
03/25/2019, 8:54 PMconsole.log("yup! hitting the new code")
fierce-dinner-20116
03/25/2019, 8:54 PMlemon-spoon-91807
03/25/2019, 8:54 PMfierce-dinner-20116
03/25/2019, 8:55 PMlemon-spoon-91807
03/25/2019, 8:55 PMfierce-dinner-20116
03/25/2019, 8:55 PMthis.elasticip
assignment?lemon-spoon-91807
03/25/2019, 8:56 PMfierce-dinner-20116
03/25/2019, 9:01 PMvpc: true
and log statement since I had to run yarn
again)lemon-spoon-91807
03/25/2019, 9:03 PMfierce-dinner-20116
03/25/2019, 9:05 PMlemon-spoon-91807
03/25/2019, 9:05 PMfierce-dinner-20116
03/25/2019, 9:07 PMlemon-spoon-91807
03/25/2019, 9:07 PMfierce-dinner-20116
03/25/2019, 9:08 PMlemon-spoon-91807
03/25/2019, 9:08 PMfierce-dinner-20116
03/25/2019, 9:08 PMlemon-spoon-91807
03/25/2019, 9:10 PMfierce-dinner-20116
03/25/2019, 9:10 PMlemon-spoon-91807
03/25/2019, 9:15 PMfierce-dinner-20116
03/25/2019, 9:16 PMlemon-spoon-91807
03/25/2019, 9:16 PMfierce-dinner-20116
03/25/2019, 9:17 PMus-west-2
as the default - I’m not sure why that’d cause this behavior thoughlemon-spoon-91807
03/25/2019, 9:18 PMfierce-dinner-20116
03/25/2019, 9:19 PMlemon-spoon-91807
03/25/2019, 9:19 PMfierce-dinner-20116
03/25/2019, 9:20 PMlemon-spoon-91807
03/25/2019, 9:20 PMfierce-dinner-20116
03/25/2019, 10:52 PM0.17.3
for awsx and it seems like it’s working now. Thanks again 👍lemon-spoon-91807
03/25/2019, 10:52 PM