【发布时间】:2021-12-19 03:38:43
【问题描述】:
我正在创建一个多租户架构。每当新租户注册我的平台时,我都需要复制我的资源。
我在我的 SAM 项目中创建了一个堆栈集,如下所示:
StackSet:
Type: AWS::CloudFormation::StackSet
Properties:
Capabilities:
- "CAPABILITY_IAM"
- "CAPABILITY_NAMED_IAM"
- "CAPABILITY_AUTO_EXPAND"
AdministrationRoleARN: !GetAtt AdministrationRole.Arn
ExecutionRoleName: !Ref ExecutionRole
OperationPreferences:
FailureToleranceCount: 0
MaxConcurrentCount: 1
PermissionModel: 'SELF_MANAGED'
StackInstancesGroup:
- DeploymentTargets:
Accounts:
- !Ref AWS::AccountId
Regions:
- !Ref AWS::Region
- DeploymentTargets:
Accounts:
- !Ref AWS::AccountId
Regions:
- !Ref AWS::Region
Tags:
-
Key: 'PROJECT'
Value: 'imaclegal'
StackSetName: 'imaclegal'
TemplateURL: 'https://s3.amazonaws.com/a-child-s3/output.yaml'
当我执行sam deploy 时,我得到这个错误:
资源 StackSet 的属性验证失败,消息为:#: #: 2 个子模式中只有 1 个匹配 #/StackInstancesGroup: 数组项不是唯一的
所以我似乎无法在同一个 AWS 账户和区域中部署超过 1 个实例,有没有办法在同一个 AWS 账户和区域中完成多个实例?或者有没有其他更好的方法来为我的新租户复制我的资源?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation multi-tenant aws-sam