server-control-s3 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,7 +65,7 @@ sc.init(app, {
65
65
  {
66
66
  "Effect": "Allow",
67
67
  "Action": "iam:PassRole",
68
- "Resource": "arn:aws:iam::833562685972:role/<rolename>"
68
+ "Resource": "arn:aws:iam::<orgid>:role/<rolename>"
69
69
  }
70
70
  ]
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "server-control-s3",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "author": {
5
5
  "name": "Jim Lake"
6
6
  },
package/src/index.js CHANGED
@@ -251,22 +251,25 @@ function _getGroupData(done) {
251
251
  );
252
252
  },
253
253
  (done) => {
254
+ const lt =
255
+ asg.LaunchTemplate ||
256
+ asg.MixedInstancesPolicy?.LaunchTemplate?.LaunchTemplateSpecification;
254
257
  const opts = {
255
- LaunchTemplateId: asg.LaunchTemplate.LaunchTemplateId,
256
- Versions: [asg.LaunchTemplate.Version],
258
+ LaunchTemplateId: lt?.LaunchTemplateId,
259
+ Versions: [lt?.Version],
257
260
  };
258
261
  ec2.describeLaunchTemplateVersions(opts, (err, data) => {
259
262
  if (err) {
260
263
  _errorLog('_getGroupData: launch template fetch error:', err);
261
- } else if (data && data.LaunchTemplateVersions.length === 0) {
262
- err = 'launch_template_not_found';
263
- } else {
264
+ } else if (data?.LaunchTemplateVersions?.length > 0) {
264
265
  launch_template = data.LaunchTemplateVersions[0];
265
266
  const ud = launch_template.LaunchTemplateData.UserData;
266
267
  if (ud) {
267
268
  const s = Buffer.from(ud, 'base64').toString('utf8');
268
269
  launch_template.LaunchTemplateData.UserData = s;
269
270
  }
271
+ } else {
272
+ err = 'launch_template_not_found';
270
273
  }
271
274
  done(err);
272
275
  });