Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(appsync): add x-ray parameter to AppSync #9389

Merged
merged 10 commits into from
Aug 6, 2020

Conversation

tomoki10
Copy link
Contributor

@tomoki10 tomoki10 commented Aug 1, 2020

Close: #7640

  • Adding a boolean prop for xrayEnabled
  • Linking it to the xrayEnabled prop in class CfnGraphQLApi from appsync.generated.ts file that is generated on yarn build
  • Writing a unit test to check whether that the boolean property is set in the CloudFormation Template

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@mergify
Copy link
Contributor

mergify bot commented Aug 1, 2020

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@tomoki10 tomoki10 changed the title feat(appsync):xray-add feat(appsync):add xray parameter to AppSync Aug 1, 2020
@tomoki10 tomoki10 changed the title feat(appsync):add xray parameter to AppSync feat(appsync): add x-ray parameter to AppSync Aug 1, 2020
Copy link
Contributor

@BryanPan342 BryanPan342 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @tomoki10!!

Just a couple minor things before I'm ready to ship this out 😊

@@ -383,6 +389,7 @@ export class GraphQLApi extends Construct {
)
: undefined,
additionalAuthenticationProviders: this.formatAdditionalAuthenticationProviders(props),
xrayEnabled: props.xrayEnabled || false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property doesn't need to be configured here. If it is undefined in CloudFormations, Cfn will configure the AppSync without x-ray support by default.

Suggested change
xrayEnabled: props.xrayEnabled || false,
xrayEnabled: props.xrayEnabled,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BryanPan342
Thank you for your comment.
I will fix it along with the integration test.

```

See the [the AWS documentation](https://docs.aws.amazon.com/appsync/latest/devguide/x-ray-tracing.html) to learn more about AWS AppSync's X-Ray support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather us either put a description of what x-ray support is or not include it at all in the README.

Since it is a feature, I think in order to avoid the linter error, I would be okay with just adding the prop to the example section.

Like as follows:

const api = new appsync.GraphQLApi(stack, 'Api', {
  name: 'demo',
  schemaDefinition: appsync.SchemaDefinition.FILE,
  schemaDefinitionFile: join(__dirname, 'schema.graphql'),
  authorizationConfig: {
    defaultAuthorization: {
      authorizationType: appsync.AuthorizationType.IAM
    },
  },
  xrayEnabled: true,
});

@MrArnoldPalmer wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it as commented.

@mergify mergify bot dismissed BryanPan342’s stale review August 4, 2020 13:31

Pull request has been modified.

@tomoki10 tomoki10 requested a review from BryanPan342 August 4, 2020 14:05
@BryanPan342 BryanPan342 added the pr/do-not-merge This PR should not be merged at this time. label Aug 4, 2020
BryanPan342
BryanPan342 previously approved these changes Aug 4, 2020
Copy link
Contributor

@BryanPan342 BryanPan342 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Thanks for the contribution @tomoki10!!

@MrArnoldPalmer MrArnoldPalmer removed the pr/do-not-merge This PR should not be merged at this time. label Aug 4, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 4, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

MrArnoldPalmer
MrArnoldPalmer previously approved these changes Aug 4, 2020
@BryanPan342
Copy link
Contributor

@tomoki10 looks like the error is the following:

Property 'schemaDefinition' is missing in type '{ authorizationConfig: {}; name: string; schemaDefinitionFile: string; xrayEnabled: true; }' but required in type 'GraphQLApiProps'.

This is coming from the breaking change that we have in the works at the moment. If you just add a prop similar to the line above. We should be good to go.

const api = new appsync.GraphQLApi(stack, 'api', {
authorizationConfig: {},
name: 'api',
schemaDefinition: appsync.SchemaDefinition.FILE,
schemaDefinitionFile: path.join(__dirname, 'appsync.test.graphql'),
});

@mergify mergify bot dismissed BryanPan342’s stale review August 6, 2020 17:30

Pull request has been modified.

@mergify mergify bot dismissed MrArnoldPalmer’s stale review August 6, 2020 17:30

Pull request has been modified.

@BryanPan342 BryanPan342 self-requested a review August 6, 2020 17:30
BryanPan342
BryanPan342 previously approved these changes Aug 6, 2020
@mergify mergify bot dismissed BryanPan342’s stale review August 6, 2020 17:44

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Aug 6, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 93aaa8d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Aug 6, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 51921ad into aws:master Aug 6, 2020
eladb pushed a commit that referenced this pull request Aug 10, 2020
Close: #7640

- [x] Adding a boolean prop for xrayEnabled
- [x]  Linking it to the xrayEnabled prop in class CfnGraphQLApi from appsync.generated.ts file that is generated on yarn build
- [x]  Writing a unit test to check whether that the boolean property is set in the CloudFormation Template
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-appsync Related to AWS AppSync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

X-Ray support for AppSync CDK construct
4 participants