IamResource

class aws_cdk.aws_appsync.IamResource(*args: Any, **kwargs)

Bases: object

(experimental) A class used to generate resource arns for AppSync.

Stability:

experimental

ExampleMetadata:

infused

Example:

# api: appsync.GraphqlApi
role = iam.Role(self, "Role",
    assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)

api.grant(role, appsync.IamResource.custom("types/Mutation/fields/updateExample"), "appsync:GraphQL")

Methods

resource_arns(api)

(experimental) Return the Resource ARN.

Parameters:

api (GraphqlApi) – The GraphQL API to give permissions.

Stability:

experimental

Return type:

List[str]

Static Methods

classmethod all()

(experimental) Generate the resource names that accepts all types: *.

Stability:

experimental

Return type:

IamResource

classmethod custom(*arns)

(experimental) Generate the resource names given custom arns.

Parameters:

arns (str) – The custom arns that need to be permissioned. Example: custom(‘/types/Query/fields/getExample’)

Stability:

experimental

Return type:

IamResource

classmethod of_type(type, *fields)

(experimental) Generate the resource names given a type and fields.

Parameters:
  • type (str) – The type that needs to be allowed.

  • fields (str) – The fields that need to be allowed, if empty grant permissions to ALL fields. Example: ofType(‘Query’, ‘GetExample’)

Stability:

experimental

Return type:

IamResource