Issue
Executing an AWS CloudFormation Template which is larger than 51200 bytes as an artifact leads to the following error in Spinnaker when using the CloudFormation Stage
'templateBody' failed to satisfy constraint: Member must have length less than or equal to 51200
Cause
The process of ingesting an Artifact, even from S3, is to take the artifact into Spinnaker so it can be manipulated and used across stages. At that point, the file is no longer being ingested direction from S3, and is therefore, constrained by the AWS file size limitations outlined here:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html
Solution
To get around this issue, we recommend either restructuring your CloudFormation Templates using Nested Stacks as suggested by AWS
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html
Or you can also create a simple AWS CloudFormation template using the aws::include
function
With the AWS Include Function, you can simply create an AWS CloudFormation Template which will be used to only ingest your YAML or JSON file from an S3 Bucket location. An example of this would be to do the following
- Create your CloudFormation Stage in Spinnaker
- Your Template Configuration can be as simple as
AWSTemplateFormatVersion: '2010-09-09' Transform: Name: 'AWS::Include' Parameters: Location: 's3://<bucketName>/<folderPath>/<filename>'
- Make sure you include the Capability,
CAPABILITY_AUTO_EXPAND
within the stage
or you will receive an errorError Code: InsufficientCapabilitiesException;
- Save and run your pipeline
As Tested On Version
2.19.x