Amazon.DNXCore.IntegrationTests.IntegrationTests.EC2.EC2TestHelper.disassociateAndDeleteDhcpOptionSet C# (CSharp) Method

disassociateAndDeleteDhcpOptionSet() public method

public disassociateAndDeleteDhcpOptionSet ( string vpcid ) : Task
vpcid string
return Task
        public async Task disassociateAndDeleteDhcpOptionSet(string vpcid)
        {
            DescribeVpcsResponse response = await _ec2Client.DescribeVpcsAsync(new DescribeVpcsRequest {
                VpcIds = new List<string>{ vpcid }
            });
            string dhcpOptionsId = response.Vpcs[0].DhcpOptionsId;

            await _ec2Client.AssociateDhcpOptionsAsync(new AssociateDhcpOptionsRequest {
                VpcId = vpcid,
                DhcpOptionsId = "default"
            });

            await _ec2Client.DeleteDhcpOptionsAsync(new DeleteDhcpOptionsRequest{DhcpOptionsId = dhcpOptionsId});
        }