Class IamResource
A class used to generate resource arns for AppSync.
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class IamResource : DeputyBase
Syntax (vb)
Public Class IamResource Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
IGraphqlApi api;
var role = new Role(this, "Role", new RoleProps {
AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});
api.Grant(role, IamResource.Custom("types/Mutation/fields/updateExample"), "appsync:GraphQL");
Synopsis
Methods
| All() | Generate the resource names that accepts all types: |
| Custom(params string[]) | Generate the resource names given custom arns. |
| OfType(string, params string[]) | Generate the resource names given a type and fields. |
| ResourceArns(GraphqlApiBase) | Return the Resource ARN. |
Methods
All()
Generate the resource names that accepts all types: *.
public static IamResource All()
Returns
Remarks
ExampleMetadata: infused
Custom(params string[])
Generate the resource names given custom arns.
public static IamResource Custom(params string[] arns)
Parameters
- arns string[]
The custom arns that need to be permissioned.
Returns
Remarks
ExampleMetadata: infused
OfType(string, params string[])
Generate the resource names given a type and fields.
public static IamResource OfType(string type, params string[] fields)
Parameters
- type string
The type that needs to be allowed.
- fields string[]
The fields that need to be allowed, if empty grant permissions to ALL fields.
Returns
Remarks
ExampleMetadata: infused
ResourceArns(GraphqlApiBase)
Return the Resource ARN.
public virtual string[] ResourceArns(GraphqlApiBase api)
Parameters
- api GraphqlApiBase
The GraphQL API to give permissions.
Returns
string[]
Remarks
ExampleMetadata: infused