How to use the @aws-cdk/cfnspec.schema.isTaggableResource function in @aws-cdk/cfnspec

To help you get started, we’ve selected a few @aws-cdk/cfnspec 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 / tools / cfn2ts / lib / codegen.ts View on Github external
function tagType(resource: schema.ResourceType): string {
  if (schema.isTaggableResource(resource)) {
    const prop = resource.Properties.Tags;
    if (schema.isTagPropertyStandard(prop)) {
      return `${TAG_TYPE}.STANDARD`;
    }
    if (schema.isTagPropertyAutoScalingGroup(prop)) {
      return `${TAG_TYPE}.AUTOSCALING_GROUP`;
    }
    if (schema.isTagPropertyJson(prop) || schema.isTagPropertyStringMap(prop)) {
      return `${TAG_TYPE}.MAP`;
    }
  }
  return `${TAG_TYPE}.NOT_TAGGABLE`;
}