Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maxConcurrentCount not passed #117

Open
shellraiser opened this issue May 17, 2023 · 2 comments
Open

maxConcurrentCount not passed #117

shellraiser opened this issue May 17, 2023 · 2 comments

Comments

@shellraiser
Copy link

Found that when building CDK with maxConcurrentCount set, the setting does not get passed to the template that gets created. It sets the maxConcurrentCount as null instead.

class ApNortheast1Setup extends StackSetStack {
  constructor(scope: Construct, id: string, props: AwsConfigStacksetProps) {
    super(scope, id);

    const testRole = new Role(this, `${props.stage.name}ApNortheast1Role`, {});
  }
}

export class ApNortheast1Stackset extends DeploymentStack {
  constructor(parent: Construct, name: string, props: ApNortheast1StacksetProps) {
    super(parent, name, {
      ...props,
    });

    const apNortheast1Setup = new ApNortheast1Setup(this, `${props.stage.name}ApNortheast1`, props);

    new StackSet(this, `${props.stage.name}ApNortheast1StackSet`, {
      stackSetName: 'test-stackset-ap-northeast-1',
      description: 'Stackset that deploys withing ap-northeast-1',
      template: StackSetTemplate.fromStackSetStack(apNortheast1Setup),
      target: StackSetTarget.fromOrganizationalUnits({
        regions: [props.env.region],
        organizationalUnits: [props.mainOuId],
      }),
      capabilities: [Capability.NAMED_IAM],
      managedExecution: true,
      deploymentType: DeploymentType.serviceManaged({
        delegatedAdmin: false,
        autoDeployEnabled: true,
        autoDeployRetainStacks: false,
      }),
      operationPreferences: {
        regionConcurrencyType: RegionConcurrencyType.PARALLEL,
        maxConcurrentCount: 1000, // this doesn't work
        failureTolerancePercentage: 100,
      },
    });
  }
}

Expected: MaxConccurentCount is set to 1000
Actual Result: MaxConccurentCount set to null

@bpal410
Copy link

bpal410 commented Oct 15, 2024

It looks like neither maxConcurrentCount nor failureToleranceCount are actually being utilized from this interface. Only failureTolerancePercentage/maxConcurrentPercentage are used to synthesize the StackSet template

export interface OperationPreferences {
  readonly failureToleranceCount?: number;
  readonly failureTolerancePercentage?: number;
  readonly maxConcurrentCount?: number;
  readonly maxConcurrentPercentage?: number;
  readonly regionConcurrencyType?: RegionConcurrencyType;
  readonly regionOrder?: string[];
}

@moltar
Copy link

moltar commented Nov 25, 2024

Confirmed this not to be working. For those looking for a workaround:

    const cfnStackSet = stackSet.node.defaultChild; // stackSet is the instance of the cdk-stacksets class
    assert(cfnStackSet instanceof CfnStackSet); // type narrow
    cfnStackSet.operationPreferences = {
      // now you have access to these options
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants