Commit Graph

701 Commits

Author SHA1 Message Date
Felipe Marinho
ccadde5d32
EC2: support launch template tags (#5381) 2022-08-23 14:52:42 +00:00
Bert Blommers
3fbcac5820
Admin - Update static content (#5395) 2022-08-18 10:54:38 +00:00
Bert Blommers
9e1d78d44e
TechDebt - remove warnings from tests (#5390) 2022-08-17 14:01:22 +00:00
Bert Blommers
3d913f8f15
MultiAccount support (#5192) 2022-08-13 09:49:43 +00:00
Felipe Marinho
f743567789
EC2: Add ec2 fleets basic api (#5367) 2022-08-12 09:33:39 +00:00
Viren Nadkarni
e9c5cb2308
EC2: Generate IDs for all key pairs (#5370) 2022-08-10 21:29:54 +00:00
Johannes Loewe
b40c9760c1
EC2: handle non-existent template name for describe-launch-templates (#5365) 2022-08-10 19:17:30 +00:00
Brian Pandola
f701875334
Fix: KeyName should not be in ec2:DescribeInstances response if value is None (#5347)
AWS does not serialize NULL values.
2022-07-30 14:12:57 -07:00
Brian Pandola
be6e02e5fa
Add key-name filter for ec2:DescribeInstances (#5338) 2022-07-27 00:19:47 -07:00
Guilherme Martins Crocetti
515faca8aa
Add extra keys to EC2 describe-addresses operation (#5306) 2022-07-26 20:39:32 -03:00
Bert Blommers
6d68a5176b
EC2: create_customer_gateway - support PublicIp and IpAddress (#5253) 2022-06-22 21:05:44 +00:00
Michael Merrill
c3f06064ff
feature: handle overlapping routes (#5187) (#5233) 2022-06-15 21:14:29 +00:00
Bert Blommers
e15c16eaed
EC2 - Error when passing in TagSpec with 0 tags (#5216) 2022-06-12 10:15:25 +00:00
Bert Blommers
8a8eaff547
EC2 - create_default_vpc (#5212) 2022-06-10 12:05:10 +00:00
Thomas Rausch
68b93c3b86
add ec2 network-acl egress filter (#5174) 2022-05-29 16:39:19 +00:00
szopen321
6b14d01f5d
EC2 - Add ami validation (#5160) 2022-05-26 16:04:36 +00:00
szopen321
e8ea958444
EC2 - Add keypair validation (#5152) 2022-05-25 14:18:03 +00:00
Brian Pandola
ab756c82b8
Add route.gateway-id filter for ec2:DescribeRouteTables (#5155) 2022-05-22 09:43:51 +00:00
szopen321
dbcee3c196
Add instance type validation on add instance method (#5132) 2022-05-18 17:51:51 +00:00
szopen321
c59583c15b
Add availability zone check on add instance (#5129) 2022-05-16 16:58:14 +00:00
Brian Pandola
f65d3970aa Add Ipv6Native field to ec2:Subnet response templates
This is currently just a placeholder because Moto does not yet fully support
Ipv6 subnets, but it is included in the Ipv4 subnet responses (set to `False`).
2022-05-13 19:39:00 -07:00
Bert Blommers
ac03044c96
EC2:describe_vpc_endpoints() - filter by vpc-endpoint-type (#5110) 2022-05-09 13:06:01 +00:00
Bert Blommers
406ca1d8f9
Admin - Move internal EC2 models (#5090) 2022-05-03 11:40:15 +00:00
Bert Blommers
cb4cbd1f5b
EC2 - Spot Requests improvements (#5087) 2022-05-02 15:00:06 +00:00
Bert Blommers
3b68be55d3
EC2 - Pass LaunchTemplate tags to new Instances (#5085) 2022-05-01 19:27:25 +00:00
Bert Blommers
6b70cd1b6b
EC2 SpotFleetRequests - support LaunchTemplates (#5084) 2022-05-01 13:52:38 +00:00
Bert Blommers
d60df32a25
Upgrade flake8 to 4.x (#5066) 2022-04-27 11:58:59 +00:00
Viren Nadkarni
afe4b3ace9
EC2: More filters for DescribeNetworkAcls (#5049) 2022-04-25 20:14:00 +00:00
Bert Blommers
752eee1941
Autoscaling - create custom BlockDevice in addition to default image block device (#5050) 2022-04-22 15:40:30 +00:00
Bert Blommers
10bd677cf2
Admin - enable more Pylint rules (#5037) 2022-04-18 20:44:56 +00:00
Bert Blommers
48e3cbec99
EC2 - search_transit_gateway_routes -search by CIDR (#5020) 2022-04-11 19:43:33 +00:00
Bert Blommers
43b987427f
Refactor EC2 models into separate files (#5003) 2022-04-04 17:51:11 +00:00
George Lungley
b5f03b0a0e
EC2 - implement network attachments (#4998) 2022-04-04 10:17:22 +00:00
Bert Blommers
cf2690ca1e
Improvements - Autoscaling (#4985) 2022-03-29 21:46:06 +00:00
Bert Blommers
eafd5f3dbb
EC2:run_instances() - fix bug when supplying the NIC with security groups (#4975) 2022-03-27 14:32:37 +00:00
Bert Blommers
f9d116f871
Prepare release 3.1.0 (#4938) 2022-03-12 18:01:42 -01:00
Bert Blommers
eed32a5f72
Pylint - Enable more rules on source and tests-directory (#4929) 2022-03-11 20:28:45 -01:00
Bert Blommers
29d01c35bc
Update Black + formatting (#4926) 2022-03-10 13:39:59 -01:00
Bert Blommers
1d7440914e
EC2:terminate() - fix error message (#4915) 2022-03-07 21:25:35 -01:00
Bert Blommers
86e1fe8f1c
CF - Support for VPCEndpoint (#4908) 2022-03-03 21:43:25 -01:00
Tim Snyder
2957a51e4e
refactor scripts/get_amis.py into moto.ec2.utils.gen_moto_amis() (#4867) 2022-02-17 12:38:31 -01:00
Bert Blommers
a7e169a545
EC2 performance improvements (#4855) 2022-02-14 21:40:48 -01:00
Tim Snyder
ea81377cd0
handle 'NoDevice' parameter in BlockDeviceMappings #4852 (#4853) 2022-02-14 08:37:46 -01:00
Daniel Fangl
87dfa2e922
correctly filter describe_managed_prefix_lists, add test for the behavior (#4837) 2022-02-07 18:07:15 -01:00
Edison Gustavo Muenz
32373d2ac5
ec2: Add GpuInfo to describe_instance_types (#4828) 2022-02-07 14:13:50 -01:00
Bert Blommers
2fd6f34060
EC2 - VpcEndpointServiceConfiguration (#4815) 2022-01-30 22:00:26 -01:00
Bert Blommers
d53dd23390
EC2 - create_snapshots (#4767) 2022-01-25 09:27:02 -01:00
Bert Blommers
a67412a5a9
Prep release 3.0 (#4776) 2022-01-21 09:42:36 -01:00
Bert Blommers
aa70ee254d
Remove deprecated decorators + boto dependency (#4378) 2022-01-18 14:18:57 -01:00
Bert Blommers
3f966541ce
Feature: EC2 filter-by dnsname (#4759) 2022-01-14 14:20:23 -01:00
Bert Blommers
63d1c09659
Admin: Fail dependency-check script, instead of failing silently (#4758) 2022-01-13 22:10:20 -01:00
Benoît Faucon
72fdaa3552
feat: add support for filtering by tags in describe_managed_prefix_lists (#4747) 2022-01-13 11:41:01 -01:00
Bert Blommers
36d5e1d7df
EC2 - DescribeRouteTables should always show main association (#4726) 2021-12-27 22:56:50 -01:00
Bert Blommers
973c55a36c
EC2 - Error when deleting snapshots in use (#4721) 2021-12-25 20:37:39 -01:00
Bert Blommers
71daf79ffd
EC2 - Verify NIC can be created without SG (#4720) 2021-12-25 15:44:38 -01:00
Bert Blommers
cf87e75d6e
Feature: Mock region (#4699) 2021-12-24 20:02:45 -01:00
Bert Blommers
a1bfb6a48e
EC2 - SubnetId and NetworkInterfaces cannot both be specified when calling run_instances (#4719) 2021-12-24 14:12:57 -01:00
Simon Toftegaard Petersen
cd0f0ee83c
Added new functionality for EC2 (#4701) 2021-12-19 13:27:23 -01:00
Bert Blommers
80b074b88f
Update EC2/IAM resources (#4682) 2021-12-12 22:00:30 -01:00
Preston Doster
d64fd52b57
ENI: DescribeNetworkInterfaces attachment.instance-id filter (#3549) 2021-11-23 21:59:35 -01:00
Philip D'Amore
68ffb303b5
Fix incorrect DnsEntries XML for describe_vpc_endpoints (#4621) 2021-11-23 08:55:47 -01:00
James Light
f4abd5528f
Fix security group filters 2 (#4481) 2021-11-16 11:24:14 -01:00
Dominik Schubert
756f772c5c
EC2 - fix missing AZ on auto-generated volumes for instances (#4560) 2021-11-11 11:50:07 -01:00
Bert Blommers
74cad730cc
EC2 - improve test coverage (#4558) 2021-11-11 10:50:51 -01:00
Mohit Alonja
701465df26
ENI: added ipv6 support and fixed private ip address (#4307) 2021-11-10 19:50:47 -01:00
Bert Blommers
728039bce1
EC2 - Filtering on plain property didn't work with asterix (#4461) 2021-10-23 11:29:16 +00:00
Bert Blommers
ecd8d2478f
EC2:describe_instances() - allow filter for vpc_id within NIC (#4448) 2021-10-20 16:14:06 +00:00
Daniel Fangl
0b647fdb8b
Fix random_ipv6_cidr network generation, with test (#4438) 2021-10-19 13:04:30 +00:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
nom3ad
f50d80ede6
fix: invalid escape sequence DeprecationWarning (#4430) 2021-10-18 09:21:18 +00:00
Bert Blommers
deeabfc6e5
EC2 - Implement DryRun-flag on various operations (#4420) 2021-10-15 22:43:00 +00:00
Bert Blommers
b95bda11f3
EC2 - Bugfix where associate_public_ip was always True (#4404) 2021-10-13 09:57:39 +00:00
Bert Blommers
51e59c7ac5
CF - Add support for AWS::EC2::VPNGateway (create only) (#4263) 2021-10-10 21:43:49 +00:00
Bert Blommers
4e45152d86
EC2:create_volume() - Add support for VolumeType (#4264) 2021-10-10 19:16:28 +00:00
Bert Blommers
b49ee71a55
Parallel tests - make EC2 SG tests more resistant to parallel tests (#4372) 2021-10-05 20:40:21 +00:00
Bert Blommers
8526013e61
Parallelize tests - Part 1 (#4368) 2021-10-05 17:11:07 +00:00
Bert Blommers
e9a4100324
Rewrite deprecated CloudFormation tests (#3842) 2021-10-04 13:47:40 +00:00
James Light
73b7fcce26
Fix security group filters (#4079) 2021-09-30 15:28:13 +00:00
Jonathan Piché
2db85d0e54
#4298 // fix warning when image id from template if specified (#4356) 2021-09-27 20:00:29 +00:00
Bert Blommers
939b800e96
Rewrite deprecated EC2 tests (#3881) 2021-09-25 11:13:07 +00:00
kbalk
3a203d35c9
Implement EC2 describe_vpc_endpoint_services() (#4322) 2021-09-24 16:01:09 +00:00
Steven Davidovitz
d56a3989eb
EC2 - instance lifecycle defaults to None when not using spot (#4321) 2021-09-22 16:32:30 +00:00
Macwan Nevil
cb43134d44
fixed route-table vpc-endpoint integration (#4285) 2021-09-16 21:49:49 +00:00
Mohit Alonja
f84ba7d6ec
Fix NetworkInterface PrivateIP support and EIP association (#4288) 2021-09-16 21:07:18 +00:00
Bert Blommers
a147eeac67
EC2 - Additional unit tests (#4291) 2021-09-15 21:07:04 +00:00
Mohit Alonja
002f9979ef
Fix Nat Gateway (#4281) 2021-09-14 20:40:17 +00:00
Mohit Alonja
99c661781e
Fix VPN gateway (#4279) 2021-09-11 08:21:01 +01:00
Mohit Alonja
e061d371c9
Basic requirements VPN GW (#4276) 2021-09-10 18:21:29 +01:00
Macwan Nevil
3885e20298
added support for prefix-list; improved support for replace route (#4273) 2021-09-10 07:09:47 +01:00
Mohit Alonja
eef21767f8
Fix SecuirtyGroupRules and added default Ec2-VPC support for SG. (#4267) 2021-09-09 13:39:48 +01:00
Bert Blommers
4e7153c655
EC2 - DryRun-requests should return 412 status code (#4270) 2021-09-07 17:10:01 +01:00
Mohit Alonja
2f26e870b8
SecurityGroup Improvements (#4239) 2021-09-04 17:08:18 +01:00
mello7tre
69cc92f780
Add describe_spot_price_history (#4261) 2021-09-04 16:57:01 +01:00
mello7tre
6d9abe1111
Add instance lifecycle property to detect spot instances (#4260) 2021-09-02 14:12:17 +01:00
Bert Blommers
0659ac6192
EC2 - Verify we can filter by owner-alias (#4255) 2021-09-01 13:23:24 +01:00
Brian Pandola
a1e415ec03
Support alternate EC2:ModifyInstanceAttribute request syntax (#4234) 2021-08-28 07:04:15 +01:00
Bert Blommers
8b7df4da44
EC2:DescribeVpcPeeringConnection() - use VpcPeeringConnectionIds-parameter if provided (#4230) 2021-08-27 14:56:31 +01:00
Bert Blommers
020257904e
Tech Debt - improve test coverage (#4229) 2021-08-27 11:28:10 +01:00
Mohit Alonja
11a37c357b
SecurityGroup Improvements (#4183) 2021-08-26 19:57:07 +01:00
Bert Blommers
6a644850f6
EC2 - Return custom error response for DescribeRouteTable/DescribeVPC (#4225) 2021-08-26 18:53:26 +01:00
Bert Blommers
fbd93efdb7
EC2 - Add tests for egress_only_internet_gateway (#4206) 2021-08-22 10:35:04 +01:00
Bert Blommers
7acdfe4feb
Introduce Pylint to check for duplicate test method names (#3684) 2021-08-21 16:33:15 +01:00
Brian Pandola
1db3e0e9b9
Raise error when attempting to terminate protected ec2 instance (#4199) 2021-08-19 06:47:05 +01:00
Brian Pandola
27c9b31d3a
Fix ec2 wildcard tag filters (#4189) 2021-08-18 06:02:19 +01:00
Bert Blommers
547a1844ed
Tech debt - improve test coverage EC2/ELBv2/Events (#4181) 2021-08-16 15:13:50 +01:00
Anton Grübel
4df099c724
Add cloudwatch tags (#4179)
* Update cloudwatch.put_metric_alarm to accept TreatMissingData and Tags parameter
* Add parameter ExtendedStatistic and EvaluateLowSampleCountPercentile to cloudwatch.put_metric_alarm
* Add parameter ThresholdMetricId to cloudwatch.put_metric_alarm
2021-08-16 08:52:19 +01:00
Macwan Nevil
d2c9e85ed3
Enhanced support for ami filtering (#4175) 2021-08-15 10:09:50 +01:00
Macwan Nevil
f2b8318211
fixed owner id and delete rt (#4161) 2021-08-11 21:23:04 +01:00
Bert Blommers
574053cb27
EC2 - Improve/Extend RouteTable unit tests (#4165) 2021-08-11 18:50:15 +01:00
Bert Blommers
69e865dd1e
EC2 - Add unit tests for Route Tables (#4135) 2021-08-04 14:22:26 +01:00
Bert Blommers
0388b778dd
EC2/RDS2 - New tests (#4127) 2021-08-03 15:06:06 +01:00
Waldemar Hummer
6eeb4b4b32
Add support for EC2 transit gateway associations (#4089)
Co-authored-by: Nevil Macwan <macnev2013@gmail.com>
Co-authored-by: monty16597 <alonjamohit77@gmail.com>
2021-07-31 16:18:19 +01:00
Bert Blommers
a1905ad584
Improve test coverage (#4098) 2021-07-28 11:17:15 +01:00
Waldemar Hummer
f4f8527955
Merge LocalStack changes into upstream moto (#4082)
* fix OPTIONS requests on non-existing API GW integrations

* add cloudformation models for API Gateway deployments

* bump version

* add backdoor to return CloudWatch metrics

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* bump version

* minor fixes

* fix Number data_type for SQS message attribute

* fix handling of encoding errors

* bump version

* make CF stack queryable before starting to initialize its resources

* bump version

* fix integration_method for API GW method integrations

* fix undefined status in CF FakeStack

* Fix apigateway issues with terraform v0.12.21
* resource_methods -> add handle for "DELETE" method
* integrations -> fix issue that "httpMethod" wasn't included in body request (this value was set as the value from refer method resource)

* bump version

* Fix setting http method for API gateway integrations (#6)

* bump version

* remove duplicate methods

* add storage class to S3 Key when completing multipart upload (#7)

* fix SQS performance issues; bump version

* add pagination to SecretsManager list-secrets (#9)

* fix default parameter groups in RDS

* fix adding S3 metadata headers with names containing dots (#13)

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* make CF stack queryable before starting to initialize its resources

* bump version

* remove duplicate methods

* fix adding S3 metadata headers with names containing dots (#13)

* Update amis.json to support EKS AMI mocks (#15)

* fix PascalCase for boolean value in ListMultipartUploads response (#17); fix _get_multi_param to parse nested list/dict query params

* determine non-zero container exit code in Batch API

* support filtering by dimensions in CW get_metric_statistics

* fix storing attributes for ELBv2 Route entities; API GW refactorings for TF tests

* add missing fields for API GW resources

* fix error messages for Route53 (TF-compat)

* various fixes for IAM resources (tf-compat)

* minor fixes for API GW models (tf-compat)

* minor fixes for API GW responses (tf-compat)

* add s3 exception for bucket notification filter rule validation

* change the way RESTErrors generate the response body and content-type header

* fix lint errors and disable "black" syntax enforcement

* remove return type hint in RESTError.get_body

* add RESTError XML template for IAM exceptions

* add support for API GW minimumCompressionSize

* fix casing getting PrivateDnsEnabled API GW attribute

* minor fixes for error responses

* fix escaping special chars for IAM role descriptions (tf-compat)

* minor fixes and tagging support for API GW and ELB v2 (tf-compat)

* Merge branch 'master' into localstack

* add "AlarmRule" attribute to enable support for composite CloudWatch metrics

* fix recursive parsing of complex/nested query params

* bump version

* add API to delete S3 website configurations (#18)

* use dict copy to allow parallelism and avoid concurrent modification exceptions in S3

* fix precondition check for etags in S3 (#19)

* minor fix for user filtering in Cognito

* fix API Gateway error response; avoid returning empty response templates (tf-compat)

* support tags and tracingEnabled attribute for API GW stages

* fix boolean value in S3 encryption response (#20)

* fix connection arn structure

* fix api destination arn structure

* black format

* release 2.0.3.37

* fix s3 exception tests

see botocore/parsers.py:1002 where RequestId is removed from parsed

* remove python 2 from build action

* add test failure annotations in build action

* fix events test arn comparisons

* fix s3 encryption response test

* return default value "0" if EC2 availableIpAddressCount is empty

* fix extracting SecurityGroupIds for EC2 VPC endpoints

* support deleting/updating API Gateway DomainNames

* fix(events): Return empty string instead of null when no pattern is specified in EventPattern (tf-compat) (#22)

* fix logic and revert CF changes to get tests running again (#21)

* add support for EC2 customer gateway API (#25)

* add support for EC2 Transit Gateway APIs (#24)

* feat(logs): add `kmsKeyId` into `LogGroup` entity (#23)

* minor change in ELBv2 logic to fix tests

* feat(events): add APIs to describe and delete CloudWatch Events connections (#26)

* add support for EC2 transit gateway route tables (#27)

* pass transit gateway route table ID in Describe API, minor refactoring (#29)

* add support for EC2 Transit Gateway Routes (#28)

* fix region on ACM certificate import (#31)

* add support for EC2 transit gateway attachments (#30)

* add support for EC2 Transit Gateway VPN attachments (#32)

* fix account ID for logs API

* add support for DeleteOrganization API

* feat(events): store raw filter representation for CloudWatch events patterns (tf-compat) (#36)

* feat(events): add support to describe/update/delete CloudWatch API destinations (#35)

* add Cognito UpdateIdentityPool, CW Logs PutResourcePolicy

* feat(events): add support for tags in EventBus API (#38)

* fix parameter validation for Batch compute environments (tf-compat)

* revert merge conflicts in IMPLEMENTATION_COVERAGE.md

* format code using black

* restore original README; re-enable and fix CloudFormation tests

* restore tests and old logic for CF stack parameters from SSM

* parameterize RequestId/RequestID in response messages and revert related test changes

* undo LocalStack-specific adaptations

* minor fix

* Update CodeCov config to reflect removal of Py2

* undo change related to CW metric filtering; add additional test for CW metric statistics with dimensions

* Terraform - Extend whitelist of running tests

Co-authored-by: acsbendi <acsbendi28@gmail.com>
Co-authored-by: Phan Duong <duongpv@outlook.com>
Co-authored-by: Thomas Rausch <thomas@thrau.at>
Co-authored-by: Macwan Nevil <macnev2013@gmail.com>
Co-authored-by: Dominik Schubert <dominik.schubert91@gmail.com>
Co-authored-by: Gonzalo Saad <saad.gonzalo.ale@gmail.com>
Co-authored-by: Mohit Alonja <monty16597@users.noreply.github.com>
Co-authored-by: Miguel Gagliardo <migag9@gmail.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-07-26 15:21:17 +01:00
Bert Blommers
7693d77333
Remove Py2 support (#3915) 2021-07-26 07:40:39 +01:00
Brian Pandola
05cdcbcedc
Add support for DescribeNetworkInterfaces tag filters (#4057) 2021-07-04 07:44:58 +01:00
Bert Blommers
cbeeefbec9
Prep release 2.0.9 (#4007)
* Update implementation coverage

* EC2 - Update instance type offerings

* IAM - update list of managed policies

* Changelog for release 2.0.9

* Instance Type Offerings - fix number of available offerings
2021-06-12 13:57:29 +01:00
Brian Pandola
16f4dc87dc
Add support for tagging Volumes in ec2:RunInstances (#3946) 2021-05-21 06:35:34 +01:00
Brian Pandola
752b508738
Add support for KmsKeyId in ec2:RunInstances (#3943) 2021-05-20 07:11:50 +01:00
Josh McCullen
12b409e0de
Set multiple Security Groups when calling modify_network_interface_attribute (#3911) 2021-05-07 13:50:26 +01:00
khneal
e5b3f4181d
EC2 describe_network_acls: add support for owner-id filter (#3898)
* add test that fails with FilterNotImplementedError

* describe_network_acls: add support for owner-id filter

Co-authored-by: Kevin Neal <Kevin_Neal@intuit.com>
2021-05-05 13:15:43 +01:00
Brian Pandola
463472c2b2
Make security rules consistent between direct (backend) and indirect (api) boundaries (#3817)
* Make security rules consistent between direct (backend) and indirect (api) boundaries

Security rules added directly via the backend were unable to be revoked via the API
because the port values were being stored as strings but were always coerced back
to integers by the botocore model.  `"0" != 0`, so the rules would never match,
raising an `InvalidPermissionNotFoundError`.

This change ensures that the port values for a security group rule are always of type
`Union[int, None]`.

No tests needed to be modified as a result of this change.  A new test was added that
explicitly covers the behavior that had been failing.

* Skip test in server mode
2021-03-31 19:33:36 +01:00
Brian Pandola
1761be46e3
Return error when trying to add rules to a non-existent security group (#3802)
Behavior and error code/message confirmed against real AWS backend.
2021-03-26 13:00:51 +00:00
Brian Pandola
2bae7e4e0d
Raise error when adding duplicate egress rule to ec2:SecurityGroup (#3801)
The `InvalidPermission.Duplicate` error was already implemented for inbound rules,
but AWS also returns this error for duplicate outbound rules.

Very minor changes were needed on existing tests that were adding duplicate
outbound rules (when testing the RulesPerSecurityGroupLimitExceeded error).
2021-03-26 11:23:07 +00:00
tony-dot-sh
5fe3a707ed
fix route table association by internet gateway (#3773)
* fix route table association by internet gateway per https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateRouteTable.html

* Route53

 - Add test for route table association by internet gateway
 - Minor test tweak for Main route table values

TODO: explicitly set the route table main route association

* Route53

 - forgot subnet id association test

Co-authored-by: Tony Greising-Murschel <tony@platform.sh>
2021-03-16 14:15:58 +00:00
Bert Blommers
d3ad9d6686
Update integration test to use Pytest (#3703)
* Refactor int test to use pytest

* Add comments to int test script
2021-02-17 15:06:31 +00:00
tony-dot-sh
9feabf5479
Enhancement: implement EC2 instance filtering by subnet-id (#3694)
Co-authored-by: Tony Greising-Murschel <tony@platform.sh>
2021-02-15 16:38:40 +00:00
Bert Blommers
737636f9df
Tech debt (#3653) 2021-02-02 16:31:26 +00:00
Brian Pandola
cd044ef00b
Remove redundant test code (#3640)
These tests, when run, do not execute any `moto` code. They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request.  These tests do not cover or verify
any `moto` behavior and have been removed.
2021-01-31 12:21:24 +00:00
Brian Pandola
f4b81e69b8
Address pytest warnings (#3629)
* Address `boto` deprecation warnings

This commit eliminates the following warning:

../boto/ec2/connection.py:582:
  PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.

`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.

* Remove `invoke_lambda` tracebacks from unit test logging

If an exception is encountered, the details are returned in the response payload.
Printing the traceback was just adding noise to the pytest output.

* Use known AMIs in unit tests

This commit eliminates the following warning in the pytest output:

`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`

Known, pre-loaded AMI image ids are used instead of random ids that don't actually
exist in the moto backend.  The integrity of the tests is unaffected by this change.

A test has been added to provide explicit coverage of the PendingDeprecationWarning
raised when an invalid AMI image id is passed to moto.
2021-01-29 11:31:56 +00:00
Brian Pandola
98d79dca97
Address boto deprecation warnings (#3616)
This commit eliminates the following warning (of which there are currently dozens):

../boto/ec2/connection.py:582:
  PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.

`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.
2021-01-26 14:07:19 +00:00
Brian Pandola
38124ab1c9
Fix ec2 filter by empty tag value (#3605)
* Fix ec2 filter by empty tag value

Return `None` instead of an empty string when the tag key does not exist
and replace the falsy check with a more explicit `is None`, which allows
empty string values to correctly pass through the filter comparator.

Behavior confirmed against a real AWS backend.

Closes #3603

* Make test case more explicit

Test case now pulled directly from the issue report (#3603).

Co-authored-by: Bert Blommers <bblommers@users.noreply.github.com>
2021-01-24 12:00:25 +00:00
Brian Pandola
cb03223c9b
Add TagSpecification support to ec2:CreateImage (#3604)
* Bump `botocore` to minimum version that supports TagSpecifications for this action.
* Add test coverage.

Closes #3602
2021-01-23 12:57:34 +00:00
Bert Blommers
0f32f3c50c
#3542 - CloudFormation - Fix SecurityGroup ingress rules (#3553) 2021-01-13 13:36:56 +00:00
Bert Blommers
77dd35e3b8
Use known ImageID in internal tests (#3555) 2021-01-13 09:02:11 +00:00
Brian Pandola
1a98c4f14a
Fix: handling of boolean value privateDnsEnabled in ec2:VpcEndpoint (#3566)
* Properly coerce `privateDnsEnabled` to boolean value when parsing requests.
* Per AWS spec, default `privateDnsEnabled` request value to `True`.
* Properly serialize `privateDnsEnabled` as boolean value in responses.
* Add test coverage.

Ref: #3540
2021-01-08 08:05:44 +00:00
usmangani1
bce682a867
Fix:Added nat-gateway tags (#3560)
* Fix:Added nat-gateway tags

* Removed changes
2021-01-07 17:59:46 +00:00
usmangani1
af60306371
Fix:Ec2-VPC:Added functionality describe-vpc-endpoint (#3524)
* Fix:Ec2:Added fucntionality describe-vpc-endpoint

* Refactor

* Added test cases for errors
2020-12-07 21:39:57 +00:00
usmangani1
cfaaa70ea9
FIX:Ec2:Added:Tags for EIP (#3505)
* FIX:Ec2:Added:Tags for EIP

* removed files

* Fix tests
2020-12-06 00:04:46 +00:00
Bert Blommers
936fb19539 DescribeInstanceTypeOfferings - script that hardcodes all offerings 2020-12-02 14:41:24 +00:00
Bert Blommers
5d208bfd04 Merge branch 'master' into add_instance_type_offerings 2020-12-02 10:57:07 +00:00
Brian Pandola
ae85c539fd Remove boto package dependency
The `boto` library (long ago superseded by `boto3`) has not had an official
release in over two years or even a commit in the last 18 months.  Importing
the package (or indirectly importing it by via `moto`) generates a deprecation
warning.  Additionally, an ever-increasing number of `moto` users who have
left `boto` behind for `boto3` are still being forced to install `boto`.

This commit vendors a very small subset of the `boto` library--only the code
required by `moto` to run--into the /packages subdirectory.  A README file
is included explaining the origin of the files and a recommendation for how
they can be removed entirely in a future release.

NOTE: Users of `boto` will still be able to use `moto` after this is merged.

closes #2978
closes #3013
closes #3170
closes #3418

relates to #2950
2020-11-26 23:59:15 -08:00
Nuwan Goonasekera
c658cfea0d
Run black and fix tests 2020-11-24 00:51:00 +05:30
Nuwan Goonasekera
114a8efac8
Improved describe instance types + tests 2020-11-23 15:30:52 +05:30
Nuwan Goonasekera
a69bad57ef
Added instance type offer filters 2020-11-23 15:30:52 +05:30
Mykola Mykhalov
689cd8f285
Implement IAM instance profile associations (#3482)
* Add associate_iam_instance_profile describe_iam_instance_profile_associations, disassociate_iam_instance_profile, replace_iam_instance_profile_association

* More tests, removed type hints, filter fix

* Ec2 fix
2020-11-20 22:00:53 +00:00
Brian Pandola
93453eba05
Improve ec2:DescribeSubnets filtering (#3457)
* Add response/model/test coverage for filtering by `state`
* Add explicit test case for filtering by `vpc-id`

Closes #801
2020-11-16 08:17:36 +00:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Bert Blommers
cb6731f340 Convert fixtures/exceptions to Pytest 2020-11-11 15:54:01 +00:00
Matěj Cepl
6d364dc7aa Pytest model of exceptions uses 'value' attribute instead of 'exception'. 2020-11-11 12:21:04 +01:00