Skip to content
v2.278.0

EventConfigProperty Struct ​

Describes the authorization configuration for connections, message publishing, message subscriptions, and logging for an Event API.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const eventConfigProperty: appsync.CfnApi.EventConfigProperty = {
  authProviders: [{
    authType: 'authType',

    // the properties below are optional
    cognitoConfig: {
      awsRegion: 'awsRegion',
      userPoolId: 'userPoolId',

      // the properties below are optional
      appIdClientRegex: 'appIdClientRegex',
    },
    lambdaAuthorizerConfig: {
      authorizerUri: 'authorizerUri',

      // the properties below are optional
      authorizerResultTtlInSeconds: 123,
      identityValidationExpression: 'identityValidationExpression',
    },
    openIdConnectConfig: {
      issuer: 'issuer',

      // the properties below are optional
      authTtl: 123,
      clientId: 'clientId',
      iatTtl: 123,
    },
  }],
  connectionAuthModes: [{
    authType: 'authType',
  }],
  defaultPublishAuthModes: [{
    authType: 'authType',
  }],
  defaultSubscribeAuthModes: [{
    authType: 'authType',
  }],

  // the properties below are optional
  logConfig: {
    cloudWatchLogsRoleArn: 'cloudWatchLogsRoleArn',
    logLevel: 'logLevel',
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

event_config_property = appsync.CfnApi.EventConfigProperty(
    auth_providers=[appsync.CfnApi.AuthProviderProperty(
        auth_type="authType",

        # the properties below are optional
        cognito_config=appsync.CfnApi.CognitoConfigProperty(
            aws_region="awsRegion",
            user_pool_id="userPoolId",

            # the properties below are optional
            app_id_client_regex="appIdClientRegex"
        ),
        lambda_authorizer_config=appsync.CfnApi.LambdaAuthorizerConfigProperty(
            authorizer_uri="authorizerUri",

            # the properties below are optional
            authorizer_result_ttl_in_seconds=123,
            identity_validation_expression="identityValidationExpression"
        ),
        open_id_connect_config=appsync.CfnApi.OpenIDConnectConfigProperty(
            issuer="issuer",

            # the properties below are optional
            auth_ttl=123,
            client_id="clientId",
            iat_ttl=123
        )
    )],
    connection_auth_modes=[appsync.CfnApi.AuthModeProperty(
        auth_type="authType"
    )],
    default_publish_auth_modes=[appsync.CfnApi.AuthModeProperty(
        auth_type="authType"
    )],
    default_subscribe_auth_modes=[appsync.CfnApi.AuthModeProperty(
        auth_type="authType"
    )],

    # the properties below are optional
    log_config=appsync.CfnApi.EventLogConfigProperty(
        cloud_watch_logs_role_arn="cloudWatchLogsRoleArn",
        log_level="logLevel"
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appsync.*;

EventConfigProperty eventConfigProperty = EventConfigProperty.builder()
        .authProviders(List.of(AuthProviderProperty.builder()
                .authType("authType")

                // the properties below are optional
                .cognitoConfig(CognitoConfigProperty.builder()
                        .awsRegion("awsRegion")
                        .userPoolId("userPoolId")

                        // the properties below are optional
                        .appIdClientRegex("appIdClientRegex")
                        .build())
                .lambdaAuthorizerConfig(LambdaAuthorizerConfigProperty.builder()
                        .authorizerUri("authorizerUri")

                        // the properties below are optional
                        .authorizerResultTtlInSeconds(123)
                        .identityValidationExpression("identityValidationExpression")
                        .build())
                .openIdConnectConfig(OpenIDConnectConfigProperty.builder()
                        .issuer("issuer")

                        // the properties below are optional
                        .authTtl(123)
                        .clientId("clientId")
                        .iatTtl(123)
                        .build())
                .build()))
        .connectionAuthModes(List.of(AuthModeProperty.builder()
                .authType("authType")
                .build()))
        .defaultPublishAuthModes(List.of(AuthModeProperty.builder()
                .authType("authType")
                .build()))
        .defaultSubscribeAuthModes(List.of(AuthModeProperty.builder()
                .authType("authType")
                .build()))

        // the properties below are optional
        .logConfig(EventLogConfigProperty.builder()
                .cloudWatchLogsRoleArn("cloudWatchLogsRoleArn")
                .logLevel("logLevel")
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppSync;

var eventConfigProperty = new EventConfigProperty {
    AuthProviders = new [] { new AuthProviderProperty {
        AuthType = "authType",

        // the properties below are optional
        CognitoConfig = new CognitoConfigProperty {
            AwsRegion = "awsRegion",
            UserPoolId = "userPoolId",

            // the properties below are optional
            AppIdClientRegex = "appIdClientRegex"
        },
        LambdaAuthorizerConfig = new LambdaAuthorizerConfigProperty {
            AuthorizerUri = "authorizerUri",

            // the properties below are optional
            AuthorizerResultTtlInSeconds = 123,
            IdentityValidationExpression = "identityValidationExpression"
        },
        OpenIdConnectConfig = new OpenIDConnectConfigProperty {
            Issuer = "issuer",

            // the properties below are optional
            AuthTtl = 123,
            ClientId = "clientId",
            IatTtl = 123
        }
    } },
    ConnectionAuthModes = new [] { new AuthModeProperty {
        AuthType = "authType"
    } },
    DefaultPublishAuthModes = new [] { new AuthModeProperty {
        AuthType = "authType"
    } },
    DefaultSubscribeAuthModes = new [] { new AuthModeProperty {
        AuthType = "authType"
    } },

    // the properties below are optional
    LogConfig = new EventLogConfigProperty {
        CloudWatchLogsRoleArn = "cloudWatchLogsRoleArn",
        LogLevel = "logLevel"
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

eventConfigProperty := &EventConfigProperty{
	AuthProviders: []interface{}{
		&AuthProviderProperty{
			AuthType: jsii.String("authType"),

			// the properties below are optional
			CognitoConfig: &CognitoConfigProperty{
				AwsRegion: jsii.String("awsRegion"),
				UserPoolId: jsii.String("userPoolId"),

				// the properties below are optional
				AppIdClientRegex: jsii.String("appIdClientRegex"),
			},
			LambdaAuthorizerConfig: &LambdaAuthorizerConfigProperty{
				AuthorizerUri: jsii.String("authorizerUri"),

				// the properties below are optional
				AuthorizerResultTtlInSeconds: jsii.Number(123),
				IdentityValidationExpression: jsii.String("identityValidationExpression"),
			},
			OpenIdConnectConfig: &OpenIDConnectConfigProperty{
				Issuer: jsii.String("issuer"),

				// the properties below are optional
				AuthTtl: jsii.Number(123),
				ClientId: jsii.String("clientId"),
				IatTtl: jsii.Number(123),
			},
		},
	},
	ConnectionAuthModes: []interface{}{
		&AuthModeProperty{
			AuthType: jsii.String("authType"),
		},
	},
	DefaultPublishAuthModes: []interface{}{
		&AuthModeProperty{
			AuthType: jsii.String("authType"),
		},
	},
	DefaultSubscribeAuthModes: []interface{}{
		&AuthModeProperty{
			AuthType: jsii.String("authType"),
		},
	},

	// the properties below are optional
	LogConfig: &EventLogConfigProperty{
		CloudWatchLogsRoleArn: jsii.String("cloudWatchLogsRoleArn"),
		LogLevel: jsii.String("logLevel"),
	},
}

Properties ​

authProvidersIResolvable | IResolvable | CfnApi.AuthProviderProperty[]auth_providerstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AuthProviderProperty]]]authProvidersIResolvableAuthProvidersIResolvableAuthProvidersinterface{} required #
A list of authorization providers.
connectionAuthModesIResolvable | IResolvable | CfnApi.AuthModeProperty[]connection_auth_modestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AuthModeProperty]]]connectionAuthModesIResolvableConnectionAuthModesIResolvableConnectionAuthModesinterface{} required #
A list of valid authorization modes for the Event API connections.
defaultPublishAuthModesIResolvable | IResolvable | CfnApi.AuthModeProperty[]default_publish_auth_modestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AuthModeProperty]]]defaultPublishAuthModesIResolvableDefaultPublishAuthModesIResolvableDefaultPublishAuthModesinterface{} required #
A list of valid authorization modes for the Event API publishing.
defaultSubscribeAuthModesIResolvable | IResolvable | CfnApi.AuthModeProperty[]default_subscribe_auth_modestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AuthModeProperty]]]defaultSubscribeAuthModesIResolvableDefaultSubscribeAuthModesIResolvableDefaultSubscribeAuthModesinterface{} required #
A list of valid authorization modes for the Event API subscriptions.
logConfigoptionalIResolvable | CfnApi.EventLogConfigPropertylog_configoptionaltyping.Union[IResolvable, EventLogConfigProperty]logConfigoptionalIResolvableLogConfigoptionalIResolvableLogConfigoptionalinterface{} #
The CloudWatch Logs configuration for the Event API.