'use strict'; const AWS = require('aws-sdk'); const ec2 = new AWS.EC2(); exports.handler = (event, context, callback) => { const generator = (function *() { try { // スナップショットを取得する対象のEBSボリュームIDに変更します。 const volumeId = 'vol-xxxxxxxx'; // 任意のタグ名 const tagName = 'xxxx-snapshot'; // バックアップ保持世代数 const retention = 7; // スナップショットを作成 const snapshotId = yield createSnapshot(volumeId, generator); // タグ付け yie