RdsDataSourcePropsV2 Struct
Properties for an AppSync RDS datasource Aurora Serverless V2.
| Source | aws-appsync/lib/data-source.ts |
|---|---|
| Type last changed |
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';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
import { aws_appsync as interfaces_appsync } from 'aws-cdk-lib/interfaces';
declare const databaseCluster: rds.DatabaseCluster;
declare const graphQLApiRef: interfaces_appsync.IGraphQLApiRef;
declare const role: iam.Role;
declare const secret: secretsmanager.Secret;
const rdsDataSourcePropsV2: appsync.RdsDataSourcePropsV2 = {
api: graphQLApiRef,
secretStore: secret,
serverlessCluster: databaseCluster,
// the properties below are optional
databaseName: 'databaseName',
description: 'description',
metricsConfig: appsync.DataSourceMetricsConfig.ENABLED,
name: 'name',
serviceRole: role,
};
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
from aws_cdk import aws_iam as iam
from aws_cdk import aws_rds as rds
from aws_cdk import aws_secretsmanager as secretsmanager
from aws_cdk.interfaces import aws_appsync as interfaces_appsync
# database_cluster: rds.DatabaseCluster
# graph_ql_api_ref: interfaces_appsync.IGraphQLApiRef
# role: iam.Role
# secret: secretsmanager.Secret
rds_data_source_props_v2 = appsync.RdsDataSourcePropsV2(
api=graph_ql_api_ref,
secret_store=secret,
serverless_cluster=database_cluster,
# the properties below are optional
database_name="databaseName",
description="description",
metrics_config=appsync.DataSourceMetricsConfig.ENABLED,
name="name",
service_role=role
)
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.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.rds.*;
import software.amazon.awscdk.services.secretsmanager.*;
import software.amazon.awscdk.interfaces.appsync.*;
DatabaseCluster databaseCluster;
IGraphQLApiRef graphQLApiRef;
Role role;
Secret secret;
RdsDataSourcePropsV2 rdsDataSourcePropsV2 = RdsDataSourcePropsV2.builder()
.api(graphQLApiRef)
.secretStore(secret)
.serverlessCluster(databaseCluster)
// the properties below are optional
.databaseName("databaseName")
.description("description")
.metricsConfig(DataSourceMetricsConfig.ENABLED)
.name("name")
.serviceRole(role)
.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;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.RDS;
using Amazon.CDK.AWS.SecretsManager;
using Amazon.CDK.Interfaces.AppSync;
DatabaseCluster databaseCluster;
IGraphQLApiRef graphQLApiRef;
Role role;
Secret secret;
var rdsDataSourcePropsV2 = new RdsDataSourcePropsV2 {
Api = graphQLApiRef,
SecretStore = secret,
ServerlessCluster = databaseCluster,
// the properties below are optional
DatabaseName = "databaseName",
Description = "description",
MetricsConfig = DataSourceMetricsConfig.ENABLED,
Name = "name",
ServiceRole = role
};
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"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var databaseCluster DatabaseCluster
var graphQLApiRef IGraphQLApiRef
var role Role
var secret Secret
rdsDataSourcePropsV2 := &RdsDataSourcePropsV2{
Api: graphQLApiRef,
SecretStore: secret,
ServerlessCluster: databaseCluster,
// the properties below are optional
DatabaseName: jsii.String("databaseName"),
Description: jsii.String("description"),
MetricsConfig: awscdk.Aws_appsync.DataSourceMetricsConfig_ENABLED,
Name: jsii.String("name"),
ServiceRole: role,
}
Properties
The API to attach this data source to.
databaseNameoptionalstringdatabase_nameoptionalstrdatabaseNameoptionalStringDatabaseNameoptionalstringDatabaseNameoptional*string = None #The name of the database to use within the cluster.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string = None #the description of the data source.
metricsConfigoptionalDataSourceMetricsConfigmetrics_configoptionalDataSourceMetricsConfigmetricsConfigoptionalDataSourceMetricsConfigMetricsConfigoptionalDataSourceMetricsConfigMetricsConfigoptionalDataSourceMetricsConfig #Whether to enable enhanced metrics of the data source Value will be ignored, if `enhancedMetricsConfig.dataSourceLevelMetricsBehavior` on AppSync GraphqlApi construct is set to `FULL_REQUEST_DATA_SOURCE_METRICS`.
Default: no metrics configuration
The name of the data source.
Default: id of data source
secretStoreISecretsecret_storeISecretsecretStoreISecretSecretStoreISecretSecretStoreISecret required #The secret containing the credentials for the database.
serverlessClusterIDatabaseClusterserverless_clusterIDatabaseClusterserverlessClusterIDatabaseClusterServerlessClusterIDatabaseClusterServerlessClusterIDatabaseCluster required #The serverless cluster to call to interact with this data source.