Skip to content
v2.277.0

CfnChannelNamespaceProps Struct ​

Properties for defining a CfnChannelNamespace.

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 cfnChannelNamespaceProps: appsync.CfnChannelNamespaceProps = {
  apiId: 'apiId',
  name: 'name',

  // the properties below are optional
  codeHandlers: 'codeHandlers',
  codeS3Location: 'codeS3Location',
  handlerConfigs: {
    onPublish: {
      behavior: 'behavior',
      integration: {
        dataSourceName: 'dataSourceName',

        // the properties below are optional
        lambdaConfig: {
          invokeType: 'invokeType',
        },
      },
    },
    onSubscribe: {
      behavior: 'behavior',
      integration: {
        dataSourceName: 'dataSourceName',

        // the properties below are optional
        lambdaConfig: {
          invokeType: 'invokeType',
        },
      },
    },
  },
  publishAuthModes: [{
    authType: 'authType',
  }],
  subscribeAuthModes: [{
    authType: 'authType',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# 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

cfn_channel_namespace_props = appsync.CfnChannelNamespaceProps(
    api_id="apiId",
    name="name",

    # the properties below are optional
    code_handlers="codeHandlers",
    code_s3_location="codeS3Location",
    handler_configs=appsync.CfnChannelNamespace.HandlerConfigsProperty(
        on_publish=appsync.CfnChannelNamespace.HandlerConfigProperty(
            behavior="behavior",
            integration=appsync.CfnChannelNamespace.IntegrationProperty(
                data_source_name="dataSourceName",

                # the properties below are optional
                lambda_config=appsync.CfnChannelNamespace.LambdaConfigProperty(
                    invoke_type="invokeType"
                )
            )
        ),
        on_subscribe=appsync.CfnChannelNamespace.HandlerConfigProperty(
            behavior="behavior",
            integration=appsync.CfnChannelNamespace.IntegrationProperty(
                data_source_name="dataSourceName",

                # the properties below are optional
                lambda_config=appsync.CfnChannelNamespace.LambdaConfigProperty(
                    invoke_type="invokeType"
                )
            )
        )
    ),
    publish_auth_modes=[appsync.CfnChannelNamespace.AuthModeProperty(
        auth_type="authType"
    )],
    subscribe_auth_modes=[appsync.CfnChannelNamespace.AuthModeProperty(
        auth_type="authType"
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
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.*;

CfnChannelNamespaceProps cfnChannelNamespaceProps = CfnChannelNamespaceProps.builder()
        .apiId("apiId")
        .name("name")

        // the properties below are optional
        .codeHandlers("codeHandlers")
        .codeS3Location("codeS3Location")
        .handlerConfigs(HandlerConfigsProperty.builder()
                .onPublish(HandlerConfigProperty.builder()
                        .behavior("behavior")
                        .integration(IntegrationProperty.builder()
                                .dataSourceName("dataSourceName")

                                // the properties below are optional
                                .lambdaConfig(LambdaConfigProperty.builder()
                                        .invokeType("invokeType")
                                        .build())
                                .build())
                        .build())
                .onSubscribe(HandlerConfigProperty.builder()
                        .behavior("behavior")
                        .integration(IntegrationProperty.builder()
                                .dataSourceName("dataSourceName")

                                // the properties below are optional
                                .lambdaConfig(LambdaConfigProperty.builder()
                                        .invokeType("invokeType")
                                        .build())
                                .build())
                        .build())
                .build())
        .publishAuthModes(List.of(AuthModeProperty.builder()
                .authType("authType")
                .build()))
        .subscribeAuthModes(List.of(AuthModeProperty.builder()
                .authType("authType")
                .build()))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .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 cfnChannelNamespaceProps = new CfnChannelNamespaceProps {
    ApiId = "apiId",
    Name = "name",

    // the properties below are optional
    CodeHandlers = "codeHandlers",
    CodeS3Location = "codeS3Location",
    HandlerConfigs = new HandlerConfigsProperty {
        OnPublish = new HandlerConfigProperty {
            Behavior = "behavior",
            Integration = new IntegrationProperty {
                DataSourceName = "dataSourceName",

                // the properties below are optional
                LambdaConfig = new LambdaConfigProperty {
                    InvokeType = "invokeType"
                }
            }
        },
        OnSubscribe = new HandlerConfigProperty {
            Behavior = "behavior",
            Integration = new IntegrationProperty {
                DataSourceName = "dataSourceName",

                // the properties below are optional
                LambdaConfig = new LambdaConfigProperty {
                    InvokeType = "invokeType"
                }
            }
        }
    },
    PublishAuthModes = new [] { new AuthModeProperty {
        AuthType = "authType"
    } },
    SubscribeAuthModes = new [] { new AuthModeProperty {
        AuthType = "authType"
    } },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
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"

cfnChannelNamespaceProps := &CfnChannelNamespaceProps{
	ApiId: jsii.String("apiId"),
	Name: jsii.String("name"),

	// the properties below are optional
	CodeHandlers: jsii.String("codeHandlers"),
	CodeS3Location: jsii.String("codeS3Location"),
	HandlerConfigs: &HandlerConfigsProperty{
		OnPublish: &HandlerConfigProperty{
			Behavior: jsii.String("behavior"),
			Integration: &IntegrationProperty{
				DataSourceName: jsii.String("dataSourceName"),

				// the properties below are optional
				LambdaConfig: &LambdaConfigProperty{
					InvokeType: jsii.String("invokeType"),
				},
			},
		},
		OnSubscribe: &HandlerConfigProperty{
			Behavior: jsii.String("behavior"),
			Integration: &IntegrationProperty{
				DataSourceName: jsii.String("dataSourceName"),

				// the properties below are optional
				LambdaConfig: &LambdaConfigProperty{
					InvokeType: jsii.String("invokeType"),
				},
			},
		},
	},
	PublishAuthModes: []interface{}{
		&AuthModeProperty{
			AuthType: jsii.String("authType"),
		},
	},
	SubscribeAuthModes: []interface{}{
		&AuthModeProperty{
			AuthType: jsii.String("authType"),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

apiIdstringapi_idstrapiIdStringApiIdstringApiId*string required #
The `Api` ID.
codeHandlersoptionalstringcode_handlersoptionalstrcodeHandlersoptionalStringCodeHandlersoptionalstringCodeHandlersoptional*string #
The event handler functions that run custom business logic to process published events and subscribe requests.
codeS3Locationoptionalstringcode_s3_locationoptionalstrcodeS3LocationoptionalStringCodeS3LocationoptionalstringCodeS3Locationoptional*string #
The Amazon S3 endpoint where the code is located.
handlerConfigsoptionalIResolvable | CfnChannelNamespace.HandlerConfigsPropertyhandler_configsoptionaltyping.Union[IResolvable, HandlerConfigsProperty]handlerConfigsoptionalIResolvableHandlerConfigsoptionalIResolvableHandlerConfigsoptionalinterface{} #
The configuration for the `OnPublish` and `OnSubscribe` handlers.
namestringnamestrnameStringNamestringName*string required #
The name of the channel namespace.

This name must be unique within the Api .

publishAuthModesoptionalIResolvable | IResolvable | CfnChannelNamespace.AuthModeProperty[]publish_auth_modesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AuthModeProperty]]]publishAuthModesoptionalIResolvablePublishAuthModesoptionalIResolvablePublishAuthModesoptionalinterface{} #
The authorization mode to use for publishing messages on the channel namespace.

This configuration overrides the default Api authorization configuration.

subscribeAuthModesoptionalIResolvable | IResolvable | CfnChannelNamespace.AuthModeProperty[]subscribe_auth_modesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AuthModeProperty]]]subscribeAuthModesoptionalIResolvableSubscribeAuthModesoptionalIResolvableSubscribeAuthModesoptionalinterface{} #
The authorization mode to use for subscribing to messages on the channel namespace.

This configuration overrides the default Api authorization configuration.

tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
A set of tags (key-value pairs) for this channel namespace.