使用AWS Cloudformation create-stack-instances指定组织单位

时间:2019-03-20 12:32:45

标签: amazon-web-services amazon-cloudformation aws-organizations

我正在尝试通过指定ou将实例添加到StackSet。使用控制台可以做到这一点,但似乎找不到使用cli的方法。当我使用ou码时出现错误:

aws cloudformation create-stack-instances --stack-set-name test-stack --accounts "ou-1234-asdfsfsdf" --regions '["eu-west-1"]' --operation-preferences FailureToleranceCount=0,MaxConcurrentCount=1

An error occurred (ValidationError) when calling the CreateStackInstances operation: 1 validation error detected: Value '[ou-1234-asdfsfsdf]' at 'accounts' failed to satisfy constraint: Member must satisfy constraint: [Member must satisfy regular expression pattern: [0-9]{12}]

1 个答案:

答案 0 :(得分:0)

使用 --deployment-targets OrganizationalUnitIds=string 结构而不是在帐户中指定 OU

https://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack-instances.html