• Checks if the given value is an AWS ARN string (as specified in the AWS Documentation).

    Beware that this decorator only checks for syntactic validity, it does not check if the partition, service or region really exists. The region and account id are always optional, even if required for the specific service.

    For example, the following strings are considered valid if though they are technically not:

    • arn:aws:foo:eu-central-1:bar (there is no foo AWS service)
    • arn:aws:ec2::123456789012:instance/i-1234567890abcdef0 (EC2 requires a region which is omitted)
    • arn:aws:ec2:us-east-42:123456789012:instance/i-1234567890abcdef0 (the region us-east-42 does not exist)

    Example

    // Ensure the value is a valid looking AWS ARN string
    @IsAwsARN()
    arn: string = 'arn:aws:clouddirectory:us-west-2:123456789012:schema/development/cognito'

    Parameters

    • Optional options: ValidationOptions

      Generic class-validator options.

    Returns PropertyDecorator