Commit Graph

3 Commits

Author SHA1 Message Date
Bert Blommers
2cf0130d13
Prep Release 4.1.7 (#6201) 2023-04-11 14:31:46 +00:00
Jordan Sanders
adb64bd97a
CloudFormation, Logs: Resolve LogGroup physical id and attributes (#6125)
* CloudFormation, Logs: Add physical_resource_id to LogGroup

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#aws-resource-logs-loggroup-return-values

This brings CloudFormation's Ref behavior more in line with actual
AWS behavior. Previously, it returned an instance of a LogGroup model.

I didn't add a test case for this but I'm happy to do so if requested.

* Resolve LogGroup Fn::GetAtt

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#aws-resource-logs-loggroup-return-values

* Add type annotations

* Add return type annotation

* Updating CloudFormation coverage
2023-03-28 13:17:56 +01:00
Jordan Sanders
94d35af520
CloudFormation: Add coverage checklist (#6129)
This change introduces a checklist similar to IMPLEMENTATION_COVERAGE.md
to document moto's adherence to the full CloudFormation specification.

The script (invoked via `make cloudformation_coverage`) finds any moto
models that implement `moto.core.common_models.CloudFormationModel` and
checks to see if all CRUD methods are implemented. For `has_cfn_attr`,
it also checks to see if all of the attributes exposed by `Fn::GetAtt` are
implemented. It does not check to see if `physical_resource_id` is
implemented because as far as I can tell, the published AWS spec doesn't
include that information:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html

A more aggressive approach would be to remove default implementations
from all the abstract methods and allow Python to throw for any
unimplemented method. But that would obviously break a lot of things.

Instead, I think the checklist represents good documentation for users
about what they can and can't expect moto to handle when parsing their
CloudFormation templates. It also serves as a nice to-do list of small
improvements for contributors to add (and I'll likely add a few myself).
Many of these would be particularly good "first issues" for first time
contributors because in general, these methods just call existing
methods.
2023-03-27 17:56:19 +01:00