Skip to content

Commit

Permalink
Use vpc_security_group_ids instead of security_groups. (pulumi#600)
Browse files Browse the repository at this point in the history
`security_groups` doesn't allow for updates while `vpc_security_group_ids` does. See pulumi/pulumi-aws#852 for more context.

Also, updated `Buffer` usage based on https://nodejs.org/fr/docs/guides/buffer-constructor-deprecation/.
  • Loading branch information
Cameron Stokes committed Mar 11, 2020
1 parent 7f1b58c commit 9df507d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aws-cs-webserver/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static Task<int> Main()
var server = new Instance("web-server-www", new InstanceArgs
{
InstanceType = Size,
SecurityGroups = { group.Name },
VpcSecurityGroupIds = { group.Id },
UserData = userData,
Ami = ami.Id,
});
Expand Down
2 changes: 1 addition & 1 deletion aws-js-webserver-component/webserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports.createInstance = function (name, size) {
return new aws.ec2.Instance(name, {
tags: { "Name": name },
instanceType: size,
securityGroups: [ group.name ], // reference the group object above
vpcSecurityGroupIds: [ group.id ], // reference the group object above
ami: ami,
userData: userData // start a simple web server
});
Expand Down
4 changes: 2 additions & 2 deletions aws-js-webserver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ nohup python -m SimpleHTTPServer 80 &`;
let server = new aws.ec2.Instance("web-server-www", {
tags: { "Name": "web-server-www" },
instanceType: size,
securityGroups: [ group.name ], // reference the group object above
vpcSecurityGroupIds: [ group.id ], // reference the group object above
ami: ami,
userData: userData // start a simple web server
});

exports.publicIp = server.publicIp;
exports.publicHostName = server.publicDns;
exports.publicHostName = server.publicDns;
2 changes: 1 addition & 1 deletion aws-py-webserver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

server = aws.ec2.Instance('web-server-www',
instance_type=size,
security_groups=[group.name],
vpc_security_group_ids=[group.id],
user_data=user_data,
ami=ami.id)

Expand Down
4 changes: 2 additions & 2 deletions aws-ts-ec2-provisioners/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const privateKey = config.requireSecret("privateKey").apply(key => {
if (key.startsWith("-----BEGIN RSA PRIVATE KEY-----")) {
return key;
} else {
return new Buffer(key, "base64").toString("ascii");
return Buffer.from(key, "base64").toString("ascii");
}
});
const privateKeyPassphrase = config.getSecret("privateKeyPassphrase");
Expand Down Expand Up @@ -52,7 +52,7 @@ const server = new aws.ec2.Instance("server", {
instanceType: size,
ami: amiId,
keyName: keyName,
securityGroups: [ secgrp.name ],
vpcSecurityGroupIds: [ secgrp.id ],
});
const conn = {
host: server.publicIp,
Expand Down
2 changes: 1 addition & 1 deletion aws-ts-ruby-on-rails/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const amiId = aws.getAmi({
const webServer = new aws.ec2.Instance("webServer", {
ami: amiId,
instanceType: config.instanceType,
securityGroups: [ webSg.name ],
vpcSecurityGroupIds: [ webSg.id ],
userData: createUserData(
[ "install_ruby_2_3_1", "install_mysql", "configure_mysql", "install_application" ],
{
Expand Down

0 comments on commit 9df507d

Please sign in to comment.