1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| var in_params: EC2.CreateNetworkAclEntryRequest = { CidrBlock: ipv4 + '/24', Egress: false, NetworkAclId: aclId, Protocol: `6`, PortRange: { From: 80, To: 443 }, RuleAction: 'deny', RuleNumber: acl_cnt, };
const method = mode === 'create' ? 'createNetworkAclEntry' : 'replaceNetworkAclEntry';
return new Promise((resolve, reject) => { ec2[method](in_params, function (err, data) { if (err) { console.log(err.message, acl_cnt);
return reject(err.message); } else { console.log('Create AclEntry Successful : \n', in_params); resolve(in_params); } }); });
|