NETworkManager icon indicating copy to clipboard operation
NETworkManager copied to clipboard

AWS Systems Manager - Session Manager

Open BornToBeRoot opened this issue 3 years ago • 0 comments

Describe your feature request: Connect to AWS with default profile and get the instance ids to connect to.

public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            AWSConfigs.AWSProfileName = "dotnet-tutorials";
            AWSConfigs.AWSRegion = "eu-central-1";

            test();
        }

        public async void test ()
        {
            var client = new AmazonEC2Client();

            Amazon.EC2.Model.DescribeInstancesResponse xes = await client.DescribeInstancesAsync();

            foreach(var x in xes.Reservations[0].Instances)
            {
                Debug.WriteLine(x.InstanceId);

                foreach(var y in x.Tags)
                {
                    if (y.Key == "Name")
                        Debug.WriteLine(y.Value);
                }
            }
            
        }
    }

BornToBeRoot avatar Aug 17 '22 22:08 BornToBeRoot