Interface IGraphqlApi
Interface for GraphQL.
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IGraphqlApi : IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Interface IGraphqlApi Inherits IResource, IConstruct, IDependable, IEnvironmentAware
Synopsis
Properties
| ApiId | an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'. |
| Arn | the ARN of the API. |
| GraphQLEndpointArn | The GraphQL endpoint ARN. |
| Modes | The Authorization Types for this GraphQL Api. |
| Visibility | the visibility of the API. |
Methods
| AddDynamoDbDataSource(string, ITable, IDataSourceOptions?) | add a new DynamoDB data source to this API. |
| AddElasticsearchDataSource(string, IDomain, IDataSourceOptions?) | (deprecated) add a new elasticsearch data source to this API. |
| AddEventBridgeDataSource(string, IEventBus, IDataSourceOptions?) | Add an EventBridge data source to this api. |
| AddHttpDataSource(string, string, IHttpDataSourceOptions?) | add a new http data source to this API. |
| AddLambdaDataSource(string, IFunction, IDataSourceOptions?) | add a new Lambda data source to this API. |
| AddNoneDataSource(string, IDataSourceOptions?) | add a new dummy data source to this API. |
| AddOpenSearchDataSource(string, IDomain, IDataSourceOptions?) | Add a new OpenSearch data source to this API. |
| AddRdsDataSource(string, IServerlessCluster, ISecret, string?, IDataSourceOptions?) | add a new Rds data source to this API. |
| AddRdsDataSourceV2(string, IDatabaseCluster, ISecret, string?, IDataSourceOptions?) | add a new Rds Serverless V2 data source to this API. |
| AddSchemaDependency(CfnResource) | Add schema dependency if not imported. |
| CreateResolver(string, IExtendedResolverProps) | creates a new resolver for this datasource and API using the given properties. |
| Grant(IGrantable, IamResource, params string[]) | Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy. |
| GrantMutation(IGrantable, params string[]) | Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy. |
| GrantQuery(IGrantable, params string[]) | Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy. |
| GrantSubscription(IGrantable, params string[]) | Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy. |
Properties
ApiId
an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
string ApiId { get; }
Property Value
Remarks
Attribute: true
Arn
GraphQLEndpointArn
Modes
The Authorization Types for this GraphQL Api.
AuthorizationType[] Modes { get; }
Property Value
Visibility
Methods
AddDynamoDbDataSource(string, ITable, IDataSourceOptions?)
add a new DynamoDB data source to this API.
DynamoDbDataSource AddDynamoDbDataSource(string id, ITable table, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- table ITable
The DynamoDB table backing this data source.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
AddElasticsearchDataSource(string, IDomain, IDataSourceOptions?)
(deprecated) add a new elasticsearch data source to this API.
[Obsolete("- use `addOpenSearchDataSource`")]
ElasticsearchDataSource AddElasticsearchDataSource(string id, IDomain domain, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- domain IDomain
The elasticsearch domain for this data source.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
Remarks
Stability: Deprecated
AddEventBridgeDataSource(string, IEventBus, IDataSourceOptions?)
Add an EventBridge data source to this api.
EventBridgeDataSource AddEventBridgeDataSource(string id, IEventBus eventBus, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- eventBus IEventBus
The EventBridge EventBus on which to put events.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
AddHttpDataSource(string, string, IHttpDataSourceOptions?)
add a new http data source to this API.
HttpDataSource AddHttpDataSource(string id, string endpoint, IHttpDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- endpoint string
The http endpoint.
- options IHttpDataSourceOptions
The optional configuration for this data source.
Returns
AddLambdaDataSource(string, IFunction, IDataSourceOptions?)
add a new Lambda data source to this API.
LambdaDataSource AddLambdaDataSource(string id, IFunction lambdaFunction, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- lambdaFunction IFunction
The Lambda function to call to interact with this data source.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
AddNoneDataSource(string, IDataSourceOptions?)
add a new dummy data source to this API.
NoneDataSource AddNoneDataSource(string id, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
Remarks
Useful for pipeline resolvers and for backend changes that don't require a data source.
AddOpenSearchDataSource(string, IDomain, IDataSourceOptions?)
Add a new OpenSearch data source to this API.
OpenSearchDataSource AddOpenSearchDataSource(string id, IDomain domain, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- domain IDomain
The OpenSearch domain for this data source.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
AddRdsDataSource(string, IServerlessCluster, ISecret, string?, IDataSourceOptions?)
add a new Rds data source to this API.
RdsDataSource AddRdsDataSource(string id, IServerlessCluster serverlessCluster, ISecret secretStore, string? databaseName = null, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- serverlessCluster IServerlessCluster
The serverless cluster to interact with this data source.
- secretStore ISecret
The secret store that contains the username and password for the serverless cluster.
- databaseName string
The optional name of the database to use within the cluster.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
AddRdsDataSourceV2(string, IDatabaseCluster, ISecret, string?, IDataSourceOptions?)
add a new Rds Serverless V2 data source to this API.
RdsDataSource AddRdsDataSourceV2(string id, IDatabaseCluster serverlessCluster, ISecret secretStore, string? databaseName = null, IDataSourceOptions? options = null)
Parameters
- id string
The data source's id.
- serverlessCluster IDatabaseCluster
The serverless V2 cluster to interact with this data source.
- secretStore ISecret
The secret store that contains the username and password for the serverless cluster.
- databaseName string
The optional name of the database to use within the cluster.
- options IDataSourceOptions
The optional configuration for this data source.
Returns
AddSchemaDependency(CfnResource)
Add schema dependency if not imported.
bool AddSchemaDependency(CfnResource construct)
Parameters
- construct CfnResource
the dependee.
Returns
CreateResolver(string, IExtendedResolverProps)
creates a new resolver for this datasource and API using the given properties.
Resolver CreateResolver(string id, IExtendedResolverProps props)
Parameters
- id string
- props IExtendedResolverProps
Returns
Grant(IGrantable, IamResource, params string[])
Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.
Grant Grant(IGrantable grantee, IamResource resources, params string[] actions)
Parameters
- grantee IGrantable
The principal.
- resources IamResource
The set of resources to allow (i.e. ...:[region]:[accountId]:apis/GraphQLId/...).
- actions string[]
The actions that should be granted to the principal (i.e. appsync:graphql ).
Returns
GrantMutation(IGrantable, params string[])
Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.
Grant GrantMutation(IGrantable grantee, params string[] fields)
Parameters
- grantee IGrantable
The principal.
- fields string[]
The fields to grant access to that are Mutations (leave blank for all).
Returns
GrantQuery(IGrantable, params string[])
Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.
Grant GrantQuery(IGrantable grantee, params string[] fields)
Parameters
- grantee IGrantable
The principal.
- fields string[]
The fields to grant access to that are Queries (leave blank for all).
Returns
GrantSubscription(IGrantable, params string[])
Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.
Grant GrantSubscription(IGrantable grantee, params string[] fields)
Parameters
- grantee IGrantable
The principal.
- fields string[]
The fields to grant access to that are Subscriptions (leave blank for all).