Module: AWSCDK::AppSync::IEventAPI

Includes:
IAPI
Included in:
EventAPIBase
Defined in:
app_sync/i_event_api.rb

Overview

Interface for Event API.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'app_sync/i_event_api.rb', line 261

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :api_ref => { kind: :property, name: "apiRef", is_optional: false },
    :api_arn => { kind: :property, name: "apiArn", is_optional: false },
    :api_id => { kind: :property, name: "apiId", is_optional: false },
    :auth_provider_types => { kind: :property, name: "authProviderTypes", is_optional: false },
    :http_dns => { kind: :property, name: "httpDns", is_optional: false },
    :realtime_dns => { kind: :property, name: "realtimeDns", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :add_channel_namespace => { kind: :method, name: "addChannelNamespace", is_optional: false },
    :add_dynamo_db_data_source => { kind: :method, name: "addDynamoDbDataSource", is_optional: false },
    :add_event_bridge_data_source => { kind: :method, name: "addEventBridgeDataSource", is_optional: false },
    :add_http_data_source => { kind: :method, name: "addHttpDataSource", is_optional: false },
    :add_lambda_data_source => { kind: :method, name: "addLambdaDataSource", is_optional: false },
    :add_open_search_data_source => { kind: :method, name: "addOpenSearchDataSource", is_optional: false },
    :add_rds_data_source => { kind: :method, name: "addRdsDataSource", is_optional: false },
    :grant => { kind: :method, name: "grant", is_optional: false },
    :grant_connect => { kind: :method, name: "grantConnect", is_optional: false },
    :grant_publish => { kind: :method, name: "grantPublish", is_optional: false },
    :grant_publish_and_subscribe => { kind: :method, name: "grantPublishAndSubscribe", is_optional: false },
    :grant_subscribe => { kind: :method, name: "grantSubscribe", is_optional: false },
  }
end

Instance Method Details

#add_channel_namespace(id, options = nil) ⇒ AWSCDK::AppSync::ChannelNamespace

add a new channel namespace.

Parameters:

Returns:



115
116
117
118
119
120
# File 'app_sync/i_event_api.rb', line 115

