我使用 Troposphere 和 Python 创建了一个 AWS NLB。它工作正常,我只是想向它添加一个新属性。我要添加的属性是“deregistration_delay.connection_termination.enabled”。但是当我尝试更新我的节时,它不喜欢我的语法。
这是我尝试添加的带有 TargetGroupAttribute 的代码块。
my_target_group = t.add_resource(elb.TargetGroup(
"MyTargetGroup",
Name = 'MyTGName',
Port = os.getenv('PORT'),
Protocol = os.getenv('PROTOCOL'),
VpcId = MyVPCid.id,
HealthCheckIntervalSeconds = os.getenv('HEALTH_CHECK_INTERVAL_SECONDS'),
HealthCheckPort = os.getenv('PORT'),
HealthCheckProtocol = os.getenv('HEALTH_CHECK_PROTOCOL'),
HealthyThresholdCount = os.getenv('HEALTHY_THRESHOLD_COUNT'),
UnhealthyThresholdCount = os.getenv('UNHEALTHY_THRESHOLD_COUNT'),
TargetGroupAttribute = [
elb.TargetGroupAttribute(
Key='deregistration_delay.connection_termination.enabled',
Value='true'
)
],
Targets = build_tg_desc_lst(list_of_instances, os.getenv('PORT'))
))
它不喜欢我共享的代码块的“TargetGroupAttribute”部分。我收到错误“TargetGroup 对象不支持属性 TargetGroupAttribute”。
我用来添加属性的 AWS 文档在这里。
任何建议或帮助将不胜感激。谢谢!