Show / Hide Table of Contents

Class DataSource

Provides an AppSync DataSource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var exampleTable = new Aws.DynamoDB.Table("exampleTable", new Aws.DynamoDB.TableArgs
    {
        Attributes = 
        {
            new Aws.DynamoDB.Inputs.TableAttributeArgs
            {
                Name = "UserId",
                Type = "S",
            },
        },
        HashKey = "UserId",
        ReadCapacity = 1,
        WriteCapacity = 1,
    });
    var exampleRole = new Aws.Iam.Role("exampleRole", new Aws.Iam.RoleArgs
    {
        AssumeRolePolicy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
  ""Action"": ""sts:AssumeRole"",
  ""Principal"": {
    ""Service"": ""appsync.amazonaws.com""
  },
  ""Effect"": ""Allow""
}
]
}

",
    });
    var exampleRolePolicy = new Aws.Iam.RolePolicy("exampleRolePolicy", new Aws.Iam.RolePolicyArgs
    {
        Policy = exampleTable.Arn.Apply(arn => @$"{{
""Version"": ""2012-10-17"",
""Statement"": [
{{
  ""Action"": [
    ""dynamodb:*""
  ],
  ""Effect"": ""Allow"",
  ""Resource"": [
    ""{arn}""
  ]
}}
]
}}

"),
        Role = exampleRole.Id,
    });
    var exampleGraphQLApi = new Aws.AppSync.GraphQLApi("exampleGraphQLApi", new Aws.AppSync.GraphQLApiArgs
    {
        AuthenticationType = "API_KEY",
    });
    var exampleDataSource = new Aws.AppSync.DataSource("exampleDataSource", new Aws.AppSync.DataSourceArgs
    {
        ApiId = exampleGraphQLApi.Id,
        DynamodbConfig = new Aws.AppSync.Inputs.DataSourceDynamodbConfigArgs
        {
            TableName = exampleTable.Name,
        },
        ServiceRoleArn = exampleRole.Arn,
        Type = "AMAZON_DYNAMODB",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
DataSource
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.AppSync
Assembly: Pulumi.Aws.dll
Syntax
public class DataSource : CustomResource

Constructors

View Source

DataSource(String, DataSourceArgs, CustomResourceOptions)

Create a DataSource resource with the given unique name, arguments, and options.

Declaration
public DataSource(string name, DataSourceArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

DataSourceArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ApiId

The API ID for the GraphQL API for the DataSource.

Declaration
public Output<string> ApiId { get; }
Property Value
Type Description
Output<System.String>
View Source

Arn

The ARN

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

A description of the DataSource.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

DynamodbConfig

DynamoDB settings. See below

Declaration
public Output<DataSourceDynamodbConfig> DynamodbConfig { get; }
Property Value
Type Description
Output<DataSourceDynamodbConfig>
View Source

ElasticsearchConfig

Amazon Elasticsearch settings. See below

Declaration
public Output<DataSourceElasticsearchConfig> ElasticsearchConfig { get; }
Property Value
Type Description
Output<DataSourceElasticsearchConfig>
View Source

HttpConfig

HTTP settings. See below

Declaration
public Output<DataSourceHttpConfig> HttpConfig { get; }
Property Value
Type Description
Output<DataSourceHttpConfig>
View Source

LambdaConfig

AWS Lambda settings. See below

Declaration
public Output<DataSourceLambdaConfig> LambdaConfig { get; }
Property Value
Type Description
Output<DataSourceLambdaConfig>
View Source

Name

A user-supplied name for the DataSource.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

ServiceRoleArn

The IAM service role ARN for the data source.

Declaration
public Output<string> ServiceRoleArn { get; }
Property Value
Type Description
Output<System.String>
View Source

Type

The type of the DataSource. Valid values: AWS_LAMBDA, AMAZON_DYNAMODB, AMAZON_ELASTICSEARCH, HTTP, NONE.

Declaration
public Output<string> Type { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, DataSourceState, CustomResourceOptions)

Get an existing DataSource resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static DataSource Get(string name, Input<string> id, DataSourceState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

DataSourceState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
DataSource
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.