From 80b097e3793252dd1156bcdf5c7bb45d13a6d54f Mon Sep 17 00:00:00 2001 From: cruizba Date: Thu, 24 Mar 2022 21:13:50 +0100 Subject: [PATCH] deployment: change some wrong names at cloudformation lambda. Remove not needed return --- .../ce/aws/CF-OpenVidu.yaml.template | 18 +++++++++--------- ...openvidu-server-pro-no-market.yaml.template | 7 +++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/openvidu-server/deployments/ce/aws/CF-OpenVidu.yaml.template b/openvidu-server/deployments/ce/aws/CF-OpenVidu.yaml.template index 68d66c2b..89c9e16a 100644 --- a/openvidu-server/deployments/ce/aws/CF-OpenVidu.yaml.template +++ b/openvidu-server/deployments/ce/aws/CF-OpenVidu.yaml.template @@ -284,7 +284,7 @@ Resources: owner: "root" group: "root" Properties: - ImageId: !GetAtt LambdaCopyAmiInvoke.ImageId + ImageId: !GetAtt CloudformationLambdaInvoke.ImageId InstanceType: !Ref InstanceType SecurityGroups: - !Ref WebServerSecurityGroup @@ -422,7 +422,7 @@ Resources: ########## # Lambda to Copy original AMI to the deployment region ########## - LambdaCopyAmiRole: + CloudformationLambdaRole: Type: 'AWS::IAM::Role' DeletionPolicy: Delete Properties: @@ -437,7 +437,7 @@ Resources: - 'sts:AssumeRole' Path: / Policies: - - PolicyName: !Join ['', [ !Ref AWS::StackName, '-lambda-policy-ami-copy'] ] + - PolicyName: !Join ['', [ !Ref AWS::StackName, '-cf-lambda-policy'] ] PolicyDocument: Version: 2012-10-17 Statement: @@ -446,13 +446,13 @@ Resources: - 'ec2:DescribeImages' - 'ec2:CopyImage' Resource: '*' - RoleName: !Join ['', [ !Ref AWS::StackName, '-lambda-role-ami-copy'] ] + RoleName: !Join ['', [ !Ref AWS::StackName, '-cf-lambda-role'] ] - LambdaCopyAmi: + CloudformationLambda: Type: AWS::Lambda::Function DeletionPolicy: Delete Properties: - FunctionName: !Join ['', [ !Ref AWS::StackName, '-lambda-ami-copy'] ] + FunctionName: !Join ['', [ !Ref AWS::StackName, '-cf-lambda'] ] Code: ZipFile: | import boto3 @@ -518,16 +518,16 @@ Resources: Handler: index.handler Role: - !GetAtt LambdaCopyAmiRole.Arn + !GetAtt CloudformationLambdaRole.Arn Runtime: python3.7 Timeout: 900 - LambdaCopyAmiInvoke: + CloudformationLambdaInvoke: Type: AWS::CloudFormation::CustomResource DeletionPolicy: Delete Version: "1.0" Properties: - ServiceToken: !GetAtt LambdaCopyAmi.Arn + ServiceToken: !GetAtt CloudformationLambda.Arn AmiSourceRegion: 'eu-west-1' AmiSourceId: !FindInMap [OVAMIMAP, 'eu-west-1', AMI] DeploymentRegion: !Ref AWS::Region diff --git a/openvidu-server/deployments/pro/aws/cfn-openvidu-server-pro-no-market.yaml.template b/openvidu-server/deployments/pro/aws/cfn-openvidu-server-pro-no-market.yaml.template index ebccc749..72856916 100644 --- a/openvidu-server/deployments/pro/aws/cfn-openvidu-server-pro-no-market.yaml.template +++ b/openvidu-server/deployments/pro/aws/cfn-openvidu-server-pro-no-market.yaml.template @@ -835,7 +835,7 @@ Resources: - 'sts:AssumeRole' Path: / Policies: - - PolicyName: !Join ['', [ !Ref AWS::StackName, '-lambda-policy-ami-copy'] ] + - PolicyName: !Join ['', [ !Ref AWS::StackName, '-cf-lambda-policy'] ] PolicyDocument: Version: 2012-10-17 Statement: @@ -861,13 +861,13 @@ Resources: 'aws:ResourceTag/ov-cluster-member': 'kms' 'aws:ResourceTag/ov-stack-name': !Ref AWS::StackName 'aws:ResourceTag/ov-stack-region': !Ref AWS::Region - RoleName: !Join ['', [ !Ref AWS::StackName, '-lambda-role-ami-copy'] ] + RoleName: !Join ['', [ !Ref AWS::StackName, '-cf-lambda-role'] ] CloudformationLambda: Type: AWS::Lambda::Function DeletionPolicy: Delete Properties: - FunctionName: !Join ['', [ !Ref AWS::StackName, '-lambda-ami-copy'] ] + FunctionName: !Join ['', [ !Ref AWS::StackName, '-cf-lambda'] ] Code: ZipFile: | import boto3 @@ -878,7 +878,6 @@ Resources: try: if (event['RequestType'] == 'Create'): copy_ami(event, context) - return elif (event['RequestType'] == 'Delete'): removeMediaNodes(event, context) else: