Class GraphqlApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.appsync.GraphqlApiBase
software.amazon.awscdk.services.appsync.GraphqlApi
- All Implemented Interfaces:
IResource,IGraphqlApi,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.93.0 (build 1706ca5)",
date="2024-01-03T18:29:22.016Z")
@Stability(Stable)
public class GraphqlApi
extends GraphqlApiBase
An AppSync GraphQL API.
Example:
import software.amazon.awscdk.services.events.*;
GraphqlApi api = GraphqlApi.Builder.create(this, "EventBridgeApi")
.name("EventBridgeApi")
.definition(Definition.fromFile(join(__dirname, "appsync.eventbridge.graphql")))
.build();
EventBus bus = EventBus.Builder.create(this, "DestinationEventBus").build();
EventBridgeDataSource dataSource = api.addEventBridgeDataSource("NoneDS", bus);
dataSource.createResolver("EventResolver", BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("emitEvent")
.requestMappingTemplate(MappingTemplate.fromFile("request.vtl"))
.responseMappingTemplate(MappingTemplate.fromFile("response.vtl"))
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.appsync.IGraphqlApi
IGraphqlApi.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedGraphqlApi(software.amazon.jsii.JsiiObjectRef objRef) GraphqlApi(software.constructs.Construct scope, String id, GraphqlApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddSchemaDependency(CfnResource construct) Add schema dependency to a given construct.static IGraphqlApifromGraphqlApiAttributes(software.constructs.Construct scope, String id, GraphqlApiAttributes attrs) Import a GraphQL API through this function.getApiId()an unique AWS AppSync GraphQL API identifier i.e.the configured API key, if present.The AppSyncDomainName of the associated custom domain.getArn()the ARN of the API.the URL of the endpoint created by AppSync.the CloudWatch Log Group for this API.getModes()The Authorization Types for this GraphQL Api.getName()the name of the API.the schema attached to this api (only available for GraphQL APIs, not available for merged APIs).grant(IGrantable grantee, IamResource resources, @NotNull String... actions) Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.grantMutation(IGrantable grantee, @NotNull String... fields) Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.grantQuery(IGrantable grantee, @NotNull String... fields) Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.grantSubscription(IGrantable grantee, @NotNull String... fields) Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.Methods inherited from class software.amazon.awscdk.services.appsync.GraphqlApiBase
addDynamoDbDataSource, addDynamoDbDataSource, addElasticsearchDataSource, addElasticsearchDataSource, addEventBridgeDataSource, addEventBridgeDataSource, addHttpDataSource, addHttpDataSource, addLambdaDataSource, addLambdaDataSource, addNoneDataSource, addNoneDataSource, addOpenSearchDataSource, addOpenSearchDataSource, addRdsDataSource, addRdsDataSource, addRdsDataSource, createResolverMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
GraphqlApi
protected GraphqlApi(software.amazon.jsii.JsiiObjectRef objRef) -
GraphqlApi
protected GraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
GraphqlApi
@Stability(Stable) public GraphqlApi(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GraphqlApiProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromGraphqlApiAttributes
@Stability(Stable) @NotNull public static IGraphqlApi fromGraphqlApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GraphqlApiAttributes attrs) Import a GraphQL API through this function.- Parameters:
scope- scope. This parameter is required.id- id. This parameter is required.attrs- GraphQL API Attributes of an API. This parameter is required.
-
addSchemaDependency
Add schema dependency to a given construct.- Specified by:
addSchemaDependencyin interfaceIGraphqlApi- Overrides:
addSchemaDependencyin classGraphqlApiBase- Parameters:
construct- the dependee. This parameter is required.
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull IamResource resources, @NotNull @NotNull String... actions) Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.- Parameters:
grantee- The principal. This parameter is required.resources- The set of resources to allow (i.e. ...:[region]:[accountId]:apis/GraphQLId/...). This parameter is required.actions- The actions that should be granted to the principal (i.e. appsync:graphql ). This parameter is required.
-
grantMutation
@Stability(Stable) @NotNull public Grant grantMutation(@NotNull IGrantable grantee, @NotNull @NotNull String... fields) Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.- Parameters:
grantee- The principal. This parameter is required.fields- The fields to grant access to that are Mutations (leave blank for all). This parameter is required.
-
grantQuery
@Stability(Stable) @NotNull public Grant grantQuery(@NotNull IGrantable grantee, @NotNull @NotNull String... fields) Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.- Parameters:
grantee- The principal. This parameter is required.fields- The fields to grant access to that are Queries (leave blank for all). This parameter is required.
-
grantSubscription
@Stability(Stable) @NotNull public Grant grantSubscription(@NotNull IGrantable grantee, @NotNull @NotNull String... fields) Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.- Parameters:
grantee- The principal. This parameter is required.fields- The fields to grant access to that are Subscriptions (leave blank for all). This parameter is required.
-
getApiId
an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.- Specified by:
getApiIdin interfaceIGraphqlApi- Specified by:
getApiIdin classGraphqlApiBase
-
getAppSyncDomainName
The AppSyncDomainName of the associated custom domain. -
getArn
the ARN of the API.- Specified by:
getArnin interfaceIGraphqlApi- Specified by:
getArnin classGraphqlApiBase
-
getGraphqlUrl
the URL of the endpoint created by AppSync. -
getLogGroup
the CloudWatch Log Group for this API. -
getModes
The Authorization Types for this GraphQL Api. -
getName
the name of the API. -
getSchema
the schema attached to this api (only available for GraphQL APIs, not available for merged APIs). -
getApiKey
the configured API key, if present.Default: - no api key
-