File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ var Client = exports.Client = function (options) {
1616
1717 // Allow overriding serversUrl in child classes
1818 this . provider = 'amazon' ;
19+ this . securityGroup = options . securityGroup ;
20+ this . securityGroupId = options . securityGroupId ;
1921 this . version = options . version || '2012-04-01' ;
2022 this . serversUrl = options . serversUrl
2123 || this . serversUrl
Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ exports.createServer = function createServer(options, callback) {
137137 MinCount : 1 ,
138138 MaxCount : 1
139139 } ,
140- securityGroup ;
140+ securityGroup ,
141+ securityGroupId ;
141142
142143 if ( ! options . image ) {
143144 return errs . handle (
@@ -148,6 +149,16 @@ exports.createServer = function createServer(options, callback) {
148149 ) ;
149150 }
150151
152+ securityGroup = this . securityGroup || options [ 'SecurityGroup' ] ;
153+ if ( securityGroup ) {
154+ createOptions [ 'SecurityGroup' ] = securityGroup ;
155+ }
156+
157+ securityGroupId = this . securityGroupId || options [ 'SecurityGroupId' ] ;
158+ if ( securityGroupId ) {
159+ createOptions [ 'SecurityGroupId' ] = securityGroupId ;
160+ }
161+
151162 createOptions . ImageId = options . image instanceof base . Image
152163 ? options . image . id
153164 : options . image ;
@@ -167,11 +178,6 @@ exports.createServer = function createServer(options, callback) {
167178 || options [ 'Placement.AvailabilityZone' ] ;
168179 }
169180
170- securityGroup = options . securityGroup || options [ 'SecurityGroup' ] ;
171- if ( securityGroup ) {
172- createOptions [ 'SecurityGroup' ] = securityGroup ;
173- }
174-
175181 return this . query (
176182 'RunInstances' ,
177183 createOptions ,
You can’t perform that action at this time.
0 commit comments