def add_channel_namespace(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::ChannelNamespaceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5DaGFubmVsTmFtZXNwYWNlT3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("addChannelNamespace", [id, options])
end

#add_dynamo_db_data_source(id, table, options = nil) ⇒ AWSCDK::AppSync::AppSyncDynamoDBDataSource

Add a new DynamoDB data source to this API.

Parameters:

Returns:



128
129
130
131
132
133
134
# File 'app_sync/i_event_api.rb', line 128

def add_dynamo_db_data_source(id, table, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(table, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuSVRhYmxlIn0=")), "table")
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncDataSourceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jRGF0YVNvdXJjZU9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addDynamoDbDataSource", [id, table, options])
end

#add_event_bridge_data_source(id, event_bus, options = nil) ⇒ AWSCDK::AppSync::AppSyncEventBridgeDataSource

Add an EventBridge data source to this api.

Parameters:

Returns:



142
143
144
145
146
147
148
# File 'app_sync/i_event_api.rb', line 142

def add_event_bridge_data_source(id, event_bus, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(event_bus, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLklFdmVudEJ1cyJ9")), "eventBus")
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncDataSourceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jRGF0YVNvdXJjZU9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addEventBridgeDataSource", [id, event_bus, options])
end

#add_http_data_source(id, endpoint, options = nil) ⇒ AWSCDK::AppSync::AppSyncHttpDataSource

add a new http data source to this API.

Parameters:

Returns:



156
157
158
159
160
161
162
# File 'app_sync/i_event_api.rb', line 156

def add_http_data_source(id, endpoint, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpoint")
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncHttpDataSourceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jSHR0cERhdGFTb3VyY2VPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("addHttpDataSource", [id, endpoint, options])
end

#add_lambda_data_source(id, lambda_function, options = nil) ⇒ AWSCDK::AppSync::AppSyncLambdaDataSource

add a new Lambda data source to this API.

Parameters:

Returns:



170
171
172
173
174
175
176
# File 'app_sync/i_event_api.rb', line 170

def add_lambda_data_source(id, lambda_function, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(lambda_function, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "lambdaFunction")
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncDataSourceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jRGF0YVNvdXJjZU9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addLambdaDataSource", [id, lambda_function, options])
end

#add_open_search_data_source(id, domain, options = nil) ⇒ AWSCDK::AppSync::AppSyncOpenSearchDataSource

Add a new OpenSearch data source to this API.

Parameters:

Returns:



184
185
186
187
188
189
190
# File 'app_sync/i_event_api.rb', line 184

def add_open_search_data_source(id, domain, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(domain, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfb3BlbnNlYXJjaHNlcnZpY2UuSURvbWFpbiJ9")), "domain")
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncDataSourceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jRGF0YVNvdXJjZU9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addOpenSearchDataSource", [id, domain, options])
end

#add_rds_data_source(id, serverless_cluster, secret_store, database_name = nil, options = nil) ⇒ AWSCDK::AppSync::AppSyncRDSDataSource

add a new Rds data source to this API.

Parameters:

Returns:



200
201
202
203
204
205
206
207
208
# File 'app_sync/i_event_api.rb', line 200

def add_rds_data_source(id, serverless_cluster, secret_store, database_name = nil, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(serverless_cluster, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuYXdzX3Jkcy5JRGF0YWJhc2VDbHVzdGVyIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLklTZXJ2ZXJsZXNzQ2x1c3RlciJ9XX19")), "serverlessCluster")
  Jsii::Type.check_type(secret_store, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSVNlY3JldCJ9")), "secretStore")
  Jsii::Type.check_type(database_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "databaseName") unless database_name.nil?
  options = options.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncDataSourceOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jRGF0YVNvdXJjZU9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addRdsDataSource", [id, serverless_cluster, secret_store, database_name, options])
end

#api_arnString

The ARN of the AWS AppSync Api.

Returns:

  • (String)


47
48
49
# File 'app_sync/i_event_api.rb', line 47

def api_arn()
  jsii_get_property("apiArn")
end

#api_idString

The unique identifier for the AWS AppSync Api generated by the service.

Returns:

  • (String)


54
55
56
# File 'app_sync/i_event_api.rb', line 54

def api_id()
  jsii_get_property("apiId")
end

#api_refAWSCDK::Interfaces::AWSAppsync::APIReference

A reference to a Api resource.



40
41
42
# File 'app_sync/i_event_api.rb', line 40

def api_ref()
  jsii_get_property("apiRef")
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



105
106
107
108
# File 'app_sync/i_event_api.rb', line 105

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#auth_provider_typesArray<AWSCDK::AppSync::AppSyncAuthorizationType>

The Authorization Types for this Event Api.



61
62
63
# File 'app_sync/i_event_api.rb', line 61

def auth_provider_types()
  jsii_get_property("authProviderTypes")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



26
27
28
# File 'app_sync/i_event_api.rb', line 26

def env()
  jsii_get_property("env")
end

#grant(grantee, resources, *actions) ⇒ AWSCDK::IAM::Grant

Adds an IAM policy statement associated with this Event API to an IAM principal's policy.

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    The principal.

  • resources (AWSCDK::AppSync::AppSyncEventResource)

    The set of resources to allow (i.e. ...:[region]:[accountId]:apis/EventApiId/...).

  • actions (Array<String>)

    The actions that should be granted to the principal (i.e. appsync:EventPublish ).

Returns:



216
217
218
219
220
221
222
223
# File 'app_sync/i_event_api.rb', line 216

def grant(grantee, resources, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  Jsii::Type.check_type(resources, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jRXZlbnRSZXNvdXJjZSJ9")), "resources")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("grant", [grantee, resources, *actions])
end

#grant_connect(grantee) ⇒ AWSCDK::IAM::Grant

Adds an IAM policy statement for EventConnect access to this EventApi to an IAM principal's policy.

Parameters:

Returns:



229
230
231
232
# File 'app_sync/i_event_api.rb', line 229

def grant_connect(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantConnect", [grantee])
end

#grant_publish(grantee) ⇒ AWSCDK::IAM::Grant

Adds an IAM policy statement for EventPublish access to this EventApi to an IAM principal's policy.

Parameters:

Returns:



238
239
240
241
# File 'app_sync/i_event_api.rb', line 238

def grant_publish(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantPublish", [grantee])
end

#grant_publish_and_subscribe(grantee) ⇒ AWSCDK::IAM::Grant

Adds an IAM policy statement to publish and subscribe to this API for an IAM principal's policy.

Parameters:

Returns:



247
248
249
250
# File 'app_sync/i_event_api.rb', line 247

def grant_publish_and_subscribe(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantPublishAndSubscribe", [grantee])
end

#grant_subscribe(grantee) ⇒ AWSCDK::IAM::Grant

Adds an IAM policy statement for EventSubscribe access to this EventApi to an IAM principal's policy.

Parameters:

Returns:



256
257
258
259
# File 'app_sync/i_event_api.rb', line 256

def grant_subscribe(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantSubscribe", [grantee])
end

#http_dnsString

The domain name of the Api's HTTP endpoint.

Returns:

  • (String)


68
69
70
# File 'app_sync/i_event_api.rb', line 68

def http_dns()
  jsii_get_property("httpDns")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


11
12
13
# File 'app_sync/i_event_api.rb', line 11

def node()
  jsii_get_property("node")
end

#realtime_dnsString

The domain name of the Api's real-time endpoint.

Returns:

  • (String)


75
76
77
# File 'app_sync/i_event_api.rb', line 75

def realtime_dns()
  jsii_get_property("realtimeDns")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



33
34
35
# File 'app_sync/i_event_api.rb', line 33

def stack()
  jsii_get_property("stack")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



86
87
88
89
90
91
# File 'app_sync/i_event_api.rb', line 86

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end