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.
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.
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.
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.
* This should provide a test for [spulec/moto#84].
* Prior to deleting the existing A record, it sends a batch update that
includes DELETE and a CREATE, which is what boto performs when
updating a ResourceRecord.