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

[api-gateway] Errors in Example. #10680

Closed
mrpackethead opened this issue Oct 4, 2020 · 2 comments · Fixed by #10822
Closed

[api-gateway] Errors in Example. #10680

mrpackethead opened this issue Oct 4, 2020 · 2 comments · Fixed by #10822
Assignees
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway documentation This is a problem with documentation. language/python Related to Python bindings needs-triage This issue or PR still needs to be triaged.

Comments

@mrpackethead
Copy link

mrpackethead commented Oct 4, 2020

Example code has errors.

https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_apigateway.README.html#iam-based-authorizer

The example code has a couple of errors, with the iam.PolicyStatement. They look like issues with the automatic translation.

iam_user.attach_inline_policy(iam.Policy(self, "AllowBooks",
    statements=[
        iam.PolicyStatement(
            actions=["execute-api:Invoke"],
            effect=iam.Effect.Allow,                                          #  (1) should be  effect = iam.Effect.ALLOW
            resources=[get_books.method_arn()]                     # (2) should be resources = [ get_books.method_arn ]

(1) iam.Effect.Allow is not defined.. ALLOW needs to be capitalized
(2)  get_books.method_arn  is the attribute  its not a function to be called. 

This is a 📕 documentation issue

@mrpackethead mrpackethead added documentation This is a problem with documentation. feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2020
@SomayaB SomayaB changed the title [aws-cdk.aws-api-gateway] Errors in Example. [api-gateway] Errors in Example. Oct 6, 2020
@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Oct 6, 2020
@SomayaB SomayaB added language/python Related to Python bindings bug This issue is a bug. and removed feature-request A feature should be added or improved. labels Oct 6, 2020
@nija-at
Copy link
Contributor

nija-at commented Oct 12, 2020

#1 seems like an conversion error and I've opened an issue here - aws/jsii#2113

#2 is not a conversion error. It's an error in source - https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-apigateway/README.md#iam-based-authorizer

nija-at pushed a commit that referenced this issue Oct 12, 2020
@nija-at nija-at removed the bug This issue is a bug. label Oct 12, 2020
@mergify mergify bot closed this as completed in #10822 Oct 13, 2020
mergify bot pushed a commit that referenced this issue Oct 13, 2020
closes #10680


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway documentation This is a problem with documentation. language/python Related to Python bindings needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants