[v2] -Error when referencing Open Search Service domain
Following the configuration structure in tests for open search service data source results in error.
openSearch: { type: 'AMAZON_OPENSEARCH_SERVICE', config: { endpoint: { 'Fn::GetAtt': ['MyEndpoint', 'Arn'] }, }, },
Error: Could not determine the Arn for dataSource 'openSearch
Version: 2.0.0-alpha.15
This is because you are providing arn where the plugin is expecting a domain url and the regex behind catches this. However even if you provide the correct url the auto created IAM role behind will have wrong arn specifiend and this will lead to forbidden error on requests.
One way to solve those issues is if you use domain variable instead of endpoint:
dataSources:
openSearch:
type: "AMAZON_OPENSEARCH_SERVICE"
config:
domain: OpenSearchDomain
Where 'OpenSearchDomain' is the cloudformation logical id. Example:
Resources:
OpenSearchDomain:
Type: AWS::OpenSearchService::Domain
Properties:
DomainName: "test-test"
The plugin will use the correct opensearch arn this way.