deployment: CF update launch configuration to launch template due to deprecation notice.

Link to the AWS announcement: https://aws.amazon.com/blogs/compute/amazon-ec2-auto-scaling-will-no-longer-add-support-for-new-ec2-features-to-launch-configurations/
pull/816/head
cruizba 2023-06-27 12:54:35 +02:00
parent ca19a1235d
commit 16c417e8e4
1 changed files with 69 additions and 62 deletions

View File

@ -705,12 +705,13 @@ Resources:
##### #####
# Media Node Autoscaling Group # Media Node Autoscaling Group
##### #####
MediaNodeAutoScalingLaunchConfiguration: MediaNodeLaunchTemplateConfiguration:
Type: AWS::AutoScaling::LaunchConfiguration Type: AWS::EC2::LaunchTemplate
Properties: Properties:
LaunchConfigurationName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGMediaNodeLaunchConfiguration'] ] LaunchTemplateName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGMediaNodeLaunchTemplate'] ]
SecurityGroups: LaunchTemplateData:
- !Ref MediaNodeSecurityGroup SecurityGroupIds:
- !GetAtt MediaNodeSecurityGroup.GroupId
ImageId: !GetAtt LambdaOnCreateInvoke.MediaNodeImageId ImageId: !GetAtt LambdaOnCreateInvoke.MediaNodeImageId
KeyName: !Ref KeyName KeyName: !Ref KeyName
InstanceType: !Ref AwsInstanceTypeKMS InstanceType: !Ref AwsInstanceTypeKMS
@ -725,7 +726,9 @@ Resources:
Type: AWS::AutoScaling::AutoScalingGroup Type: AWS::AutoScaling::AutoScalingGroup
Properties: Properties:
AutoScalingGroupName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGMediaNode'] ] AutoScalingGroupName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGMediaNode'] ]
LaunchConfigurationName: !Ref MediaNodeAutoScalingLaunchConfiguration LaunchTemplate:
LaunchTemplateId: !Ref MediaNodeLaunchTemplateConfiguration
Version: !GetAtt MediaNodeLaunchTemplateConfiguration.LatestVersionNumber
MinSize: !Ref MinMediaNodes MinSize: !Ref MinMediaNodes
MaxSize: !Ref MaxMediaNodes MaxSize: !Ref MaxMediaNodes
DesiredCapacity: !Ref DesiredMediaNodes DesiredCapacity: !Ref DesiredMediaNodes
@ -957,13 +960,15 @@ Resources:
##### #####
# OpenVidu Pro Master AutoScaling Group # OpenVidu Pro Master AutoScaling Group
##### #####
OpenViduProMasterNodeAutoScalingLaunchConfiguration: OpenViduProMasterNodeAutoScalingLaunchTemplate:
Type: AWS::AutoScaling::LaunchConfiguration Type: AWS::EC2::LaunchTemplate
Properties: Properties:
LaunchConfigurationName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGMasterNodeLaunchConfiguration'] ] LaunchTemplateName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGMasterNodeLaunchConfiguration'] ]
SecurityGroups: LaunchTemplateData:
- !Ref OpenViduSecurityGroup SecurityGroupIds:
IamInstanceProfile: !Ref OpenViduProMasterInstanceProfile - !GetAtt OpenViduSecurityGroup.GroupId
IamInstanceProfile:
Arn: !GetAtt OpenViduProMasterInstanceProfile.Arn
ImageId: !GetAtt LambdaOnCreateInvoke.MasterNodeImageId ImageId: !GetAtt LambdaOnCreateInvoke.MasterNodeImageId
KeyName: !Ref KeyName KeyName: !Ref KeyName
InstanceType: !Ref AwsInstanceTypeOV InstanceType: !Ref AwsInstanceTypeOV
@ -1009,7 +1014,9 @@ Resources:
Type: AWS::AutoScaling::AutoScalingGroup Type: AWS::AutoScaling::AutoScalingGroup
Properties: Properties:
AutoScalingGroupName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGOpenViduProMasterNode'] ] AutoScalingGroupName: !Join [ "-", [ !Ref 'AWS::StackName', 'ASGOpenViduProMasterNode'] ]
LaunchConfigurationName: !Ref OpenViduProMasterNodeAutoScalingLaunchConfiguration LaunchTemplate:
LaunchTemplateId: !Ref OpenViduProMasterNodeAutoScalingLaunchTemplate
Version: !GetAtt OpenViduProMasterNodeAutoScalingLaunchTemplate.LatestVersionNumber
TargetGroupARNs: TargetGroupARNs:
- !Ref TargetGroup - !Ref TargetGroup
MinSize: !Ref MinMasterNodes MinSize: !Ref MinMasterNodes