gravicore / terraform-gravicore-modules

This is a collection of reusable Terraform modules for Gravicore's cloud automation platform.
https://gravicore.io
Apache License 2.0
8 stars 8 forks source link

GDEV-373: adding lambda additional authentication for AppSync #397

Closed darlanmoraes closed 2 weeks ago

darlanmoraes commented 2 weeks ago

appsync-merged-api usage:

module "appsync_merged_api" {
  source = "../appsync-merged-api"

  domain = {
    zone = "example.com"
    name = "graphql"
    cert = "arn:aws:acm..."
  }

  authentication = [{
    priority = "principal"
    cognito = {
      user_pool = "us-east-1_..."
    }
    }, {
    priority = "secondary"
    lambda = {
      arn   = "arn:aws:lambda..."
      regex = "(?i)^bearer\\s+(.+)"
    }
  }]
}

appsync-merge usage:

module "appsync" {
  source = "../appsync-merge"

  graphql = {
    schema = file("schema.graphql")
    target = {
      lambda = "arn:aws:lambda..."
      merge  = "arn:aws:appsync..."
    }
    resolvers = [{
      type  = "Mutation"
      field = "MyMutation"
    }]
  }

  authentication = [{
    priority = "principal"
    cognito = {
      user_pool = "us-east-1_..."
    }
    }, {
    priority = "secondary"
    lambda = {
      arn   = "arn:aws:lambda..."
      regex = "(?i)^bearer\\s+(.+)"
    }
  }]
}