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

[aws-appsync] Adding AuthorizationConfig within construction HttpDataSource of the appsync module. #9934

Closed
1 of 2 tasks
haruharuharuby opened this issue Aug 24, 2020 · 7 comments · Fixed by #10171
Closed
1 of 2 tasks
Assignees
Labels
@aws-cdk/aws-appsync Related to AWS AppSync effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p2

Comments

@haruharuharuby
Copy link
Contributor

Adding AuthorizationConfig within construction HttpDataSource of the appsync module.

Use Case

Integrating AWS StepFunctions to the appsync as HTTP Datasource.
Current(24, August 2021) AWS CDK can not configure the authorizationConfig during creating data source.
Currently, That can do only from the AWS-CLI. (create-data-source command)
https://docs.aws.amazon.com/cli/latest/reference/appsync/create-data-source.html

Related AWS Blogs.
https://aws.amazon.com/blogs/mobile/invoke-aws-services-directly-from-aws-appsync/

Proposed Solution

I'd like to call the addHttpDataSource method with authorizationConfig object.

    api.addHttpDataSource('ds', endpoint, {
      name: 'custom',
      description: 'custom description',
      authorizationConfig: {
        authorizationType: 'AWS_IAM',
        awsIamConfig: {
          signingRegion: 'us-east-1',
          signingServiceName: 'states'
        }
      }
    });

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@haruharuharuby haruharuharuby added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 24, 2020
@haruharuharuby haruharuharuby changed the title [module] [@aws-cdk/aws-appsync] Adding AuthorizationConfig within construction HttpDataSource of the appsync module. Aug 24, 2020
@github-actions github-actions bot added the @aws-cdk/aws-appsync Related to AWS AppSync label Aug 24, 2020
@haruharuharuby haruharuharuby changed the title [@aws-cdk/aws-appsync] Adding AuthorizationConfig within construction HttpDataSource of the appsync module. [aws-appsync] Adding AuthorizationConfig within construction HttpDataSource of the appsync module. Aug 24, 2020
@BryanPan342 BryanPan342 added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Aug 24, 2020
@BryanPan342
Copy link
Contributor

@haruharuharuby Feel free to take a stab at this! Please tag it with in-progress once you start working on it and dont be afraid to reach out here if you need help 🙂

@haruharuharuby
Copy link
Contributor Author

@BryanPan342 I started implementation for this issue. How can I tag the in-progress?

@BryanPan342 BryanPan342 added the in-progress This issue is being actively worked on. label Aug 25, 2020
@BryanPan342
Copy link
Contributor

@haruharuharuby wooo no worries i added the label!

@haruharuharuby
Copy link
Contributor Author

@BryanPan342 I added PR for this issue. I need to fix some CI checks.
I will fix it later.

#9971

@haruharuharuby
Copy link
Contributor Author

@BryanPan342 is it necessary to add unit test httpConfig that is in CfnTemplate.
It looks like no CfnTest in the UnitTest. I only found the HttpConfig test in integration test.

@BryanPan342
Copy link
Contributor

@haruharuharuby for the unit tests, go to

import '@aws-cdk/assert/jest';
import * as path from 'path';
import * as cdk from '@aws-cdk/core';
import * as appsync from '../lib';
// GLOBAL GIVEN
let stack: cdk.Stack;
let api: appsync.GraphQLApi;
let endpoint: string;
beforeEach(() => {
stack = new cdk.Stack();
api = new appsync.GraphQLApi(stack, 'baseApi', {
name: 'api',
schemaDefinition: appsync.SchemaDefinition.FILE,
schemaDefinitionFile: path.join(__dirname, 'appsync.test.graphql'),
});
endpoint = 'aws.amazon.com';
});
describe('Http Data Source configuration', () => {
for some examples!

@BryanPan342
Copy link
Contributor

nvm it looks like you did it already

@mergify mergify bot closed this as completed in #10171 Sep 8, 2020
mergify bot pushed a commit that referenced this issue Sep 8, 2020
This PR supersedes #9971 

### Description
Adding authorization config to HttpDatasource in aws-appsync module.
Users will be able to specify the awsIamConfig in httpConfig as parameter of HttpDataSource.

Fixes: #9934 

----
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 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p2
Projects
None yet
3 participants