Describes a subnet.

Example #1
0
        public Subnet(AwsObjectRetriever awsObjectRetriever, Amazon.EC2.Model.Subnet amazonSubnet)
        {
            this._AmazonSubnet = amazonSubnet;

            //QUES: Single Sec group?
            // add Network Security Group if exists - 2 subnets - each acl is associated with both
            List <Amazon.EC2.Model.NetworkAcl> networkAcls = awsObjectRetriever.getNetworkAcls(this.Id);
            List <Amazon.EC2.Model.RouteTable> routeTable  = awsObjectRetriever.getRouteTables(this.Id);
        }
Example #2
0
        public void createModel(Package pkg, Amazon.EC2.Model.Subnet subnet)
        {
            // Get the model identifier
            string snId = subnet.SubnetId.ToString();

            // Create Subnet element
            Element subnetElement = pkg.Elements.AddNew(snId, "Class");

            subnetElement.Update();

            // Keep it in the cache
            this.AwsModelCache.Add(snId, subnetElement);
        }
Example #3
0
        public CreateSubnetModelWorkItemImpl NewCreateSubnetModelWorkItem(Package pkg, Amazon.EC2.Model.Subnet subnet)
        {
            CreateSubnetModelWorkItemImpl workItem = new CreateSubnetModelWorkItemImpl();

            workItem.Pkg    = pkg;
            workItem.Subnet = subnet;
            return(workItem);
        }
        public void GetSubnetsByVpcId_Ok()
        {
            // Arrange
            const string vpcId = "VpcOne";
            var subnetInVpcOne = new Subnet {VpcId = vpcId};
            var subnetInVpcTwo = new Subnet {VpcId = "VpcTwo"};
            var subnets = new List<Subnet>
            {
                subnetInVpcOne,
                subnetInVpcTwo
            };
            var response = new DescribeSubnetsResponse {Subnets = subnets};
            Ec2ClientMock.Setup(x => x.DescribeSubnets(It.IsAny<DescribeSubnetsRequest>())).Returns(response);

            // Act
            var actualSubnets = NetworkService.GetSubnets(vpcId);

            // Assert
            actualSubnets.Single().Should().BeSameAs(subnetInVpcOne);
        }