Closed niros1 closed 3 years ago
Oh this is very interesting! Would you mind sharing the change in the pipeline.yml
file that cause the template size to be greater than 51200?
Maybe we can help trim the size, there is no short term fix that I can think of for this 🤔 until we upload the template to an S3 bucket
Just added the prod section (which is currently comment out )
my pipeline.yml
source:
# The name of the provider that is used to store the source artifacts.
provider: Bitbucket
# Additional properties that further specifies the exact location
# the artifacts should be sourced from. For example, the GitHub provider
# has the following properties: repository, branch.
properties:
branch: master
repository: url to repository
# The deployment section defines the order the pipeline will deploy
# to your environments.
stages:
- # The name of the environment to deploy to.
name: dev
# Optional: flag for manual approval action before deployment.
# requires_approval: true
# Optional: use test commands to validate this stage of your build.
# test_commands: [echo 'running tests', make test]
- # The name of the environment to deploy to.
name: test
# Optional: flag for manual approval action before deployment.
requires_approval: true
# Optional: use test commands to validate this stage of your build.
# test_commands: [echo 'running tests', make test]
# - # The name of the environment to deploy to.
# name: prod
# # Optional: flag for manual approval action before deployment.
# requires_approval: true
# # Optional: use test commands to validate this stage of your build.
# # test_commands: [echo 'running tests', make test]
From some reason I can't see Janice reply (maybe it was deleted?), according to the mail the suggestion was to use nested stack but I am not sure I can I do that, the Copilot create the stack , not under my control.
Haha, yes, that was why I deleted it. 😄 Would you mind showing me the template generated when it's successful (without prod)?
Here it is:
AWSTemplateFormatVersion: '2010-09-09' Description: CodePipeline for bv-brain-core Resources: SourceConnection: Type: AWS::CodeStarConnections::Connection Properties: ConnectionName: copilot-git@b-digiu-be-services ProviderType: Bitbucket BuildProjectRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: 2012-10-17 Statement:
# that is in the same region as the pipeline.
# Loop through all the artifact buckets created in the stackset
Resource:
- kms:*
# TODO: This might not be necessary. We may only need the KMS key
# that is in the same region as the pipeline.
# Loop through all the KMS keys used to en/decrypt artifacts
# across (cross-regional) pipeline stages, with each stage
# backed by a (regional) S3 bucket.
Resource:
- arn:aws:kms:eu-west-1:913084587205:key/a7c3a20e-a6de-4ac8-9d73-d34a7497ac47
EncryptionKey: !ImportValue bv-brain-core-ArtifactKey ServiceRole: !GetAtt BuildProjectRole.Arn Artifacts: Type: CODEPIPELINE Cache: Modes:
ChangeSetName: bv-brain-core-dev-bv-brain-dummy4cf ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-brain-dummy4cf Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-brain-dummy4cf-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-brain-dummy4cf-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-brain-emotion ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-brain-emotion Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-brain-emotion-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-brain-emotion-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-svc-brain ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-svc-brain Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-svc-brain-assets ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-svc-brain-assets Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-assets-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-assets-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-svc-brain-exe ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-svc-brain-exe Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-exe-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-exe-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-svc-brain-resolver ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-svc-brain-resolver Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-resolver-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-resolver-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-svc-digi-gtw ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-svc-digi-gtw Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-digi-gtw-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-digi-gtw-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-bv-svc-ext-api-gtw ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-bv-svc-ext-api-gtw Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-ext-api-gtw-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-ext-api-gtw-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-dev-dgu-keyclaok ActionMode: CREATE_UPDATE StackName: bv-brain-core-dev-dgu-keyclaok Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/dgu-keyclaok-dev.stack.yml TemplateConfiguration: BuildOutput::infrastructure/dgu-keyclaok-dev.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-dev-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-brain-dummy4cf ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-brain-dummy4cf Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-brain-dummy4cf-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-brain-dummy4cf-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-brain-emotion ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-brain-emotion Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-brain-emotion-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-brain-emotion-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-svc-brain ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-svc-brain Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-svc-brain-assets ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-svc-brain-assets Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-assets-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-assets-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-svc-brain-exe ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-svc-brain-exe Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-exe-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-exe-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-svc-brain-resolver ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-svc-brain-resolver Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-brain-resolver-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-brain-resolver-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-svc-digi-gtw ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-svc-digi-gtw Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-digi-gtw-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-digi-gtw-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-bv-svc-ext-api-gtw ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-bv-svc-ext-api-gtw Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/bv-svc-ext-api-gtw-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/bv-svc-ext-api-gtw-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole
ChangeSetName: bv-brain-core-test-dgu-keyclaok ActionMode: CREATE_UPDATE StackName: bv-brain-core-test-dgu-keyclaok Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND TemplatePath: BuildOutput::infrastructure/dgu-keyclaok-test.stack.yml TemplateConfiguration: BuildOutput::infrastructure/dgu-keyclaok-test.params.json
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-CFNExecutionRole InputArtifacts:
RoleArn: arn:aws:iam::CCCCCCC:role/bv-brain-core-test-EnvManagerRole Outputs: PipelineConnectionARN: Description: "ARN of CodeStar Connections connection" Value: !Ref SourceConnection
Thank you for pasting that. It looks like you have 9 services in your app, right? That must be why you're exceeding the 51,200 byte limit when you add a single env. We'll make the fix to upload the template to an S3 bucket as soon as we can! Thanks for bringing this issue to our attention.
👏🏼
Hi @niros1, apologies we had to revert the fix: https://github.com/aws/copilot-cli/pull/2228 🙇 but we're still actively working on it and should be able to send a patch for the fix in a follow-up pull-request.
10X for letting me know. anyhow it will be avail only in the next release right ?
We're planning to release soon v1.6.0 and the fix unfortunately won't be part of that release, but it will be in the next follow-up!
@niros1 the fix is officially out in v1.7.0! 🥳 https://github.com/aws/copilot-cli/releases/tag/v1.7.0
Hello, I added another environment to my pipeline and got the following error "'templateBody' failed to satisfy constraint: Member must have length less than or equal to 51200". For my understanding this is a CFN limitation, how can i avoid that?