aws/copilot-cli

Env Stack fails with RoleName > 64

開放

#2,118 建立於 2021年3月29日

 (3 則留言) (0 個反應) (0 位負責人)Go (441 個分叉)auto 404
good first issuetype/enhancement

倉庫指標

星標
 (3,737 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

When creating the environment with the following options: copilot env init --app loooooooooooong-app-name --name loooooooooooooooong-svc-name --prod --region us-est-1 --import-vpc-id vpc-xxxxx --import-public-subnets subnet-xxxx,subnet-xxxx --import-private-subnets subnet-xxxxx,subnet-xxxx

The Stack fails with the error: CloudformationExecutionRole - 1 validation error detected: Value 'loooooooooooong-app-name-loooooooooooooooong-svc-name-CFNExecutionRole' at 'roleName' failed to satisfy constraint: Member must have length less than or equal to 64 (Service: AmazonIdentityManagement; Status Code: 400; Error Code: ValidationError; Request ID: fcbbe450-65fc-4cd5-b65b-1e9b539f22d7; Proxy: null)

Cfn Template: CloudformationExecutionRole: Metadata: 'aws:copilot:description': 'An IAM Role for AWS CloudFormation to manage resources' DeletionPolicy: Retain Type: AWS::IAM::Role Properties: RoleName: !Sub ${AWS::StackName}-CFNExecutionRole

Expected Behavior: Copilot CLI should validate that len(app-name) + len(svc-name) + len('-CFNExecutionRole') <= 64 and warn the user, before submiting the CFn template

貢獻者指南