How to use the @aws-cdk/aws-cloudformation.CloudFormationCapabilities function in @aws-cdk/aws-cloudformation

To help you get started, we’ve selected a few @aws-cdk/aws-cloudformation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / app-delivery / lib / pipeline-deploy-stack-action.ts View on Github external
function cfnCapabilities(adminPermissions: boolean, capabilities?: cfn.CloudFormationCapabilities[]): cfn.CloudFormationCapabilities[] {
  if (adminPermissions && capabilities === undefined) {
    // admin true default capability to NamedIAM and AutoExpand
    return [cfn.CloudFormationCapabilities.NAMED_IAM, cfn.CloudFormationCapabilities.AUTO_EXPAND];
  } else if (capabilities === undefined) {
    // else capabilities are undefined set AnonymousIAM and AutoExpand
    return [cfn.CloudFormationCapabilities.ANONYMOUS_IAM, cfn.CloudFormationCapabilities.AUTO_EXPAND];
  } else {
    // else capabilities are defined use them
    return capabilities;
  }
}