# StackSetsConstraintOptions

Properties for deploying with Stackset, which creates a StackSet constraint.

Extends: [CommonConstraintOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.CommonConstraintOptions.html)
Used as argument in: [IPortfolio.deployWithStackSets](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.IPortfolio.html#deploywithstacksets)

- Source: [`aws-servicecatalog/lib/constraints.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-servicecatalog/lib/constraints.ts#L28)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

TypeScript:

```ts
declare const portfolio: servicecatalog.Portfolio;
declare const product: servicecatalog.CloudFormationProduct;

const adminRole = new iam.Role(this, 'AdminRole', {
  assumedBy: new iam.AccountRootPrincipal(),
});

portfolio.deployWithStackSets(product, {
  accounts: ['012345678901', '012345678902', '012345678903'],
  regions: ['us-west-1', 'us-east-1', 'us-west-2', 'us-east-1'],
  adminRole: adminRole,
  executionRoleName: 'SCStackSetExecutionRole', // Name of role deployed in end users accounts.
  allowStackSetInstanceOperations: true,
});
```

Python:

```python
# portfolio: servicecatalog.Portfolio
# product: servicecatalog.CloudFormationProduct

admin_role = iam.Role(self, "AdminRole",
    assumed_by=iam.AccountRootPrincipal()
)

portfolio.deploy_with_stack_sets(product,
    accounts=["012345678901", "012345678902", "012345678903"],
    regions=["us-west-1", "us-east-1", "us-west-2", "us-east-1"],
    admin_role=admin_role,
    execution_role_name="SCStackSetExecutionRole",  # Name of role deployed in end users accounts.
    allow_stack_set_instance_operations=True
)
```

Java:

```java
Portfolio portfolio;
CloudFormationProduct product;

Role adminRole = Role.Builder.create(this, "AdminRole")
        .assumedBy(new AccountRootPrincipal())
        .build();

portfolio.deployWithStackSets(product, StackSetsConstraintOptions.builder()
        .accounts(List.of("012345678901", "012345678902", "012345678903"))
        .regions(List.of("us-west-1", "us-east-1", "us-west-2", "us-east-1"))
        .adminRole(adminRole)
        .executionRoleName("SCStackSetExecutionRole") // Name of role deployed in end users accounts.
        .allowStackSetInstanceOperations(true)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Portfolio portfolio;
CloudFormationProduct product;

var adminRole = new Role(this, "AdminRole", new RoleProps {
    AssumedBy = new AccountRootPrincipal()
});

portfolio.DeployWithStackSets(product, new StackSetsConstraintOptions {
    Accounts = new [] { "012345678901", "012345678902", "012345678903" },
    Regions = new [] { "us-west-1", "us-east-1", "us-west-2", "us-east-1" },
    AdminRole = adminRole,
    ExecutionRoleName = "SCStackSetExecutionRole",  // Name of role deployed in end users accounts.
    AllowStackSetInstanceOperations = true
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var portfolio Portfolio
var product CloudFormationProduct

adminRole := iam.NewRole(this, jsii.String("AdminRole"), &RoleProps{
	AssumedBy: iam.NewAccountRootPrincipal(),
})

portfolio.deployWithStackSets(product, &StackSetsConstraintOptions{
	Accounts: []*string{
		jsii.String("012345678901"),
		jsii.String("012345678902"),
		jsii.String("012345678903"),
	},
	Regions: []*string{
		jsii.String("us-west-1"),
		jsii.String("us-east-1"),
		jsii.String("us-west-2"),
		jsii.String("us-east-1"),
	},
	AdminRole: adminRole,
	ExecutionRoleName: jsii.String("SCStackSetExecutionRole"),
	 // Name of role deployed in end users accounts.
	AllowStackSetInstanceOperations: jsii.Boolean(true),
})
```

## Properties

- `accounts`: string[] (required) — List of accounts to deploy stacks to.

- `adminRole`: [IRoleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) (required) — IAM role used to administer the StackSets configuration.

- `allowStackSetInstanceOperations`: boolean = false — Whether to allow end users to create, update, and delete stacks.

- `description`: string — The description of the constraint.

  **Default:** No description provided

- `executionRoleName`: string (required) — IAM role used to provision the products in the Stacks.

- `messageLanguage`: [MessageLanguage](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog.MessageLanguage.html) = English — The language code.

  Configures the language for error messages from service catalog.

- `regions`: string[] (required) — List of regions to deploy stacks to.
