DeleteStack() публичный Метод

public DeleteStack ( string stackName ) : void
stackName string
Результат void
Пример #1
0
        public void ThrowsWhenStackFailsToDetele()
        {
            var stackName = "AwsToolsRemovalThrowsWhenStackFailsToDeteleTest";
            var securityGroupName = "AwsToolsRemovalThrowsWhenStackFailsToDeteleTest";
            SetUp(stackName);

            var deployer = new Deployer(_awsConfiguration);
            try
            {
                deployer.CreateStack(new StackTemplate
                    {
                        StackName = stackName,
                        TemplatePath = CloudFormationTemplates.Path("example-basic-vpc.template")
                    });
                CreateSecurityGroup(securityGroupName, stackName);

                TestDelegate act = () => deployer.DeleteStack(stackName);

                Assert.Throws<FailedToDeleteStackException>(act);
            }
            finally
            {
                DeleteSecurityGroup(securityGroupName, stackName);
                DeletePreviousTestStack(stackName);
            }
        }
Пример #2
0
        public void DoesNotThrowWhenStackDoesNotExist()
        {
            var stackName = "AwsToolsRemovalDoesNotThrowWhenStackDoesNotExistTest";
            SetUp(stackName);
            var deployer = new Deployer(_awsConfiguration);
            var stack = _cloudFormationClient.ListStacks().StackSummaries.FirstOrDefault(s => s.StackName == stackName);

            Assert.IsTrue(stack == null || stack.StackStatus == StackStatus.DELETE_COMPLETE, "Stack should not exist!");

            TestDelegate act = () => deployer.DeleteStack(stackName);

            Assert.DoesNotThrow(act);
        }
Пример #3
0
        static void Main(string[] args)
        {
            var options = new Options();
            if (!Parser.Default.ParseArguments(args, options))
                Environment.Exit(1);

            var deployer = new Deployer(new AwsConfiguration
            {
                AwsEndpoint = RegionEndpoint.GetBySystemName(options.Region),
                RoleName = options.RoleName,
                Proxy = new AwsProxy { Host = options.ProxyHost, Port = options.ProxyPort }
            });
            deployer.DeleteStack(options.StackName);
        }
Пример #4
0
        public void DeletesExistingStack()
        {
            var stackName = "AwsToolsRemovalDeletesExistingStackTest";
            SetUp(stackName);

            var deployer = new Deployer(_awsConfiguration);
            deployer.CreateStack(new StackTemplate
            {
                StackName = stackName,
                TemplatePath = CloudFormationTemplates.Path("example-basic-vpc.template")
            });

            deployer.DeleteStack(stackName);

            var status = StackStatus.DELETE_IN_PROGRESS;
            status = WaitForStackDeleted(status, stackName);

            Assert.AreEqual(StackStatus.DELETE_COMPLETE, status);
        }