Skip to content
v2.276.0

HttpDataSourceProps Struct ​

Properties for an AppSync http datasource.

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_appsync as interfaces_appsync } from 'aws-cdk-lib/interfaces';

declare const graphQLApiRef: interfaces_appsync.IGraphQLApiRef;
declare const role: iam.Role;
const httpDataSourceProps: appsync.HttpDataSourceProps = {
  api: graphQLApiRef,
  endpoint: 'endpoint',

  // the properties below are optional
  authorizationConfig: {
    signingRegion: 'signingRegion',
    signingServiceName: 'signingServiceName',
  },
  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.interfaces import aws_appsync as interfaces_appsync

# graph_ql_api_ref: interfaces_appsync.IGraphQLApiRef
# role: iam.Role

http_data_source_props = appsync.HttpDataSourceProps(
    api=graph_ql_api_ref,
    endpoint="endpoint",

    # the properties below are optional
    authorization_config=appsync.AwsIamConfig(
        signing_region="signingRegion",
        signing_service_name="signingServiceName"
    ),
    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.interfaces.appsync.*;

IGraphQLApiRef graphQLApiRef;
Role role;

HttpDataSourceProps httpDataSourceProps = HttpDataSourceProps.builder()
        .api(graphQLApiRef)
        .endpoint("endpoint")

        // the properties below are optional
        .authorizationConfig(AwsIamConfig.builder()
                .signingRegion("signingRegion")
                .signingServiceName("signingServiceName")
                .build())
        .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.Interfaces.AppSync;

IGraphQLApiRef graphQLApiRef;
Role role;

var httpDataSourceProps = new HttpDataSourceProps {
    Api = graphQLApiRef,
    Endpoint = "endpoint",

    // the properties below are optional
    AuthorizationConfig = new AwsIamConfig {
        SigningRegion = "signingRegion",
        SigningServiceName = "signingServiceName"
    },
    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"

var graphQLApiRef IGraphQLApiRef
var role Role

httpDataSourceProps := &HttpDataSourceProps{
	Api: graphQLApiRef,
	Endpoint: jsii.String("endpoint"),

	// the properties below are optional
	AuthorizationConfig: &AwsIamConfig{
		SigningRegion: jsii.String("signingRegion"),
		SigningServiceName: jsii.String("signingServiceName"),
	},
	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.
authorizationConfigoptionalAwsIamConfigauthorization_configoptionalAwsIamConfigauthorizationConfigoptionalAwsIamConfigAuthorizationConfigoptionalAwsIamConfigAuthorizationConfigoptionalAwsIamConfig= none#
The authorization config in case the HTTP endpoint requires authorization.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= None#
the description of the data source.
endpointstringendpointstrendpointStringEndpointstringEndpoint*stringrequired#
The http endpoint.
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

nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the data source.

Default: id of data source

serviceRoleoptionalIRoleservice_roleoptionalIRoleserviceRoleoptionalIRoleServiceRoleoptionalIRoleServiceRoleoptionalIRole#
The IAM service role to be assumed by AppSync to interact with the data source.

Default: Create a new role