resource

package module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2021 License: MIT Imports: 9 Imported by: 0

README

Build Status Go Report Card

AWS AppSync resource

A Concourse resource to update AppSync schema. Written in Go.

Source Configuration

Parameter Required Example Description
api_id Yes znvjdp3n25epx
access_key_id Yes {YOUR_ACCESS_KEY_ID}
secret_access_key Yes {YOUR_SECRET_ACCESS_KEY}
session_token Yes {YOUR_SESSION_TOKEN}
region_name No eu-west-1 AWS region DEFAULT: eu-west-1
out: Update or Create schema.

Given a schema specified by schema_file, to update/create AppSync schema Or/And Given a resolvers JSON specified by resolvers_file, to update AppSync existing schema resolvers.

Parameters
  • schema_file: Optional. .grapqh schema File provided by an output of a task, if you didn't specify resolvers_file this field is Required..

  • resolvers_file: Optional. .yml resolver String provided by an output of a task, if you didn't specify schema_file this field is Required.. .

Example Configuration

Resource type
resource_types:
- name: appsync-resource
    type: docker-image
    source:
      repository: teliaoss/appsync-resource
Resource
resource:
- name: appsync-resource
    type: resource
    source:
      access_key_id: ((access-key))
      secret_access_key: ((secret-key))
      session_token: ((session-token))
      region_name: "eu-west-1"
      api_id: ((api-id))
Plan
- put: appsync-resource
  params: 
    schema_file: "path/to/schema.graphql"
    resolvers_file: "path/to/resolvers.yml"
Params file example

schema.graphql

resolvers.yml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAwsConfig

func NewAwsConfig(
	accessKey string,
	secretKey string,
	sessionToken string,
	regionName string,
) *aws.Config

Types

type AppSync

type AppSync interface {
	CreateOrUpdateResolvers(apiID string, resolversFile []byte, logger *log.Logger) (Statistics, Statistics, error)
	StartSchemaCreationOrUpdate(apiID string, schema []byte) error
	GetSchemaCreationStatus(apiID string) (string, string, error)
}

AppSync interface

func NewAppSyncClient

func NewAppSyncClient(
	awsConfig *aws.Config,
) (AppSync, error)

type Function added in v1.1.0

type Function struct {
	DataSourceName          string `yaml:"dataSource"`
	Name                    string `yaml:"name"`
	RequestMappingTemplate  string `yaml:"requestMappingTemplate"`
	ResponseMappingTemplate string `yaml:"responseMappingTemplate"`
}

type Resolver

type Resolver struct {
	DataSourceName          string   `yaml:"dataSource"`
	FieldName               string   `yaml:"fieldName"`
	RequestMappingTemplate  string   `yaml:"requestMappingTemplate"`
	ResponseMappingTemplate string   `yaml:"responseMappingTemplate"`
	Functions               []string `yaml:"functions"`
	TypeName                string   `yaml:"typeName"`
}

type Resolvers

type Resolvers struct {
	Resolvers []Resolver `yaml:"resolvers"`
	Functions []Function `yaml:"functions"`
}

type Statistics added in v1.1.0

type Statistics struct {
	Created        int
	Updated        int
	FailedToCreate int
	FailedToUpdate int
}

Directories

Path Synopsis
cmd
in
out

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL