Skip to content

[api-gateway] Errors in Example.  #10680

@mrpackethead

Description

@mrpackethead

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

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-apigatewayRelated to Amazon API GatewaydocumentationThis is a problem with documentation.language/pythonRelated to Python bindingsneeds-triageThis issue or PR still needs to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions