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); } }
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); } }