Amazon.EC2.Util.VPCUtilities.FindNATImage C# (CSharp) Метод

FindNATImage() публичный статический Метод

Find the current VPC NAT image in the region for the AmazonEC2 client.
public static FindNATImage ( IAmazonEC2 ec2Client ) : Image
ec2Client IAmazonEC2 The ec2client used to look up the image.
Результат Image
        public static Image FindNATImage(IAmazonEC2 ec2Client)
        {
            if (ec2Client == null)
                throw new ArgumentNullException("ec2Client");
            
            List<Filter> filters = new List<Filter>()
            {
                new Filter(){Name = "architecture", Values = new List<string>(){"x86_64"}},
                new Filter(){Name = "name", Values = new List<string>(){"ami-vpc-nat-*.x86_64-ebs"}}
            };
            DescribeImagesResponse imageResponse = ec2Client.DescribeImages(new DescribeImagesRequest() { Filters = filters });
            var image = imageResponse.Images.OrderByDescending(x => x.Name).FirstOrDefault();

            return image;
        }