public AWSSubnet(Amazon.EC2.Model.Subnet subnet) { Name = "Unnamed"; if (subnet != null) { foreach (var tag in subnet.Tags.Where(tag => tag.Key == "Name")) { Name = tag.Value; } SubnetId = subnet.SubnetId; CidrBlock = subnet.CidrBlock; } }
private void SaveSubnetToDB(Amazon.RegionEndpoint regionEndpoint, Amazon.EC2.Model.Subnet subnet) { try { var client = new AmazonDynamoDBClient(regionEndpoint); var table = Table.LoadTable(client, "Subnet"); var jsonData = JsonConvert.SerializeObject(subnet); table.PutItem(Document.FromJson(jsonData)); } catch (Amazon.DynamoDBv2.Model.ResourceNotFoundException e) { Console.WriteLine("No Subnets found in {0}", regionEndpoint); } catch (Exception e) { Console.WriteLine(e); } }
public CreateSubnetResult WithSubnet(Amazon.EC2.Model.Subnet subnet) { this.subnetField = subnet; return(this); }
public CreateSubnetResult WithSubnet(Amazon.EC2.Model.Subnet subnet) { this.subnetField = subnet; return this; }