Class: AWSCDK::EventsTargets::AppSyncGraphQLAPIProps

Inherits:
TargetBaseProps
  • Object
show all
Defined in:
events_targets/app_sync_graph_qlapi_props.rb

Overview

Customize the AppSync GraphQL API target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, graph_ql_operation:, event_role: nil, variables: nil) ⇒ AppSyncGraphQLAPIProps

Returns a new instance of AppSyncGraphQLAPIProps.

Parameters:

  • dead_letter_queue (AWSCDK::SQS::IQueue, nil) (defaults to: nil)

    The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

  • max_event_age (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum age of a request that Lambda sends to a function for processing.

  • retry_attempts (Numeric, nil) (defaults to: nil)

    The maximum number of times to retry when the function returns an error.

  • graph_ql_operation (String)

    The GraphQL operation;

  • event_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.

  • variables (AWSCDK::Events::RuleTargetInput, nil) (defaults to: nil)

    The variables that are include in the GraphQL operation.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 13

def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, graph_ql_operation:, event_role: nil, variables: nil)
  @dead_letter_queue = dead_letter_queue
  Jsii::Type.check_type(@dead_letter_queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "deadLetterQueue") unless @dead_letter_queue.nil?
  @max_event_age = max_event_age
  Jsii::Type.check_type(@max_event_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxEventAge") unless @max_event_age.nil?
  @retry_attempts = retry_attempts
  Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil?
  @graph_ql_operation = graph_ql_operation
  Jsii::Type.check_type(@graph_ql_operation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "graphQLOperation")
  @event_role = event_role
  Jsii::Type.check_type(@event_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "eventRole") unless @event_role.nil?
  @variables = variables
  Jsii::Type.check_type(@variables, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "variables") unless @variables.nil?
end

Instance Attribute Details

#dead_letter_queueAWSCDK::SQS::IQueue? (readonly)

Note:

Default: - no dead-letter queue

The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.

Returns:



36
37
38
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 36

def dead_letter_queue
  @dead_letter_queue
end

#event_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - a new role with permissions to access mutations will be created

The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.

Returns:



64
65
66
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 64

def event_role
  @event_role
end

#graph_ql_operationString (readonly)

The GraphQL operation;

that is, the query, mutation, or subscription to be parsed and executed by the GraphQL service.

Returns:

  • (String)


59
60
61
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 59

def graph_ql_operation
  @graph_ql_operation
end

#max_event_ageAWSCDK::Duration? (readonly)

Note:

Default: Duration.hours(24)

The maximum age of a request that Lambda sends to a function for processing.

Minimum value of 60. Maximum value of 86400.

Returns:



44
45
46
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 44

def max_event_age
  @max_event_age
end

#retry_attemptsNumeric? (readonly)

Note:

Default: 185

The maximum number of times to retry when the function returns an error.

Minimum value of 0. Maximum value of 185.

Returns:

  • (Numeric, nil)


52
53
54
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 52

def retry_attempts
  @retry_attempts
end

#variablesAWSCDK::Events::RuleTargetInput? (readonly)

Note:

Default: - The entire event is used

The variables that are include in the GraphQL operation.



69
70
71
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 69

def variables
  @variables
end

Class Method Details

.jsii_propertiesObject



71
72
73
74
75
76
77
78
79
80
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 71

def self.jsii_properties
  {
    :dead_letter_queue => "deadLetterQueue",
    :max_event_age => "maxEventAge",
    :retry_attempts => "retryAttempts",
    :graph_ql_operation => "graphQLOperation",
    :event_role => "eventRole",
    :variables => "variables",
  }
end

Instance Method Details

#to_jsiiObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'events_targets/app_sync_graph_qlapi_props.rb', line 82

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "deadLetterQueue" => @dead_letter_queue,
    "maxEventAge" => @max_event_age,
    "retryAttempts" => @retry_attempts,
    "graphQLOperation" => @graph_ql_operation,
    "eventRole" => @event_role,
    "variables" => @variables,
  })
  result.compact
end