public async Task DeleteCloudFormationStack()
        {
            var cloudFormationFixtureHelpers = new CloudFormationFixtureHelpers();
            var stackName        = GenerateStackName();
            var templateFilePath = cloudFormationFixtureHelpers.WriteTemplateFile(CloudFormationFixtureHelpers.GetBasicS3Template(stackName));

            cloudFormationFixtureHelpers.DeployTemplate(stackName, templateFilePath, new CalamariVariables());
            cloudFormationFixtureHelpers.DeleteStack(stackName);
            await cloudFormationFixtureHelpers.ValidateStackExists(stackName, false);
        }
        public async Task CreateOrUpdateCloudFormationS3Template()
        {
            var cloudFormationFixtureHelpers = new CloudFormationFixtureHelpers("us-east-1");
            var stackName = GenerateStackName();

            try
            {
                cloudFormationFixtureHelpers.DeployTemplateS3(stackName, new CalamariVariables());

                await cloudFormationFixtureHelpers.ValidateStackExists(stackName, true);
            }
            finally
            {
                cloudFormationFixtureHelpers.CleanupStack(stackName);
            }
        }
        public async Task CreateOrUpdateCloudFormationTemplate()
        {
            var cloudFormationFixtureHelpers = new CloudFormationFixtureHelpers();
            var stackName        = GenerateStackName();
            var templateFilePath = cloudFormationFixtureHelpers.WriteTemplateFile(CloudFormationFixtureHelpers.GetBasicS3Template(stackName));

            try
            {
                cloudFormationFixtureHelpers.DeployTemplate(stackName, templateFilePath, new CalamariVariables());

                await cloudFormationFixtureHelpers.ValidateStackExists(stackName, true);

                await cloudFormationFixtureHelpers.ValidateS3BucketExists(stackName);
            }
            finally
            {
                cloudFormationFixtureHelpers.CleanupStack(stackName);
            }
        }
Example #4
0
        public async Task CreateCloudFormationWithStructuredVariableReplacement()
        {
            var cloudFormationFixtureHelpers = new CloudFormationFixtureHelpers();
            var templateFilePath             = cloudFormationFixtureHelpers.WriteTemplateFile(CloudFormationFixtureHelpers.GetBasicS3Template(StackName));

            var variables = new CalamariVariables();

            variables.Set(KnownVariables.Package.EnabledFeatures, "Octopus.Features.JsonConfigurationVariables");
            variables.Set(ActionVariables.StructuredConfigurationVariablesTargets, templateFilePath);
            variables.Set($"Resources:{StackName}:Properties:BucketName", ReplacedName);

            try
            {
                cloudFormationFixtureHelpers.DeployTemplate(StackName, templateFilePath, variables);
                await cloudFormationFixtureHelpers.ValidateS3BucketExists(ReplacedName);
            }
            finally
            {
                cloudFormationFixtureHelpers.CleanupStack(StackName);
            }
        }