Cloudformation Template Error

usability
external
server
(cqueenan) #1

I am trying to use the CloudFormation Template Step to create a stack in AWS. I have done this before so it is not a permission/configuration issue.

The issue I run into is that when I deploy I get the following error:
Amazon.CloudFormation.AmazonCloudFormationException: The service returned an error with Error Code ValidationError and HTTP Body:
Sender
ValidationError
1 validation error detected: Value 'AWSTemplateFormatVersion: ‘2010-09-09’…

Default: —> Amazon.Runtime.Internal.HttpErrorResponseException: The remote server returned an error: (400) Bad Request. —> System.Net.WebException: The remote server returned an error: (400) Bad Request.

If I run the exact same template and parameters directly from the AWS Console it works. So I am 99% sure the template itself is fine.

I’m stuck trying to figure out what is wrong. In my head I’m down to either the Yaml file is too long OR there is some sort of special character in the file that is throwing it off.

Is there a length limit I should be aware of? Are there any special characters that can’t be used?
Is there something else I’m missing?

thanks

(Tina) #3

Hi,
Thanks for reaching out! Sorry to hear your running into this error with the CloudFormation Template Step.

If possible, can you send over the Process Json for this project and the Raw Task log from the failed build?

Thank you,
Tina

(cqueenan) #4

Here you go.
ServerTasks-112454.log.txt (27.9 KB)

chris-test-process.json (137 KB)

(cqueenan) #5

Just wondering if there is an update.

(Tina) #7

Hi,
Sorry for the delay in getting back to you.

I’m currently running into an error importing your json file that might be the source of the “Bad Request” error. Although, I’m thinking this should have shown up when you verified the template directory in the AWS console.

Error: Parameter names ‘Region’, ‘AWS Account’, ‘Dynamo Table Name’, ‘Dynamo Key Json’, ‘Dynamo update Expression’, ‘Dynamo Expression Attribute Values’ are already in use by other Parameters in this step template. Parameter names must be unique.

I’m checking with our engineering team this evening, as they’re in Australia, to see if this validation error could be related or if it’s just a red herring.

Hope to have answer for you shortly.
Tina

(cqueenan) #8

Any update?

(Tina) #9

Hi @cqueenan,
Thanks for the follow-up. We’re just getting back from the Holiday break.

Unfortunately, it does appear that the Parameter names must be unique. As a test, try updating the parameter names to see if the error persists.

Give this a try and let me know how it goes.

Thank you,
Tina

(cqueenan) #10

I’m confused…what parameter name is not correct?

Thanks

(cqueenan) #11

Hi -
I’m still not sure what you are asking me to do.

But here is what I have just done and I’m getting the same results.

I took the updated template and created a new step template. I then created coorespoding parameters for that step template matching the Templates parameters. Each variable is unique and starts with an s_

I then took my existing process that works using the old template and added the new step template updated/used the new variables and ran it.

I am getting the same results. When it fails, it is not even creating a stack in AWS it fails before it gets there.

(Tina) #12

Hi @cqueenan,
Sorry for the delay in getting back to you. I can see why this doesn’t make sense to you. The error I was seeing is most certainly a red herring. My apologies for the misdirection.

I’m returning to your original question whether there is a body length limit. Sorry for not answering that the first time. Unfortunately, AWS only allows a maximum request body of 51200 bytes, https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html).

I’m not 100% confident that this is your issue since you can successfully run the template in the AWS console, but do think it’s something to rule out.

If this is the case, you may want to try creating multiple steps out of your Template to keep the request under the limit.

Once again, I’m very sorry for the misdirection. Let me know what you find.

Kind Regards,

Tina

(cqueenan) #13

Is there anyway to see how many bytes I’m sending from octopus?

Also is there a way to see the exact command that octopus is passing to the CLI? The template with the parameters.

(Tina) #14

Hi @cqueenan,
Unfortunately, there is not an easy way to see this information in Octopus. Running the request through a tool like Fiddler should give you the request size.

I’m unaware of a way to pull the entire command including template and variables. I’m reaching out to my teammates to see if someone else knows how this can be done. In the meantime, you may want to test the step with a simplified version of the template.