Example #1
0
func validateStack(svc *cloudformation.CloudFormation, stackBody string) (string, error) {

	input := &cloudformation.ValidateTemplateInput{
		TemplateBody: aws.String(stackBody),
	}

	validationReport, err := svc.ValidateTemplate(input)

	if err != nil {
		return "", fmt.Errorf("Invalid cloudformation stack: %v", err)
	}

	return validationReport.String(), err
}