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
This commit is contained in:
parent
93638de380
commit
adb64bd97a
@ -272,8 +272,7 @@
|
||||
- [x] create implemented
|
||||
- [ ] update implemented
|
||||
- [ ] delete implemented
|
||||
- [ ] Fn::GetAtt implemented
|
||||
- [ ] Arn
|
||||
- [x] Fn::GetAtt implemented
|
||||
- AWS::RDS::DBParameterGroup:
|
||||
- [x] create implemented
|
||||
- [ ] update implemented
|
||||
|
@ -306,6 +306,23 @@ class LogGroup(CloudFormationModel):
|
||||
resource_name, tags, **properties
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def has_cfn_attr(cls, attr: str) -> bool:
|
||||
return attr in [
|
||||
"Arn",
|
||||
]
|
||||
|
||||
def get_cfn_attribute(self, attribute_name: str) -> str:
|
||||
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
|
||||
|
||||
if attribute_name == "Arn":
|
||||
return self.arn
|
||||
raise UnformattedGetAttTemplateException()
|
||||
|
||||
@property
|
||||
def physical_resource_id(self) -> str:
|
||||
return self.name
|
||||
|
||||
def create_log_stream(self, log_stream_name: str) -> None:
|
||||
if log_stream_name in self.streams:
|
||||
raise ResourceAlreadyExistsException()
|
||||
|
Loading…
Reference in New Issue
Block a user