Beispiel #1
0
        internal void AuthorizeSecurityGroupIngress(string securityGroupName)
        {
            try
            {
                Client session = new Client(serviceUri, apiKey, secretKey);
                AuthorizeSecurityGroupIngressRequest request = new AuthorizeSecurityGroupIngressRequest()
                {
                    SecurityGroupName = securityGroupName,
                    Protocol = ProtocolType.tcp,
                    StartPort = 80,
                    EndPort = 80,
                    CidrList = "0.0.0.0/0"
                };
                session.AuthorizeSecurityGroupIngress(request);

                request = new AuthorizeSecurityGroupIngressRequest()
                {
                    SecurityGroupName = "TestSecurityGroup",
                    Protocol = ProtocolType.tcp,
                    StartPort = 22,
                    EndPort = 22,
                    CidrList = "0.0.0.0/0"
                };
                session.AuthorizeSecurityGroupIngress(request);
            }
            catch (Exception e)
            {
                WriteLog("Exception during AuthorizeSecurityGroupIngress {0}", e);
            }
        }