Commit Graph

77 Commits

Author SHA1 Message Date
Karthikeyan Singaravelan
7054143701
Fix deprecation warnings due to invalid escape sequences. (#3273)
* Fix deprecation warnings due to invalid escape sequences.

* Fix linter error.
2020-09-10 09:20:26 +01:00
jweite
49d92861c0
Iam cloudformation update, singificant cloudformation refactoring (#3218)
* IAM User Cloudformation Enhancements: update, delete, getatt.

* AWS::IAM::Policy Support

* Added unit tests for AWS:IAM:Policy for roles and groups.  Fixed bug related to groups.

* AWS:IAM:AccessKey CloudFormation support.

* Refactor of CloudFormation parsing.py methods to simplify and standardize how they call to the models.  Adjusted some models accordingly.

* Further model CloudFormation support changes to align with revised CloudFormation logic.  Mostly avoidance of getting resoure name from properties.

* Support for Kinesis Stream RetentionPeriodHours param.

* Kinesis Stream Cloudformation Tag Support.

* Added omitted 'region' param to boto3.client() calls in new tests.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-08-27 10:11:47 +01:00
Adam Richie-Halford
9a9a1d8413
Decentralize cloudformation naming responsibilities (#3201)
* #3127 - Decentralize CF naming responsibilities

* Decentralize CloudFormation naming responsibilities

* Update URLs in cloudformation_resource_type functions

* Fix flake8 errors

* Black formatting

* Add a bunch of imports to populate CloudFormationModel.__subclasses__

* Add noqa to s3 models import statement in cloudformation/parsing.py

* Black formatting

* Remove debugging print statement

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-08-01 15:23:36 +01:00
Jon Nangle
9fdeaca589 Support GeoLocation and Failover on Route 53 2020-03-02 12:46:15 +00:00
Dejan Levec
877f3b056a Add IsTruncated to Route53.list_resource_record_sets 2019-12-27 19:32:31 +01:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Don Kuntz
35507f33df
Don't error out on route53.list_tags_for_resource when resource has no tags
Without the added `return {}`, calling route53.list_tags_for_resource
when called with a ResourceId of a resource without any tags would
result in the error:
    jinja2.exceptions.UndefinedError: 'None' has no attribute 'items'

Because the LIST_TAGS_FOR_RESOURCE_RESPONSE was given None instead of
empty dict.

This now allows list_tags_for_resource to be called without issue on
tag-less resources.
2019-08-28 13:57:42 -05:00
sblumin
a2ac341e3d added support to UPSERT records that are not simple routing policy 2019-07-17 16:37:47 -07:00
Steve Pulec
414ff930ed
Merge branch 'master' into mark-alias-target 2019-07-07 23:11:53 -05:00
Steve Pulec
574055da2c
Merge pull request #2245 from vrtdev/bugfix/r53-delete-type
Route53 Delete: respect the given Type
2019-07-06 17:29:19 -05:00
Niels Laukens
5f46aa8c50
Reduced readability to please flake8 2019-06-18 11:04:19 +02:00
Niels Laukens
a5d1b22534
Fix CloudFormation usage 2019-06-18 11:04:03 +02:00
Niels Laukens
6e97881896
Route53 Delete: respect the given Type 2019-06-17 15:53:32 +02:00
Niels Laukens
9ef69a617a
Route53 get_record_sets: sort names lexicographically 2019-06-14 17:07:59 +02:00
Niels Laukens
a9319fad04
Route53 get_record_sets: filter type after name
According to the documentation [1], name should be filtered first,
followed by type.

> If you specify both Name and Type
> The results begin with the first resource record set in the list
> whose name is greater than or equal to Name, and whose type is
> greater than or equal to Type.

[1]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListResourceRecordSets.html
2019-06-14 16:15:14 +02:00
Elliott Butler
9bd15b5a09
Fix route53 alias response.
This commit
* includes the work by @elliotmb in #1694,
* removes the AliasTarget.DNSName copy into a RecordSet.Value,
* fixes and adds tests.
2019-05-31 10:54:18 +01:00
Mark Challoner
d61ce0584b
Check record type when upserting.
Previously this was not checked so an existing record (e.g. with type A) would be overwritten on upsert by a record with the same name but different type (e.g. TXT).

This commit also:

* publicizes the type variable appending the underscore affix (required to maintain compatibility with CloudFormation which sets type as the CF type),
* fixes a wrong assumption in tests that UPSERT applies a change to Type (it creates a distinct record instead),
* Updates ACM model to use serial_number instead of deprecated and remove serial causing Travis failures.
2019-03-01 16:44:50 +00:00
Tatsuya Hoshino
293b25a8f9 Add a missing trailing dot to the Name of ResourceRecordSet
AWS Route53 treats www.example.com (without a trailing dot)
and www.example.com. (with a trailing dot) as identical.
Hence, after creating a `www.example.com` record,
`www.example.com.` name is saved in Route53.
But moto treated `www.example.com` and `www.example.com.` as different.

This commit fixes the moto behavior.
2018-11-20 21:43:59 +09:00
Steve Pulec
7737832bf3 Fix bug adding None TTL to route53 responses. 2018-03-29 10:08:39 -04:00
Giorgos-Christos Dimitriou
f18259d49e Change REPONSE to RESPONSE for consistency (#1538) 2018-03-26 12:26:24 -07:00
Andrey Melentyev
4e390530a7 Do not treat StartRecordName and StartRecordType in the list_resource_record_sets as filters
According to AWS API reference and Boto documentation they are to begin the record listing from,
not for filtering. So their current behavior in moto is not consistent with AWS.
2017-10-23 21:58:39 +02:00
Terry Cain
ae6f9dcb71
Fixes #1282 2017-10-21 22:10:45 +01:00
Terry Cain
17d9701d19
Updated R53 ID's to match what AWS do now 2017-09-22 23:50:01 +01:00
Abhinav I
06d65fd3da Added test cases that covers route53 client's <change_resource_record_sets> function. Also added validation to throw a ClientError when the record set does not match the hosted zone's config 2017-04-28 21:26:32 +05:30
Steve Pulec
a6e762340d Merge pull request #867 from 2rs2ts/flexible-route53-hostedzoneid-lookup
Be flexible with Route53 Hosted Zone IDs with /hostedzone/ prefix
2017-03-16 22:55:13 -04:00
Andrew Garrett
f2b7ba03b4 Forgot that lstrip works on character sets, not substrings
I suppose this is one way to do it. I could have also split and taken
the last element. Not sure which is best. 🤔
2017-03-17 02:45:58 +00:00
Andrew Garrett
6346e44c9d Be flexible with Route53 Hosted Zone IDs with /hostedzone/ prefix
We will continue to store just the unique ID, but since the AWS API
returns /hostedzone/<id>, we should accept attempts to pass that back.
For example, both just the ID as well as /hostedzone/<id> work for
specifying the HostedZoneId of a ResourceRecordSet in CloudFormation. So
we should support that too.

Signed-off-by: Scott Greene <scott.greene@getbraintree.com>
2017-03-14 19:52:36 +00:00
Andrew Garrett
b9ea947aa0 Add ListHostedZonesByName 2017-03-13 15:27:45 +00:00
Steve Pulec
6d422d1f37 Add BaseModel to all models. 2017-03-11 23:41:12 -05:00
Steve Pulec
3b4ef2cf15 Merge in master. 2017-03-05 09:58:39 -05:00
David Wilcox
8d737eb59d Route53: allow hosted zone id as well when creating record sets (#833)
* add test that creates r53 record set from hosted zone id (not name)

* pass test to enable creating record sets by hosted zone ids
2017-03-04 22:31:45 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
81836b6981 Get standalone server mode working for all tests. 2017-02-23 19:43:48 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Akhter Ali
2bf85fe25d Fix Route53 response and tests (#804)
* Fix route53 response \n Fix route53 tests

* Fixing index

* fix zone ID on test_route53_with_update
2017-01-18 21:40:04 -05:00
Alfred Moreno
6560063ceb Fix tagging code. Unit tests were passing but the underlying implementation wasn't producing the expected result 2016-09-22 18:38:47 -07:00
Alfred Moreno
9a7556b3af Add support and unittests for Route53 tags 2016-09-20 17:41:23 -07:00
hummus
8fa53c1453 support route53 HostedZone PrivateZone=True #627 2016-06-03 11:10:04 -04:00
Steve Pulec
7dcfa85fb8 Add physical_resource_id to Route53.RecordSet. Closes #595. 2016-04-28 09:42:10 -04:00
Steve Pulec
a600deb96a Fix merge conflicts and add EC2 Instance delete. Closes #576. 2016-04-28 09:22:31 -04:00
Steve Pulec
ecbb714757 Merge pull request #584 from minyoung/upsert-route53
Adding support for UPSERT'ing route53 records
2016-04-23 19:43:52 -04:00
Louis Garman
09df782447 Add trailing slash to route53 rrset url path 2016-04-18 17:12:54 +01:00
Min-Young Wu
826ba82f6e Adding support for UPSERT'ing route53 records 2016-04-12 10:51:21 -07:00
Andrew Garrett
2c72a86778 Support HostedZoneId in RecordSet templates
Signed-off-by: Jesse Szwedko <jesse.szwedko@getbraintree.com>
2016-03-07 19:25:25 +00:00
Andrew Garrett
7779678e2c Allow cloudformation to delete Route 53 RecordSets
While there isn't an API method exposed for directly deleting a Route 53
RecordSet (it's performed via POST that acts more like a PATCH than
anything
else)[http://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html],
CloudFormation can have templates which contain RecordSets which refer
to zones that don't exist inside the template. Ergo, we need a way to
effect a delete upon these RecordSets when we don't have a direct
reference to the zone.

This exposes a delete method that isn't hooked up to any response (and
rightfully so), it just enables the ~polymorphic deletion behavior that
we've written into the CloudFormation implementation.

Signed-off-by: Scott Greene <scott.greene@getbraintree.com>
2016-03-03 17:53:05 +00:00
beeva-antonioirizar
84753aeac5 fix name method in the last commit 2016-02-17 17:44:20 +01:00
beeva-antonioirizar
b91596db32 add responses for methods don't have implemented in route53 2016-02-17 17:36:55 +01:00
beeva-antonioirizar
a621c83bf7 Comment's params is optional in create_hosted_zones. It is fix to support and templates adapted to it. 2016-02-17 15:32:38 +01:00
beeva-antonioirizar
1ac40cbaf6 add private zone in templates. Because it should have. It is always to False because it doesn't support for private zones. 2016-02-17 15:24:11 +01:00
beeva-antonioirizar
1448cf3541 add Istruncated to False in template list_hosted_zones_response in route53. Because it always has it. 2016-02-17 15:14:59 +01:00