方法签名:我尝试以一些不同的方式更改实现,但没有帮助。
import troposphere.s3 as S3
class LifecycleConfiguration(AWSProperty):
props = {
'Rules': ([LifecycleRule], True),
}
class LifecycleRule(AWSProperty):
props = {
'ExpirationDate': (basestring, False),
'ExpirationInDays': (positive_integer, False),
'Id': (basestring, False),
'Prefix': (basestring, False),
'Status': (basestring, True),
'Transition': (LifecycleRuleTransition, False),
}
测试实施
myLifecycleConfiguration = S3.LifecycleConfiguration(title='myLifecycleConfiguration',
Rules=S3.LifecycleRule(title="check"))
错误签名
TypeError: Rules is <class 'troposphere.s3.LifecycleRule'>, expected [<class 'troposphere.s3.LifecycleRule'>]