create_data_source
async
¶
create_data_source(
api_id: String,
name: ResourceName,
type: DataSourceType,
*,
config_overrides: Optional[AsyncAppSyncClientConfig] = None,
description: Optional[String] = None,
service_role_arn: Optional[String] = None,
dynamodb_config: Optional[DynamodbDataSourceConfig] = None,
lambda_config: Optional[LambdaDataSourceConfig] = None,
elasticsearch_config: Optional[ElasticsearchDataSourceConfig] = None,
open_search_service_config: Optional[OpenSearchServiceDataSourceConfig] = None,
http_config: Optional[HttpDataSourceConfig] = None,
relational_database_config: Optional[RelationalDatabaseDataSourceConfig] = None,
event_bridge_config: Optional[EventBridgeDataSourceConfig] = None,
metrics_config: Optional[DataSourceLevelMetricsConfig] = None,
) -> CreateDataSourceResponse
Creates a DataSource object.
Parameters:
-
api_id(String) –The API ID for the GraphQL API for the
DataSource. -
name(ResourceName) –A user-supplied name for the
DataSource. -
description(Optional[String], default:None) –A description of the
DataSource. -
type(DataSourceType) –The type of the
DataSource. -
service_role_arn(Optional[String], default:None) –The Identity and Access Management (IAM) service role Amazon Resource Name (ARN) for the data source. The system assumes this role when accessing the data source.
-
dynamodb_config(Optional[DynamodbDataSourceConfig], default:None) –Amazon DynamoDB settings.
-
lambda_config(Optional[LambdaDataSourceConfig], default:None) –Lambda settings.
-
elasticsearch_config(Optional[ElasticsearchDataSourceConfig], default:None) –Amazon OpenSearch Service settings.
As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use CreateDataSourceRequest$openSearchServiceConfig to create an OpenSearch data source.
-
open_search_service_config(Optional[OpenSearchServiceDataSourceConfig], default:None) –Amazon OpenSearch Service settings.
-
http_config(Optional[HttpDataSourceConfig], default:None) –HTTP endpoint settings.
-
relational_database_config(Optional[RelationalDatabaseDataSourceConfig], default:None) –Relational database settings.
-
event_bridge_config(Optional[EventBridgeDataSourceConfig], default:None) –Amazon EventBridge settings.
-
metrics_config(Optional[DataSourceLevelMetricsConfig], default:None) –Enables or disables enhanced data source metrics for specified data sources. Note that
metricsConfigwon't be used unless thedataSourceLevelMetricsBehaviorvalue is set toPER_DATA_SOURCE_METRICS. If thedataSourceLevelMetricsBehavioris set toFULL_REQUEST_DATA_SOURCE_METRICSinstead,metricsConfigwill be ignored. However, you can still set its value.metricsConfigcan beENABLEDorDISABLED.
Raises:
-
BadRequestException–The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.
-
ConcurrentModificationException–Another modification is in progress at this time and it must complete before you can make your change.
-
InternalFailureException–An internal AppSync error occurred. Try your request again.
-
NotFoundException–The resource specified in the request was not found. Check the resource, and then try again.
-
UnauthorizedException–You aren't authorized to perform this operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_appsync/_services/async_app_sync.py
818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 | |