/
exceptions.py
796 lines (604 loc) · 24.1 KB
/
exceptions.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
from moto.core.exceptions import RESTError
# EC2 has a custom root-tag - <Response> vs <ErrorResponse>
# `terraform destroy` will complain if the roottag is incorrect
# See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html#api-error-response
EC2_ERROR_RESPONSE = """<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Errors>
<Error>
<Code>{{error_type}}</Code>
<Message>{{message}}</Message>
</Error>
</Errors>
<{{request_id_tag}}>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</{{request_id_tag}}>
</Response>
"""
class EC2ClientError(RESTError):
code = 400
# EC2 uses <RequestID> as tag name in the XML response
request_id_tag_name = "RequestID"
def __init__(self, *args, **kwargs):
kwargs.setdefault("template", "custom_response")
self.templates["custom_response"] = EC2_ERROR_RESPONSE
super().__init__(*args, **kwargs)
class DefaultVpcAlreadyExists(EC2ClientError):
def __init__(self):
super().__init__(
"DefaultVpcAlreadyExists",
"A Default VPC already exists for this account in this region.",
)
class DependencyViolationError(EC2ClientError):
def __init__(self, message):
super().__init__("DependencyViolation", message)
class MissingParameterError(EC2ClientError):
def __init__(self, parameter):
super().__init__(
"MissingParameter",
"The request must contain the parameter {0}".format(parameter),
)
class InvalidDHCPOptionsIdError(EC2ClientError):
def __init__(self, dhcp_options_id):
super().__init__(
"InvalidDhcpOptionID.NotFound",
"DhcpOptionID {0} does not exist.".format(dhcp_options_id),
)
class InvalidRequest(EC2ClientError):
def __init__(self):
super().__init__("InvalidRequest", "The request received was invalid")
class InvalidParameterCombination(EC2ClientError):
def __init__(self, msg):
super().__init__("InvalidParameterCombination", msg)
class MalformedDHCPOptionsIdError(EC2ClientError):
def __init__(self, dhcp_options_id):
super().__init__(
"InvalidDhcpOptionsId.Malformed",
'Invalid id: "{0}" (expecting "dopt-...")'.format(dhcp_options_id),
)
class InvalidKeyPairNameError(EC2ClientError):
def __init__(self, key):
super().__init__(
"InvalidKeyPair.NotFound", "The keypair '{0}' does not exist.".format(key)
)
class InvalidKeyPairDuplicateError(EC2ClientError):
def __init__(self, key):
super().__init__(
"InvalidKeyPair.Duplicate", "The keypair '{0}' already exists.".format(key)
)
class InvalidKeyPairFormatError(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidKeyPair.Format", "Key is not in valid OpenSSH public key format"
)
class InvalidVPCIdError(EC2ClientError):
def __init__(self, vpc_id):
super().__init__(
"InvalidVpcID.NotFound", "VpcID {0} does not exist.".format(vpc_id)
)
class InvalidSubnetIdError(EC2ClientError):
def __init__(self, subnet_id):
super().__init__(
"InvalidSubnetID.NotFound",
"The subnet ID '{}' does not exist".format(subnet_id),
)
class InvalidFlowLogIdError(EC2ClientError):
def __init__(self, count, flow_log_ids):
super().__init__(
"InvalidFlowLogId.NotFound",
"These flow log ids in the input list are not found: [TotalCount: {0}] {1}".format(
count, flow_log_ids
),
)
class FlowLogAlreadyExists(EC2ClientError):
def __init__(self):
super().__init__(
"FlowLogAlreadyExists",
"Error. There is an existing Flow Log with the same configuration and log destination.",
)
class InvalidNetworkAclIdError(EC2ClientError):
def __init__(self, network_acl_id):
super().__init__(
"InvalidNetworkAclID.NotFound",
"The network acl ID '{0}' does not exist".format(network_acl_id),
)
class InvalidVpnGatewayIdError(EC2ClientError):
def __init__(self, vpn_gw):
super().__init__(
"InvalidVpnGatewayID.NotFound",
"The virtual private gateway ID '{0}' does not exist".format(vpn_gw),
)
class InvalidVpnGatewayAttachmentError(EC2ClientError):
def __init__(self, vpn_gw, vpc_id):
super().__init__(
"InvalidVpnGatewayAttachment.NotFound",
"The attachment with vpn gateway ID '{}' and vpc ID '{}' does not exist".format(
vpn_gw, vpc_id
),
)
class InvalidVpnConnectionIdError(EC2ClientError):
def __init__(self, network_acl_id):
super().__init__(
"InvalidVpnConnectionID.NotFound",
"The vpnConnection ID '{0}' does not exist".format(network_acl_id),
)
class InvalidCustomerGatewayIdError(EC2ClientError):
def __init__(self, customer_gateway_id):
super().__init__(
"InvalidCustomerGatewayID.NotFound",
"The customer gateway ID '{0}' does not exist".format(customer_gateway_id),
)
class InvalidNetworkInterfaceIdError(EC2ClientError):
def __init__(self, eni_id):
super().__init__(
"InvalidNetworkInterfaceID.NotFound",
"The network interface ID '{0}' does not exist".format(eni_id),
)
class InvalidNetworkAttachmentIdError(EC2ClientError):
def __init__(self, attachment_id):
super().__init__(
"InvalidAttachmentID.NotFound",
"The network interface attachment ID '{0}' does not exist".format(
attachment_id
),
)
class InvalidSecurityGroupDuplicateError(EC2ClientError):
def __init__(self, name):
super().__init__(
"InvalidGroup.Duplicate",
"The security group '{0}' already exists".format(name),
)
class InvalidSecurityGroupNotFoundError(EC2ClientError):
def __init__(self, name):
super().__init__(
"InvalidGroup.NotFound",
"The security group '{0}' does not exist".format(name),
)
class InvalidPermissionNotFoundError(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidPermission.NotFound",
"The specified rule does not exist in this security group",
)
class InvalidPermissionDuplicateError(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidPermission.Duplicate", "The specified rule already exists"
)
class InvalidRouteTableIdError(EC2ClientError):
def __init__(self, route_table_id):
super().__init__(
"InvalidRouteTableID.NotFound",
"The routeTable ID '{0}' does not exist".format(route_table_id),
)
class InvalidRouteError(EC2ClientError):
def __init__(self, route_table_id, cidr):
super().__init__(
"InvalidRoute.NotFound",
"no route with destination-cidr-block {0} in route table {1}".format(
cidr, route_table_id
),
)
class RouteAlreadyExistsError(EC2ClientError):
def __init__(self, cidr):
super().__init__(
"RouteAlreadyExists",
"The route identified by {0} already exists".format(cidr),
)
class InvalidInstanceIdError(EC2ClientError):
def __init__(self, instance_id):
if isinstance(instance_id, str):
instance_id = [instance_id]
if len(instance_id) > 1:
msg = f"The instance IDs '{', '.join(instance_id)}' do not exist"
else:
msg = f"The instance ID '{instance_id[0]}' does not exist"
super().__init__("InvalidInstanceID.NotFound", msg)
class InvalidInstanceTypeError(EC2ClientError):
def __init__(self, instance_type):
super().__init__(
"InvalidInstanceType.NotFound",
"The instance type '{0}' does not exist".format(instance_type),
)
class InvalidAMIIdError(EC2ClientError):
def __init__(self, ami_id):
super().__init__(
"InvalidAMIID.NotFound",
"The image id '[{0}]' does not exist".format(ami_id),
)
class UnvailableAMIIdError(EC2ClientError):
def __init__(self, ami_id):
super().__init__(
"InvalidAMIID.Unavailable",
"The image id '[{0}]' is no longer available".format(ami_id),
)
class InvalidAMIAttributeItemValueError(EC2ClientError):
def __init__(self, attribute, value):
super().__init__(
"InvalidAMIAttributeItemValue",
'Invalid attribute item value "{0}" for {1} item type.'.format(
value, attribute
),
)
class MalformedAMIIdError(EC2ClientError):
def __init__(self, ami_id):
super().__init__(
"InvalidAMIID.Malformed",
'Invalid id: "{0}" (expecting "ami-...")'.format(ami_id),
)
class InvalidSnapshotIdError(EC2ClientError):
def __init__(self):
# Note: AWS returns empty message for this, as of 2014.08.22.
super().__init__("InvalidSnapshot.NotFound", "")
class InvalidSnapshotInUse(EC2ClientError):
def __init__(self, snapshot_id, ami_id):
super().__init__(
"InvalidSnapshot.InUse",
f"The snapshot {snapshot_id} is currently in use by {ami_id}",
)
class InvalidVolumeIdError(EC2ClientError):
def __init__(self, volume_id):
super().__init__(
"InvalidVolume.NotFound",
"The volume '{0}' does not exist.".format(volume_id),
)
class InvalidVolumeAttachmentError(EC2ClientError):
def __init__(self, volume_id, instance_id):
super().__init__(
"InvalidAttachment.NotFound",
"Volume {0} can not be detached from {1} because it is not attached".format(
volume_id, instance_id
),
)
class InvalidVolumeDetachmentError(EC2ClientError):
def __init__(self, volume_id, instance_id, device):
super().__init__(
"InvalidAttachment.NotFound",
"The volume {0} is not attached to instance {1} as device {2}".format(
volume_id, instance_id, device
),
)
class VolumeInUseError(EC2ClientError):
def __init__(self, volume_id, instance_id):
super().__init__(
"VolumeInUse",
"Volume {0} is currently attached to {1}".format(volume_id, instance_id),
)
class InvalidDomainError(EC2ClientError):
def __init__(self, domain):
super().__init__(
"InvalidParameterValue", "Invalid value '{0}' for domain.".format(domain)
)
class InvalidAddressError(EC2ClientError):
def __init__(self, ip):
super().__init__(
"InvalidAddress.NotFound", "Address '{0}' not found.".format(ip)
)
class LogDestinationNotFoundError(EC2ClientError):
def __init__(self, bucket_name):
super().__init__(
"LogDestinationNotFoundException",
"LogDestination: '{0}' does not exist.".format(bucket_name),
)
class InvalidAllocationIdError(EC2ClientError):
def __init__(self, allocation_id):
super().__init__(
"InvalidAllocationID.NotFound",
"Allocation ID '{0}' not found.".format(allocation_id),
)
class InvalidAssociationIdError(EC2ClientError):
def __init__(self, association_id):
super().__init__(
"InvalidAssociationID.NotFound",
"Association ID '{0}' not found.".format(association_id),
)
class InvalidVpcCidrBlockAssociationIdError(EC2ClientError):
def __init__(self, association_id):
super().__init__(
"InvalidVpcCidrBlockAssociationIdError.NotFound",
"The vpc CIDR block association ID '{0}' does not exist".format(
association_id
),
)
class InvalidVPCPeeringConnectionIdError(EC2ClientError):
def __init__(self, vpc_peering_connection_id):
super().__init__(
"InvalidVpcPeeringConnectionId.NotFound",
"VpcPeeringConnectionID {0} does not exist.".format(
vpc_peering_connection_id
),
)
class InvalidVPCPeeringConnectionStateTransitionError(EC2ClientError):
def __init__(self, vpc_peering_connection_id):
super().__init__(
"InvalidStateTransition",
"VpcPeeringConnectionID {0} is not in the correct state for the request.".format(
vpc_peering_connection_id
),
)
class InvalidServiceName(EC2ClientError):
def __init__(self, service_name):
super().__init__(
"InvalidServiceName",
f"The Vpc Endpoint Service '{service_name}' does not exist",
)
class InvalidFilter(EC2ClientError):
def __init__(self, filter_name):
super().__init__("InvalidFilter", f"The filter '{filter_name}' is invalid")
class InvalidNextToken(EC2ClientError):
def __init__(self, next_token):
super().__init__("InvalidNextToken", f"The token '{next_token}' is invalid")
class InvalidDependantParameterError(EC2ClientError):
def __init__(self, dependant_parameter, parameter, parameter_value):
super().__init__(
"InvalidParameter",
"{0} can't be empty if {1} is {2}.".format(
dependant_parameter, parameter, parameter_value
),
)
class InvalidDependantParameterTypeError(EC2ClientError):
def __init__(self, dependant_parameter, parameter_value, parameter):
super().__init__(
"InvalidParameter",
"{0} type must be {1} if {2} is provided.".format(
dependant_parameter, parameter_value, parameter
),
)
class InvalidAggregationIntervalParameterError(EC2ClientError):
def __init__(self, parameter):
super().__init__("InvalidParameter", "Invalid {0}".format(parameter))
class InvalidParameterValueError(EC2ClientError):
def __init__(self, parameter_value):
super().__init__(
"InvalidParameterValue",
"Value {0} is invalid for parameter.".format(parameter_value),
)
class EmptyTagSpecError(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidParameterValue", "Tag specification must have at least one tag"
)
class InvalidParameterValueErrorTagNull(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidParameterValue",
"Tag value cannot be null. Use empty string instead.",
)
class InvalidParameterValueErrorUnknownAttribute(EC2ClientError):
def __init__(self, parameter_value):
super().__init__(
"InvalidParameterValue",
"Value ({0}) for parameter attribute is invalid. Unknown attribute.".format(
parameter_value
),
)
class InvalidGatewayIDError(EC2ClientError):
def __init__(self, gateway_id):
super().__init__(
"InvalidGatewayID.NotFound",
"The eigw ID '{0}' does not exist".format(gateway_id),
)
class InvalidInternetGatewayIdError(EC2ClientError):
def __init__(self, internet_gateway_id):
super().__init__(
"InvalidInternetGatewayID.NotFound",
"InternetGatewayID {0} does not exist.".format(internet_gateway_id),
)
class GatewayNotAttachedError(EC2ClientError):
def __init__(self, internet_gateway_id, vpc_id):
super().__init__(
"Gateway.NotAttached",
"InternetGatewayID {0} is not attached to a VPC {1}.".format(
internet_gateway_id, vpc_id
),
)
class ResourceAlreadyAssociatedError(EC2ClientError):
def __init__(self, resource_id):
super().__init__(
"Resource.AlreadyAssociated",
"Resource {0} is already associated.".format(resource_id),
)
class TagLimitExceeded(EC2ClientError):
def __init__(self):
super().__init__(
"TagLimitExceeded",
"The maximum number of Tags for a resource has been reached.",
)
class InvalidID(EC2ClientError):
def __init__(self, resource_id):
super().__init__("InvalidID", "The ID '{0}' is not valid".format(resource_id))
class InvalidCIDRSubnetError(EC2ClientError):
def __init__(self, cidr):
super().__init__(
"InvalidParameterValue",
"invalid CIDR subnet specification: {0}".format(cidr),
)
class RulesPerSecurityGroupLimitExceededError(EC2ClientError):
def __init__(self):
super().__init__(
"RulesPerSecurityGroupLimitExceeded",
"The maximum number of rules per security group " "has been reached.",
)
class MotoNotImplementedError(NotImplementedError):
def __init__(self, blurb):
super().__init__(
"{0} has not been implemented in Moto yet."
" Feel free to open an issue at"
" https://github.com/spulec/moto/issues".format(blurb)
)
class FilterNotImplementedError(MotoNotImplementedError):
def __init__(self, filter_name, method_name):
super().__init__("The filter '{0}' for {1}".format(filter_name, method_name))
class CidrLimitExceeded(EC2ClientError):
def __init__(self, vpc_id, max_cidr_limit):
super().__init__(
"CidrLimitExceeded",
"This network '{0}' has met its maximum number of allowed CIDRs: {1}".format(
vpc_id, max_cidr_limit
),
)
class UnsupportedTenancy(EC2ClientError):
def __init__(self, tenancy):
super().__init__(
"UnsupportedTenancy",
"The tenancy value {0} is not supported.".format(tenancy),
)
class OperationNotPermitted(EC2ClientError):
def __init__(self, association_id):
super().__init__(
"OperationNotPermitted",
"The vpc CIDR block with association ID {} may not be disassociated. "
"It is the primary IPv4 CIDR block of the VPC".format(association_id),
)
class InvalidAvailabilityZoneError(EC2ClientError):
def __init__(self, availability_zone_value, valid_availability_zones):
super().__init__(
"InvalidParameterValue",
"Value ({0}) for parameter availabilityZone is invalid. "
"Subnets can currently only be created in the following availability zones: {1}.".format(
availability_zone_value, valid_availability_zones
),
)
class AvailabilityZoneNotFromRegionError(EC2ClientError):
def __init__(self, availability_zone_value):
super().__init__(
"InvalidParameterValue",
"Invalid Availability Zone ({0})".format(availability_zone_value),
)
class NetworkAclEntryAlreadyExistsError(EC2ClientError):
def __init__(self, rule_number):
super().__init__(
"NetworkAclEntryAlreadyExists",
"The network acl entry identified by {} already exists.".format(
rule_number
),
)
class InvalidSubnetRangeError(EC2ClientError):
def __init__(self, cidr_block):
super().__init__(
"InvalidSubnet.Range", "The CIDR '{}' is invalid.".format(cidr_block)
)
class InvalidCIDRBlockParameterError(EC2ClientError):
def __init__(self, cidr_block):
super().__init__(
"InvalidParameterValue",
"Value ({}) for parameter cidrBlock is invalid. This is not a valid CIDR block.".format(
cidr_block
),
)
class InvalidDestinationCIDRBlockParameterError(EC2ClientError):
def __init__(self, cidr_block):
super().__init__(
"InvalidParameterValue",
"Value ({}) for parameter destinationCidrBlock is invalid. This is not a valid CIDR block.".format(
cidr_block
),
)
class InvalidSubnetConflictError(EC2ClientError):
def __init__(self, cidr_block):
super().__init__(
"InvalidSubnet.Conflict",
"The CIDR '{}' conflicts with another subnet".format(cidr_block),
)
class InvalidVPCRangeError(EC2ClientError):
def __init__(self, cidr_block):
super().__init__(
"InvalidVpc.Range", "The CIDR '{}' is invalid.".format(cidr_block)
)
# accept exception
class OperationNotPermitted2(EC2ClientError):
def __init__(self, client_region, pcx_id, acceptor_region):
super().__init__(
"OperationNotPermitted",
"Incorrect region ({0}) specified for this request."
"VPC peering connection {1} must be accepted in region {2}".format(
client_region, pcx_id, acceptor_region
),
)
# reject exception
class OperationNotPermitted3(EC2ClientError):
def __init__(self, client_region, pcx_id, acceptor_region):
super().__init__(
"OperationNotPermitted",
"Incorrect region ({0}) specified for this request."
"VPC peering connection {1} must be accepted or rejected in region {2}".format(
client_region, pcx_id, acceptor_region
),
)
class OperationNotPermitted4(EC2ClientError):
def __init__(self, instance_id):
super().__init__(
"OperationNotPermitted",
"The instance '{0}' may not be terminated. Modify its 'disableApiTermination' "
"instance attribute and try again.".format(instance_id),
)
class InvalidLaunchTemplateNameError(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidLaunchTemplateName.AlreadyExistsException",
"Launch template name already in use.",
)
class InvalidParameterDependency(EC2ClientError):
def __init__(self, param, param_needed):
super().__init__(
"InvalidParameterDependency",
"The parameter [{0}] requires the parameter {1} to be set.".format(
param, param_needed
),
)
class IncorrectStateIamProfileAssociationError(EC2ClientError):
def __init__(self, instance_id):
super().__init__(
"IncorrectState",
"There is an existing association for instance {0}".format(instance_id),
)
class InvalidAssociationIDIamProfileAssociationError(EC2ClientError):
def __init__(self, association_id):
super().__init__(
"InvalidAssociationID.NotFound",
"An invalid association-id of '{0}' was given".format(association_id),
)
class InvalidVpcEndPointIdError(EC2ClientError):
def __init__(self, vpc_end_point_id):
super().__init__(
"InvalidVpcEndpointId.NotFound",
"The VpcEndPoint ID '{0}' does not exist".format(vpc_end_point_id),
)
class InvalidTaggableResourceType(EC2ClientError):
def __init__(self, resource_type):
super().__init__(
"InvalidParameterValue",
"'{}' is not a valid taggable resource type for this operation.".format(
resource_type
),
)
class GenericInvalidParameterValueError(EC2ClientError):
def __init__(self, attribute, value):
super().__init__(
"InvalidParameterValue",
"invalid value for parameter {0}: {1}".format(attribute, value),
)
class InvalidSubnetCidrBlockAssociationID(EC2ClientError):
def __init__(self, association_id):
super().__init__(
"InvalidSubnetCidrBlockAssociationID.NotFound",
"The subnet CIDR block with association ID '{0}' does not exist".format(
association_id
),
)
class InvalidCarrierGatewayID(EC2ClientError):
def __init__(self, carrier_gateway_id):
super().__init__(
"InvalidCarrierGatewayID.NotFound",
"The CarrierGateway ID '{0}' does not exist".format(carrier_gateway_id),
)
class NoLoadBalancersProvided(EC2ClientError):
def __init__(self):
super().__init__(
"InvalidParameter",
"exactly one of network_load_balancer_arn or gateway_load_balancer_arn is a required member",
)
class UnknownVpcEndpointService(EC2ClientError):
def __init__(self, service_id):
super().__init__(
"InvalidVpcEndpointServiceId.NotFound",
f"The VpcEndpointService Id '{service_id}' does not exist",
)