I'm using service managed permission to create_stack_instances for an OU, filtered by intersection of a list of accounts and when i run the command, it gives me an error, Can someone please tell me what's wrong with my code here?
error via cli
Parameter validation failed: Unknown parameter in DeploymentTargets: "AccountFilterType", must be one of: Accounts, AccountsUrl, OrganizationalUnitIds
error via lambda
[ERROR] ParamValidationError: Parameter validation failed: Unknown parameter in DeploymentTargets: "AccountFilterType", must be one of: Accounts, AccountsUrl, OrganizationalUnitIds
lambda code:
def add_stack_to_stackset(StackSetName, accountid):
response = CF.create_stack_instances( StackSetName=StackSetName, DeploymentTargets={ 'OrganizationalUnitIds': ['ou-blah'], 'Accounts': [accountid], 'AccountFilterType': 'INTERSECTION' }, Regions=['us-east-1'] ) op_id = response['OperationId'] return op_idcli code
aws cloudformation create-stack-instances --stack-set-name demo --deployment-targets OrganizationalUnitIds=ou-blah,Accounts=12345,AccountFilterType=INTERSECTION --regions us-east-1