Skip to content

Commit

Permalink
Do not hard code AMI in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ellismg committed Jun 25, 2019
1 parent 5549245 commit 21b223b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 9 additions & 6 deletions aws-js-webserver-component/webserver.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"use strict";

const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");

// let ami = "ami-7172b611" // AMI for Amazon Linux in us-west-2 (Oregon)
let ami = "ami-c55673a0" // AMI for us-east-2 (Ohio)
// let ami = "ami-6869aa05" // AMI for us-east-1 (Virginia)
// let ami = "ami-31490d51" // AMI for us-west-1 (California)
// let ami = "ami-f9dd458a" // AMI for eu-west-1 (Ireland)
// let ami = "ami-ea26ce85" // AMI for eu-central-1 (Frankfurt)
// Get the id for the latest Amazon Linux AMI
let ami = pulumi.output(aws.getAmi({
filters: [
{ name: "name", values: ["amzn-ami-hvm-*-x86_64-ebs"] },
],
owners: ["137112412989"], // Amazon
mostRecent: true,
})).apply(result => result.id);

// create a new security group for port 80
let group = new aws.ec2.SecurityGroup("web-secgrp", {
Expand Down
15 changes: 9 additions & 6 deletions aws-js-webserver/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"use strict";

const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");

let size = "t2.micro"; // t2.micro is available in the AWS free tier

// let ami = "ami-7172b611" // AMI for Amazon Linux in us-west-2 (Oregon)
let ami = "ami-c55673a0" // AMI for us-east-2 (Ohio)
// let ami = "ami-6869aa05" // AMI for us-east-1 (Virginia)
// let ami = "ami-31490d51" // AMI for us-west-1 (California)
// let ami = "ami-f9dd458a" // AMI for eu-west-1 (Ireland)
// let ami = "ami-ea26ce85" // AMI for eu-central-1 (Frankfurt)
// Get the id for the latest Amazon Linux AMI
let ami = pulumi.output(aws.getAmi({
filters: [
{ name: "name", values: ["amzn-ami-hvm-*-x86_64-ebs"] },
],
owners: ["137112412989"], // Amazon
mostRecent: true,
})).apply(result => result.id);

// create a new security group for port 80
let group = new aws.ec2.SecurityGroup("web-secgrp", {
Expand Down

0 comments on commit 21b223b

Please sign in to comment.