Skip to content

'PosixPermissions' does not exist in type 'IResolvable | OptionsProperty'.

0

Hi fellow AWS people. I'm trying to set up a datasync task using cdk typescript. The task looks like this:

new datasync.CfnTask(this, 'name', {
      destinationLocationArn: destinationLocation.attrLocationArn,
      sourceLocationArn: sourceLocation.attrLocationArn,
      name: 'task1',
      options: {
        verifyMode: 'ONLY_FILES_TRANSFERRED', // Verify only the data transferred
        overwriteMode: 'ALWAYS', // Overwrite files: Yes
        preserveDeletedFiles: 'PRESERVE', // Keep deleted files: Yes
        bytesPerSecond: 200 * 1024 * 1024, // Bandwidth limit: 200 MiB/s
        taskQueueing: 'ENABLED', // Queueing: Yes
        logLevel: 'TRANSFER',
        objectTags: 'NONE',
        PosixPermissions: 'PRESERVE'
      },
      excludes: [
        {
          filterType: 'SIMPLE_PATTERN',
          value: '*.xlsx', // Exclude: *.xlsx
        },
      ],
      schedule: { scheduleExpression:'cron(30 00/3 ? * MON,TUE,WED,THU,FRI,SAT *)'},
      cloudWatchLogGroupArn: logGroupApprovalZoneSync.logGroupArn,
      tags: [{
          key: 'Key',
          value: 'Value',
      },
      {
          key: 'Key',
          value: 'Value',
      }]
    });

When i try to deploy this code i get this error:

error TS2322: Type '{ verifyMode: string; overwriteMode: string; preserveDeletedFiles: string; bytesPerSecond: number; taskQueueing: string; logLevel: string; objectTags: string; PosixPermissions: string; }' is not assignable to type 'IResolvable | OptionsProperty | undefined'. Object literal may only specify known properties, and 'PosixPermissions' does not exist in type 'IResolvable | OptionsProperty'.

If i delete PosixPermissions from options the task is successfully deployed and works.

According to this documentation:

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_datasync.CfnTaskProps.html

It should work, but it does not. Can someone help be highlight my mistake?

2 Answers
0

The error you're encountering is due to the PosixPermissions property in the options object of your AWS DataSync task configuration not being recognized. This could be due to outdated TypeScript definitions for the AWS CDK or a discrepancy between AWS service and the AWS CDK. To resolve this, ensure you're using the latest AWS CDK version, consider using AWS CLI as a workaround, or contact AWS Support for further assistance.

EXPERT
answered 2 years ago
0

Hi,

It seems like the PosixPermissions property is not denoted correctly. As per the documentation, https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_datasync.CfnTaskProps.html, the correct way to denote would be:

posixPermissions

Please let us know if this helped in fixing your issue. If you still face any errors, please feel free to reply on this thread and we will be pleased to assist you further.

AWS
SUPPORT ENGINEER
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.