aws-cloudformation-resource-providers-logs icon indicating copy to clipboard operation
aws-cloudformation-resource-providers-logs copied to clipboard

LogGroup: Not returning ARN on create and update

Open johnttompkins opened this issue 5 years ago • 1 comments

We are sucessfully creating/updating log groups in the handlers, but #21 removed a read call that set the arn in the returned model, so the models returned by the create and read calls differ, as so update & read. Found during contract tests:

assert {'Arn': 'arn:...onInDays': 60} == {'LogGroupName...onInDays': 60}
E         Omitting 2 identical items, use -vv to show
E         Left contains 1 more item:
E         {'Arn': 'arn:aws:logs:us-west-2:123456789012:log-group:name*'}
E         Full diff:
E         + {'LogGroupName': 'name', 'RetentionInDays': 60}
E         - {'Arn': 'arn:aws:logs:us-west-2:123456789012:log-group:name*',
E         -  'LogGroupName': 'name,...

Need to either add back in the read call at the end of the handler or construct this arn in the create handler, although having to maintain logic for contstructing arns seems like overkill.

johnttompkins avatar Dec 04 '19 21:12 johnttompkins

If the ARN is constructed in the Handler, the logs:DescribeLogGroups permission can be remove from the create handler in the schema.

I'd advocate for reverting #21 for now and adding an issue for doing this another way if the extra api call is unwanted. It's annoying to start writing new code if the current code doesn't pass tests.

benbridts avatar Mar 29 '20 22:03 benbridts