aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.6k stars 3.9k forks source link

(aws-kendra): Datasource type "WEBCRAWLER" returns model validation error #16186

Closed quixoticmonk closed 3 years ago

quixoticmonk commented 3 years ago

Description of the bug: Creating a datasource of type " WEBCRAWLER" with CfnDataSource returns the following error `Resource handler returned message: "Model validation failed ( #/Type: # only 1 subschema matches out of 2)

Type: failed validation constraint for keyword [enum] (#/Type) RequestToken:`

Reproduction Steps

     self.indexKendra = kendra.CfnIndex(
            self, 'KendraIndex',
            edition = 'DEVELOPER_EDITION',
            name = 'index'
        )
        self.datasourceKendra = kendra.CfnDataSource(
            self, 'datasource',
            name = 'datasource',
            index_id = self.indexKendra.attr_id,
            type = 'WEBCRAWLER'
        )

What did you expect to happen?

What actually happened?

Error message as listed above.

Environment


This is :bug: Bug Report

BenChaimberg commented 3 years ago

This seems to be a CloudFormation issue – the type description in the CFN model (which we produce the L1 CfnDataSource from) includes "WEBCRAWLER" but the actual resource does not support it (here is the PR that I believe will add support for this feature: aws-cloudformation/aws-cloudformation-resource-providers-kendra#88). Feel free to open an issue in that repository, but it seems like support will be added soon.

quixoticmonk commented 3 years ago

The change on the cloudformation side is merged in. Is there a change needed on the CDK side to ingest these additional types ?

BenChaimberg commented 3 years ago

It depends on if there is a change to the CFN specification for this resource. If there is, then we will automatically get those changes and they will become available to CDK users in the following (weekly) release. If there are not, you can go ahead and use it now! Would love for you to confirm this and close this issue if so.

quixoticmonk commented 3 years ago

Confirming the issue remains on the current implementation. Will test with the next update on CDK.

quixoticmonk commented 3 years ago

@BenChaimberg Tested with version 1.121.0 and the issue remains. The change log mentioned getting the latest CfnSpec . Not sure if this includes the fix from the issue that was mentioned.

quixoticmonk commented 3 years ago

Any word on if this requires any work from the CDK side ?

BenChaimberg commented 3 years ago

I am fairly certain that it should not require any updates from CDK, just need to wait until the feature is released by the service

quixoticmonk commented 3 years ago

Still waiting on the cfn spec to be updated or be publicly available. Tested on v 1.123

quixoticmonk commented 3 years ago

The datasource type seems to be accepted as of today. @BenChaimberg Would this need to reflect the Webcrawler properties or is still a cfn spec update consumed by CDK ? https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_kendra/CfnDataSource.html#aws_cdk.aws_kendra.CfnDataSource.DataSourceConfigurationProperty Apologies on being a pest as I am trying to figure out if I need to write custom resources or wait for the native support.

BenChaimberg commented 3 years ago

@quixoticmonk Given that the service API has a type named WebCrawlerConfiguration, I would imagine a similar type will need to become available in the CFN spec in order for you to properly specify this resource.

However, since the model is technically not throwing errors anymore, this issue can probably be closed. Further, an automatic CFN spec update will add any new resources or types so there is no real need to track this. @skinny85 can make the call!

quixoticmonk commented 3 years ago

Closing the issue with the version 1.127.0, CfnSpec has been updated to include WebCrawler configuration.

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.