sparse-intern-71089
04/08/2019, 7:15 PMwhite-balloon-205
import * as awsx from "@pulumi/awsx"
at the top of your file?prehistoric-caravan-46299
04/08/2019, 7:25 PMwhite-balloon-205
prehistoric-caravan-46299
04/08/2019, 7:29 PMpulumi:pulumi:Stack (container-quickstart-dev):
Found incompatible versions of @pulumi/pulumi. Differing major or minor versions are not supported.
Version 0.16.19 referenced at node_modules/@pulumi/aws-infra/node_modules/@pulumi/pulumi/package.json
Version 0.17.5 referenced at node_modules/@pulumi/pulumi/package.json
error: Running program '/Users/sean/container-quickstart' failed with an unhandled exception:
TSError: ⨯ Unable to compile TypeScript:
index.ts(1,23): error TS2307: Cannot find module '@pulumi/awsx'.
index.ts(23,51): error TS7006: Parameter 'e' implicitly has an 'any' type
prehistoric-caravan-46299
04/08/2019, 7:37 PM@pulumi/awsx
prehistoric-caravan-46299
04/08/2019, 7:37 PMwhite-balloon-205
npm intall @pulumi/awsx
to install the awsx
package.prehistoric-caravan-46299
04/08/2019, 7:41 PMwhite-balloon-205
white-balloon-205
lemon-spoon-91807
04/08/2019, 7:46 PMlemon-spoon-91807
04/08/2019, 7:46 PMlemon-spoon-91807
04/08/2019, 7:49 PM@pulumi/awsx
bitlemon-spoon-91807
04/08/2019, 7:50 PMhttp://${e.hostname}
);``lemon-spoon-91807
04/08/2019, 7:50 PMhttp://${e.hostname}
);``lemon-spoon-91807
04/08/2019, 7:50 PMlemon-spoon-91807
04/08/2019, 7:57 PMlemon-spoon-91807
04/08/2019, 8:13 PMprehistoric-caravan-46299
04/08/2019, 8:46 PMimport * as awsx from "@pulumi/awsx"
// Create an elastic network listener to listen for requests and route them to the container.
// See <https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html>
// for more details.
let listener = new awsx.elasticloadbalancingv2.NetworkListener("nginx", { port: 80 });
// Define the service to run. We pass in the listener to hook up the network load balancer
// to the containers the service will launch.
let service = new awsx.ecs.FargateService("nginx", {
desiredCount: 2,
taskDefinitionArgs: {
containers: {
nginx: {
image: awsx.ecs.Image.fromPath("./app"),
memory: 512,
portMappings: [listener],
},
},
},
});
// export just the hostname property of the container frontend
export const hostname = listener.endpoint.apply(e => `http://${e.hostname}`);
prehistoric-caravan-46299
04/08/2019, 8:51 PMlemon-spoon-91807
04/08/2019, 8:51 PMlemon-spoon-91807
04/08/2019, 8:51 PMlemon-spoon-91807
04/08/2019, 8:51 PMlemon-spoon-91807
04/08/2019, 8:51 PMlemon-spoon-91807
04/08/2019, 8:52 PM...fromPath("nginx", "./app")
lemon-spoon-91807
04/08/2019, 9:29 PMlemon-spoon-91807
04/08/2019, 9:29 PM