diff --git a/lib/models/model-api.ts b/lib/models/model-api.ts index d3c41c5..cdb2224 100644 --- a/lib/models/model-api.ts +++ b/lib/models/model-api.ts @@ -179,7 +179,6 @@ export class ModelsApi extends Construct { new PolicyStatement({ effect: Effect.ALLOW, actions: [ - 'ec2:TerminateInstances', 'ec2:CreateNetworkInterface', 'ec2:DescribeNetworkInterfaces', 'ec2:DescribeSubnets', @@ -188,6 +187,13 @@ export class ModelsApi extends Construct { 'ec2:UnassignPrivateIpAddresses' ], resources: ['*'], + }), + new PolicyStatement({ + effect: Effect.ALLOW, + actions: [ + 'ec2:TerminateInstances' + ], + resources: ['*'], conditions: { 'StringEquals': {'aws:ResourceTag/lisa_temporary_instance': 'true'} }