Class EventApiProps
Properties for an AppSync Event API.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EventApiProps : IEventApiProps
Syntax (vb)
Public Class EventApiProps Implements IEventApiProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda;
Function handler;
var iamProvider = new AppSyncAuthProvider {
AuthorizationType = AppSyncAuthorizationType.IAM
};
var apiKeyProvider = new AppSyncAuthProvider {
AuthorizationType = AppSyncAuthorizationType.API_KEY
};
/* API with IAM and API Key providers.
* Connection, default publish and default subscribe
* can be done with either IAM and API Key.
*/
var api = new EventApi(this, "api", new EventApiProps {
ApiName = "api",
AuthorizationConfig = new EventApiAuthConfig {
// set auth providers
AuthProviders = new [] { iamProvider, apiKeyProvider }
}
});
api.AddChannelNamespace("default");
Synopsis
Constructors
| EventApiProps() | Properties for an AppSync Event API. |
Properties
| ApiName | the name of the Event API. |
| AuthorizationConfig | Optional authorization configuration. |
| DomainName | The domain name configuration for the Event API. |
| LogConfig | Logging configuration for this api. |
| OwnerContact | The owner contact information for an API resource. |
Constructors
EventApiProps()
Properties for an AppSync Event API.
public EventApiProps()
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda;
Function handler;
var iamProvider = new AppSyncAuthProvider {
AuthorizationType = AppSyncAuthorizationType.IAM
};
var apiKeyProvider = new AppSyncAuthProvider {
AuthorizationType = AppSyncAuthorizationType.API_KEY
};
/* API with IAM and API Key providers.
* Connection, default publish and default subscribe
* can be done with either IAM and API Key.
*/
var api = new EventApi(this, "api", new EventApiProps {
ApiName = "api",
AuthorizationConfig = new EventApiAuthConfig {
// set auth providers
AuthProviders = new [] { iamProvider, apiKeyProvider }
}
});
api.AddChannelNamespace("default");
Properties
ApiName
the name of the Event API.
public string ApiName { get; set; }
Property Value
Remarks
ExampleMetadata: infused
AuthorizationConfig
Optional authorization configuration.
public IEventApiAuthConfig? AuthorizationConfig { get; set; }
Property Value
Remarks
Default: - API Key authorization
DomainName
The domain name configuration for the Event API.
public IAppSyncDomainOptions? DomainName { get; set; }
Property Value
Remarks
The Route 53 hosted zone and CName DNS record must be configured in addition to this setting to enable custom domain URL
Default: - no domain name
LogConfig
Logging configuration for this api.
public IAppSyncLogConfig? LogConfig { get; set; }
Property Value
Remarks
Default: - None
OwnerContact
The owner contact information for an API resource.
public string? OwnerContact { get; set; }
Property Value
Remarks
This field accepts any string input with a length of 0 - 256 characters.
Default: - No owner contact.