public void CreateHostedZoneByName() { Template template = StackTest.GetNewBlankTemplateWithVpc($"Vpc{this.TestContext.TestName}"); string hostedZoneName = $"{this.TestContext.TestName}{Guid.NewGuid().ToString().Replace("-", string.Empty)}.com"; HostedZone hz = new HostedZone(hostedZoneName); template.Resources.Add(hostedZoneName, hz); StackTest.CreateTestStack(template, this.TestContext); }
public void CreatePrivateHostedZone() { Template template = StackTest.GetNewBlankTemplateWithVpc($"VpcCreatePrivateHostedZone"); string hostedZoneName = $"{this.TestContext.TestName}{Guid.NewGuid().ToString().Replace("-", string.Empty)}"; HostedZone hz = new HostedZone("example.com"); template.Resources.Add(hostedZoneName, hz); hz.AddVpc(template.Vpcs.First(), Region.UsEast1); StackTest.CreateTestStack(template, this.TestContext); }
public void RecordSetByZoneIdTest() { Template template = StackTest.GetNewBlankTemplateWithVpc($"Vpc{this.TestContext.TestName}"); string recordSetName = $"A{DateTime.Now.Ticks.ToString().Substring(10, 5)}"; recordSetName = "abc"; var target = RecordSet.AddByHostedZoneId(template, recordSetName, "Z1H285MI71YUD0", recordSetName + ".sircupsalot.com.", RecordSet.RecordSetTypeEnum.A); target.RecordSetType = RecordSet.RecordSetTypeEnum.A.ToString(); target.AddResourceRecord("206.190.36.45"); StackTest.CreateTestStack(template, this.TestContext); }
public void RecordSetMappedToEipTest() { Template template = StackTest.GetNewBlankTemplateWithVpc($"Vpc{this.TestContext.TestName}"); var DMZSubnet = new Subnet(template.Vpcs.First(), "10.0.0.0/20", AvailabilityZone.UsEast1A, true); template.Resources.Add("DMZSubnet", DMZSubnet); Instance testBox = new Instance(DMZSubnet, InstanceTypes.T2Micro, "ami-60b6c60a", OperatingSystem.Linux); template.Resources.Add("testbox", testBox); var eip = testBox.AddElasticIp(); var target = RecordSet.AddByHostedZoneName(template, "test", "getthebuybox.com.", "test.test.getthebuybox.com.", RecordSet.RecordSetTypeEnum.A); target.TTL = "60"; target.RecordSetType = RecordSet.RecordSetTypeEnum.A.ToString(); target.AddResourceRecord(new ReferenceProperty(eip)); StackTest.CreateTestStack(template, this.TestContext); }
public void RecordSetByNewHostZoneTest() { Template template = StackTest.GetNewBlankTemplateWithVpc($"Vpc{this.TestContext.TestName}"); HostedZone hz = new HostedZone("zeta.yadayada.software."); template.Resources.Add("hostedZoneRecordSetByNewHostZoneTest", hz); hz.AddVpc(template.Vpcs.First(), Region.UsEast1); var target = RecordSet.AddByHostedZone(template, "test", hz, "test.zeta.yadayada.software.", RecordSet.RecordSetTypeEnum.A); target.TTL = "60"; target.RecordSetType = RecordSet.RecordSetTypeEnum.A.ToString(); var DMZSubnet = new Subnet(template.Vpcs.First(), "10.0.0.0/20", AvailabilityZone.UsEast1A, true); template.Resources.Add("DMZSubnet", DMZSubnet); Instance testBox = new Instance(DMZSubnet, InstanceTypes.T2Micro, "ami-60b6c60a", OperatingSystem.Linux); template.Resources.Add("testbox", testBox); var eip = testBox.AddElasticIp(); target.AddResourceRecord(eip); StackTest.CreateTestStack(template, this.TestContext); }