IamResource Class
A class used to generate resource arns for AppSync.
Example
ts
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
});
declare const api: appsync.IGraphqlApi;
api.grant(role, appsync.IamResource.custom('types/Mutation/fields/updateExample'), 'appsync:GraphQL');
Methods
all(): IamResource // chainable@staticmethod def all() -> IamResourcepublic static IamResource all()public static IamResource All()func All() IamResourcestatic#Generate the resource names that accepts all types: `*`.
custom(...arns: string[]): IamResource // chainable@staticmethod def custom(arns: str) -> IamResourcepublic static IamResource custom(String arns)public static IamResource Custom(string arns)func Custom(Arns *string) IamResourcestatic#Generate the resource names given custom arns.
1 parameter
Parameters
arnsarnsarnsarnsArns— The custom arns that need to be permissioned.
ofType(type: string, ...fields: string[]): IamResource // chainable@staticmethod def of_type(type: str, fields: str) -> IamResourcepublic static IamResource ofType(String type, String fields)public static IamResource OfType(string type, string fields)func OfType(Type *string, Fields *string) IamResourcestatic#Generate the resource names given a type and fields.
2 parameters
Parameters
typetypetypetypeType— The type that needs to be allowed.fieldsfieldsfieldsfieldsFields— The fields that need to be allowed, if empty grant permissions to ALL fields.
resourceArns(api: GraphqlApiBase): string[]def resource_arns(self, api: GraphqlApiBase) -> typing.List[str]public List<String> resourceArns(GraphqlApiBase api)public string[] ResourceArns(GraphqlApiBase api)func ResourceArns(Api GraphqlApiBase) *[]*string#Return the Resource ARN.
1 parameter
Parameters
apiapiapiapiApi— The GraphQL API to give permissions.