[英]AWS CF Template for provisioning new EC2 instance with Existing Targetgroup
我正在尝试提供一个新的 EC2 实例并将其附加到我之前创建的现有targetGroup 。 我确实有targetGroupArn和新实例的详细信息。 在所有文档中,我可以看到创建新实例和新目标组并将实例 ID 引用到创建目标组的示例模板。
Is there any option to create only new instance and attaching it to the existing target group?
这样我就可以提及新实例将附加到的targetGroupArn 。 下面我提到了示例模板,我正在寻找什么。
{
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties": {
"TargetGroupArn": "arn:aws:elasticloadbalancing:ap-south-1:4444444444:targetgroup/MyTG/56abcccccccc56",
"Targets": [
{
"Id": {
"Ref": "ec2Instance1"
}
}
]
}
}
是否可以选择仅创建新实例并将其附加到现有目标组?
是的,您可以通过 lambda function 形式的自定义资源来实现。function 将使用 AWS SDK(例如boto3
)将实例附加到现有目标组。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.