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.104.0 (build e79254c)",
date="2024-10-31T19:12:53.210Z")
@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 classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.appsync.IGraphqlApi
IGraphqlApi.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
GraphqlApi
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
GraphqlApi
(software.amazon.jsii.JsiiObjectRef objRef) GraphqlApi
(software.constructs.Construct scope, String id, GraphqlApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnvironmentVariable
(String key, String value) Add an environment variable to the construct.addSchemaDependency
(CfnResource construct) Add schema dependency to a given construct.static IGraphqlApi
fromGraphqlApiAttributes
(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 GraphQL endpoint ARN.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).the visibility of the API.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, addRdsDataSourceV2, addRdsDataSourceV2, addRdsDataSourceV2, createResolver, grant, grantMutation, grantQuery, grantSubscription
Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods 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.
-
addEnvironmentVariable
Add an environment variable to the construct.- Parameters:
key
- This parameter is required.value
- This parameter is required.
-
addSchemaDependency
Add schema dependency to a given construct.- Specified by:
addSchemaDependency
in interfaceIGraphqlApi
- Overrides:
addSchemaDependency
in classGraphqlApiBase
- Parameters:
construct
- the dependee. This parameter is required.
-
getApiId
an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.- Specified by:
getApiId
in interfaceIGraphqlApi
- Specified by:
getApiId
in classGraphqlApiBase
-
getAppSyncDomainName
The AppSyncDomainName of the associated custom domain. -
getArn
the ARN of the API.- Specified by:
getArn
in interfaceIGraphqlApi
- Specified by:
getArn
in classGraphqlApiBase
-
getGraphQLEndpointArn
The GraphQL endpoint ARN.- Specified by:
getGraphQLEndpointArn
in interfaceIGraphqlApi
- Specified by:
getGraphQLEndpointArn
in 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.- Specified by:
getModes
in interfaceIGraphqlApi
- Specified by:
getModes
in classGraphqlApiBase
-
getName
the name of the API. -
getSchema
the schema attached to this api (only available for GraphQL APIs, not available for merged APIs). -
getVisibility
the visibility of the API.- Specified by:
getVisibility
in interfaceIGraphqlApi
- Specified by:
getVisibility
in classGraphqlApiBase
-
getApiKey
the configured API key, if present.Default: - no api key
-