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.89.0 (build 2f74b3e)",
date="2023-11-02T10:21:14.294Z")
@Stability(Stable)
public class GraphqlApi
extends GraphqlApiBase
An AppSync GraphQL API.
Example:
GraphqlApi sourceApi = GraphqlApi.Builder.create(this, "FirstSourceAPI") .name("FirstSourceAPI") .definition(Definition.fromFile(join(__dirname, "appsync.merged-api-1.graphql"))) .build(); IGraphqlApi importedMergedApi = GraphqlApi.fromGraphqlApiAttributes(this, "ImportedMergedApi", GraphqlApiAttributes.builder() .graphqlApiId("MyApiId") .graphqlApiArn("MyApiArn") .build()); IRole importedExecutionRole = Role.fromRoleArn(this, "ExecutionRole", "arn:aws:iam::ACCOUNT:role/MyExistingRole"); SourceApiAssociation.Builder.create(this, "SourceApiAssociation2") .sourceApi(sourceApi) .mergedApi(importedMergedApi) .mergeType(MergeType.MANUAL_MERGE) .mergedApiExecutionRole(importedExecutionRole) .build();
-
Nested Class Summary
Nested ClassesNested 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
ConstructorsModifierConstructorDescriptionprotected
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 TypeMethodDescriptionaddSchemaDependency
(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 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, createResolver
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.
-
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.
-
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:
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
-
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
-