Skip to content
v2.278.0

CfnApiProps Struct ​

Properties for defining a CfnApi.

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 cfnApiProps: appsync.CfnApiProps = {
  name: 'name',

  // the properties below are optional
  eventConfig: {
    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',
    },
  },
  ownerContact: 'ownerContact',
  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_api_props = appsync.CfnApiProps(
    name="name",

    # the properties below are optional
    event_config=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"
        )
    ),
    owner_contact="ownerContact",
    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.*;

CfnApiProps cfnApiProps = CfnApiProps.builder()
        .name("name")

        // the properties below are optional
        .eventConfig(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())
        .ownerContact("ownerContact")
        .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 cfnApiProps = new CfnApiProps {
    Name = "name",

    // the properties below are optional
    EventConfig = 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"
        }
    },
    OwnerContact = "ownerContact",
    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"

cfnApiProps := &CfnApiProps{
	Name: jsii.String("name"),

	// the properties below are optional
	EventConfig: &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"),
		},
	},
	OwnerContact: jsii.String("ownerContact"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

eventConfigoptionalIResolvable | CfnApi.EventConfigPropertyevent_configoptionaltyping.Union[IResolvable, EventConfigProperty]eventConfigoptionalIResolvableEventConfigoptionalIResolvableEventConfigoptionalinterface{} #
Describes the authorization configuration for connections, message publishing, message subscriptions, and logging for an Event API.
namestringnamestrnameStringNamestringName*string required #
The name of the `Api` .
ownerContactoptionalstringowner_contactoptionalstrownerContactoptionalStringOwnerContactoptionalstringOwnerContactoptional*string #
The owner contact information for an API resource.

This field accepts any string input with a length of 0 - 256 characters.

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