Вам нужно:
AWS::SQS::Queue
AWS::Lambda::Function
AWS::Lambda::EventSourceMapping
"DequeueInstanceQueue": {
"Type": "AWS::SQS::Queue",
"Properties": {
"VisibilityTimeout": 301
},
"DeletionPolicy": "Delete"
},
"DequeueInstanceMapping": {
"Type": "AWS::Lambda::EventSourceMapping",
"Properties": {
"EventSourceArn": {
"Fn::GetAtt": [
"DequeueInstanceQueue",
"Arn"
]
},
"FunctionName": {
"Fn::GetAtt": [
"DequeueInstance",
"Arn"
]
},
"BatchSize": "1"
},
"DeletionPolicy": "Delete"
},
"DequeueInstance": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Runtime": "dotnetcore2.1",
"Environment": {
"Variables": {
"ServerName": {
"Fn::ImportValue": {
"Fn::Sub": "${DatabaseStack}-RdsEndpointAddress"
}
},
"DatabaseUserName": {
"Fn::ImportValue": {
"Fn::Sub": "${DatabaseStack}-MasterUsername"
}
},
"Password": {
"Fn::ImportValue": {
"Fn::Sub": "${DatabaseStack}-MasterUserPassword"
}
},
"BranchName": {
"Ref": "DbBranch"
},
"DequeueInstanceVehicleQueue": {
"Ref": "DequeueInstanceVehicleQueue"
}
}
},
"VpcConfig": {
"SecurityGroupIds": [
{
"Fn::ImportValue": {
"Fn::Sub": "${DatabaseStack}-DbGroup"
}
}
],
"SubnetIds": [
{
"Fn::ImportValue": {
"Fn::Sub": "${NetworkStack}-PrivateSubnet1"
}
},
{
"Fn::ImportValue": {
"Fn::Sub": "${NetworkStack}-PrivateSubnet2"
}
}
]
},
"Timeout": 300,
"Handler": "YadaYada.BubbleBoy.WebApi::YadaYada.BubbleBoy.WebApi.Functions.ProductMaker::DequeueInstance",
"MemorySize": 3008,
"Role": {
"Fn::GetAtt": [
"DequeueInstanceRole",
"Arn"
]
},
"Code": {
"S3Bucket": {
"Ref": "YadaYadaBubbleBoyWebApiBucket"
},
"S3Key": {
"Ref": "YadaYadaBubbleBoyWebApiKey"
}
}
},
"DeletionPolicy": "Delete"
},