AppSyncOpenSearchDataSource
- class aws_cdk.aws_appsync.AppSyncOpenSearchDataSource(scope, id, *, domain, service_role=None, api, description=None, name=None)
Bases:
AppSyncBackedDataSourceAn Appsync datasource backed by OpenSearch.
- ExampleMetadata:
infused
Example:
import aws_cdk.aws_opensearchservice as opensearch domain = opensearch.Domain(self, "Domain", version=opensearch.EngineVersion.OPENSEARCH_2_17, encryption_at_rest=opensearch.EncryptionAtRestOptions( enabled=True ), node_to_node_encryption=True, enforce_https=True, capacity=opensearch.CapacityConfig( multi_az_with_standby_enabled=False ), ebs=opensearch.EbsOptions( enabled=True, volume_size=10 ) ) api = appsync.EventApi(self, "EventApiOpenSearch", api_name="OpenSearchEventApi" ) data_source = api.add_open_search_data_source("opensearchds", domain)
- Parameters:
scope (
Construct)id (
str)domain (
IDomain) – The OpenSearch domain containing the endpoint for the data source.service_role (
Optional[IRole]) – The IAM service role to be assumed by AppSync to interact with the data source. Default: - Create a new roleapi (
IApi) – The API to attach this data source to.description (
Optional[str]) – The description of the data source. Default: - Nonename (
Optional[str]) – The name of the data source. The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}. Any invalid characters will be automatically removed. Default: - id of data source
Methods
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- grant_principal
The principal of the data source to be IGrantable.
- name
The name of the data source.
- node
The tree node.
- resource
The underlying CFN data source resource.
Static Methods
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.