[英]AWS CDK Issue with Appsync
import this
from constructs import Construct
from aws_cdk import (
Duration,
Stack,
aws_iam as iam,
aws_appsync as appsync,
aws_dynamodb as dynamodb,
aws_lambda as lamb
)
class CdkStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
api = appsync.GraphqlApi(self, "Api",
name="demo",
schema=appsync.Schema.from_asset('graphql/schema.graphql'),
authorization_config=appsync.AuthorizationConfig(
default_authorization=appsync.AuthorizationMode(
authorization_type=appsync.AuthorizationType.IAM
)
),
xray_enabled=True
)
When I run 'cdk synth' I get the error --> AttributeError: module 'aws_cdk.aws_appsync' has no attribute 'GraphqlApi'.当我运行“cdk synth”时出现错误 --> AttributeError:模块“aws_cdk.aws_appsync”没有属性“GraphqlApi”。 Did you mean: 'CfnGraphQLApi'?
您是指“CfnGraphQLApi”吗?
However, GraphqlApi is an attribute in the pypi documentation.但是,GraphqlApi 是 pypi 文档中的一个属性。
You will find the GraphqlApi
construct in the aws_cdk.aws_appsync_alpha package.您将在aws_cdk.aws_appsync_alpha package 中找到
GraphqlApi
构造。
Not-yet-stable APIs are in separate "alpha" packages in CDK v2.尚未稳定的 API 位于 CDK v2 中的单独“alpha”包中。 The Appsync constructs are split between 2 packages,
aws_cdk.aws_appsync_alpha
for "experimental" APIs, and aws_cdk.aws_appsync
for stable APIs. aws_cdk.aws_appsync_alpha
构造分为 2 个包,用于“实验性”API 的aws_cdk.aws_appsync
和用于稳定 API 的 aws_cdk.aws_appsync。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.