aws-sdk-eventbridge 1.39.0 → 1.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-eventbridge/client.rb +20 -5
- data/lib/aws-sdk-eventbridge/endpoint_parameters.rb +74 -0
- data/lib/aws-sdk-eventbridge/endpoint_provider.rb +158 -0
- data/lib/aws-sdk-eventbridge/endpoints.rb +855 -0
- data/lib/aws-sdk-eventbridge/plugins/endpoints.rb +180 -0
- data/lib/aws-sdk-eventbridge.rb +5 -1
- metadata +8 -5
- data/lib/aws-sdk-eventbridge/plugins/multi_region_endpoint.rb +0 -75
@@ -0,0 +1,180 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
|
11
|
+
module Aws::EventBridge
|
12
|
+
module Plugins
|
13
|
+
class Endpoints < Seahorse::Client::Plugin
|
14
|
+
option(
|
15
|
+
:endpoint_provider,
|
16
|
+
doc_type: 'Aws::EventBridge::EndpointProvider',
|
17
|
+
docstring: 'The endpoint provider used to resolve endpoints. Any '\
|
18
|
+
'object that responds to `#resolve_endpoint(parameters)` '\
|
19
|
+
'where `parameters` is a Struct similar to '\
|
20
|
+
'`Aws::EventBridge::EndpointParameters`'
|
21
|
+
) do |cfg|
|
22
|
+
Aws::EventBridge::EndpointProvider.new
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
class Handler < Seahorse::Client::Handler
|
27
|
+
def call(context)
|
28
|
+
# If endpoint was discovered, do not resolve or apply the endpoint.
|
29
|
+
unless context[:discovered_endpoint]
|
30
|
+
params = parameters_for_operation(context)
|
31
|
+
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
32
|
+
|
33
|
+
context.http_request.endpoint = endpoint.url
|
34
|
+
apply_endpoint_headers(context, endpoint.headers)
|
35
|
+
end
|
36
|
+
|
37
|
+
context[:endpoint_params] = params
|
38
|
+
context[:auth_scheme] =
|
39
|
+
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
40
|
+
|
41
|
+
@handler.call(context)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def apply_endpoint_headers(context, headers)
|
47
|
+
headers.each do |key, values|
|
48
|
+
value = values
|
49
|
+
.compact
|
50
|
+
.map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
|
51
|
+
.join(',')
|
52
|
+
|
53
|
+
context.http_request.headers[key] = value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def parameters_for_operation(context)
|
58
|
+
case context.operation_name
|
59
|
+
when :activate_event_source
|
60
|
+
Aws::EventBridge::Endpoints::ActivateEventSource.build(context)
|
61
|
+
when :cancel_replay
|
62
|
+
Aws::EventBridge::Endpoints::CancelReplay.build(context)
|
63
|
+
when :create_api_destination
|
64
|
+
Aws::EventBridge::Endpoints::CreateApiDestination.build(context)
|
65
|
+
when :create_archive
|
66
|
+
Aws::EventBridge::Endpoints::CreateArchive.build(context)
|
67
|
+
when :create_connection
|
68
|
+
Aws::EventBridge::Endpoints::CreateConnection.build(context)
|
69
|
+
when :create_endpoint
|
70
|
+
Aws::EventBridge::Endpoints::CreateEndpoint.build(context)
|
71
|
+
when :create_event_bus
|
72
|
+
Aws::EventBridge::Endpoints::CreateEventBus.build(context)
|
73
|
+
when :create_partner_event_source
|
74
|
+
Aws::EventBridge::Endpoints::CreatePartnerEventSource.build(context)
|
75
|
+
when :deactivate_event_source
|
76
|
+
Aws::EventBridge::Endpoints::DeactivateEventSource.build(context)
|
77
|
+
when :deauthorize_connection
|
78
|
+
Aws::EventBridge::Endpoints::DeauthorizeConnection.build(context)
|
79
|
+
when :delete_api_destination
|
80
|
+
Aws::EventBridge::Endpoints::DeleteApiDestination.build(context)
|
81
|
+
when :delete_archive
|
82
|
+
Aws::EventBridge::Endpoints::DeleteArchive.build(context)
|
83
|
+
when :delete_connection
|
84
|
+
Aws::EventBridge::Endpoints::DeleteConnection.build(context)
|
85
|
+
when :delete_endpoint
|
86
|
+
Aws::EventBridge::Endpoints::DeleteEndpoint.build(context)
|
87
|
+
when :delete_event_bus
|
88
|
+
Aws::EventBridge::Endpoints::DeleteEventBus.build(context)
|
89
|
+
when :delete_partner_event_source
|
90
|
+
Aws::EventBridge::Endpoints::DeletePartnerEventSource.build(context)
|
91
|
+
when :delete_rule
|
92
|
+
Aws::EventBridge::Endpoints::DeleteRule.build(context)
|
93
|
+
when :describe_api_destination
|
94
|
+
Aws::EventBridge::Endpoints::DescribeApiDestination.build(context)
|
95
|
+
when :describe_archive
|
96
|
+
Aws::EventBridge::Endpoints::DescribeArchive.build(context)
|
97
|
+
when :describe_connection
|
98
|
+
Aws::EventBridge::Endpoints::DescribeConnection.build(context)
|
99
|
+
when :describe_endpoint
|
100
|
+
Aws::EventBridge::Endpoints::DescribeEndpoint.build(context)
|
101
|
+
when :describe_event_bus
|
102
|
+
Aws::EventBridge::Endpoints::DescribeEventBus.build(context)
|
103
|
+
when :describe_event_source
|
104
|
+
Aws::EventBridge::Endpoints::DescribeEventSource.build(context)
|
105
|
+
when :describe_partner_event_source
|
106
|
+
Aws::EventBridge::Endpoints::DescribePartnerEventSource.build(context)
|
107
|
+
when :describe_replay
|
108
|
+
Aws::EventBridge::Endpoints::DescribeReplay.build(context)
|
109
|
+
when :describe_rule
|
110
|
+
Aws::EventBridge::Endpoints::DescribeRule.build(context)
|
111
|
+
when :disable_rule
|
112
|
+
Aws::EventBridge::Endpoints::DisableRule.build(context)
|
113
|
+
when :enable_rule
|
114
|
+
Aws::EventBridge::Endpoints::EnableRule.build(context)
|
115
|
+
when :list_api_destinations
|
116
|
+
Aws::EventBridge::Endpoints::ListApiDestinations.build(context)
|
117
|
+
when :list_archives
|
118
|
+
Aws::EventBridge::Endpoints::ListArchives.build(context)
|
119
|
+
when :list_connections
|
120
|
+
Aws::EventBridge::Endpoints::ListConnections.build(context)
|
121
|
+
when :list_endpoints
|
122
|
+
Aws::EventBridge::Endpoints::ListEndpoints.build(context)
|
123
|
+
when :list_event_buses
|
124
|
+
Aws::EventBridge::Endpoints::ListEventBuses.build(context)
|
125
|
+
when :list_event_sources
|
126
|
+
Aws::EventBridge::Endpoints::ListEventSources.build(context)
|
127
|
+
when :list_partner_event_source_accounts
|
128
|
+
Aws::EventBridge::Endpoints::ListPartnerEventSourceAccounts.build(context)
|
129
|
+
when :list_partner_event_sources
|
130
|
+
Aws::EventBridge::Endpoints::ListPartnerEventSources.build(context)
|
131
|
+
when :list_replays
|
132
|
+
Aws::EventBridge::Endpoints::ListReplays.build(context)
|
133
|
+
when :list_rule_names_by_target
|
134
|
+
Aws::EventBridge::Endpoints::ListRuleNamesByTarget.build(context)
|
135
|
+
when :list_rules
|
136
|
+
Aws::EventBridge::Endpoints::ListRules.build(context)
|
137
|
+
when :list_tags_for_resource
|
138
|
+
Aws::EventBridge::Endpoints::ListTagsForResource.build(context)
|
139
|
+
when :list_targets_by_rule
|
140
|
+
Aws::EventBridge::Endpoints::ListTargetsByRule.build(context)
|
141
|
+
when :put_events
|
142
|
+
Aws::EventBridge::Endpoints::PutEvents.build(context)
|
143
|
+
when :put_partner_events
|
144
|
+
Aws::EventBridge::Endpoints::PutPartnerEvents.build(context)
|
145
|
+
when :put_permission
|
146
|
+
Aws::EventBridge::Endpoints::PutPermission.build(context)
|
147
|
+
when :put_rule
|
148
|
+
Aws::EventBridge::Endpoints::PutRule.build(context)
|
149
|
+
when :put_targets
|
150
|
+
Aws::EventBridge::Endpoints::PutTargets.build(context)
|
151
|
+
when :remove_permission
|
152
|
+
Aws::EventBridge::Endpoints::RemovePermission.build(context)
|
153
|
+
when :remove_targets
|
154
|
+
Aws::EventBridge::Endpoints::RemoveTargets.build(context)
|
155
|
+
when :start_replay
|
156
|
+
Aws::EventBridge::Endpoints::StartReplay.build(context)
|
157
|
+
when :tag_resource
|
158
|
+
Aws::EventBridge::Endpoints::TagResource.build(context)
|
159
|
+
when :test_event_pattern
|
160
|
+
Aws::EventBridge::Endpoints::TestEventPattern.build(context)
|
161
|
+
when :untag_resource
|
162
|
+
Aws::EventBridge::Endpoints::UntagResource.build(context)
|
163
|
+
when :update_api_destination
|
164
|
+
Aws::EventBridge::Endpoints::UpdateApiDestination.build(context)
|
165
|
+
when :update_archive
|
166
|
+
Aws::EventBridge::Endpoints::UpdateArchive.build(context)
|
167
|
+
when :update_connection
|
168
|
+
Aws::EventBridge::Endpoints::UpdateConnection.build(context)
|
169
|
+
when :update_endpoint
|
170
|
+
Aws::EventBridge::Endpoints::UpdateEndpoint.build(context)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def add_handlers(handlers, _config)
|
176
|
+
handlers.add(Handler, step: :build, priority: 75)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
data/lib/aws-sdk-eventbridge.rb
CHANGED
@@ -13,9 +13,13 @@ require 'aws-sigv4'
|
|
13
13
|
|
14
14
|
require_relative 'aws-sdk-eventbridge/types'
|
15
15
|
require_relative 'aws-sdk-eventbridge/client_api'
|
16
|
+
require_relative 'aws-sdk-eventbridge/plugins/endpoints.rb'
|
16
17
|
require_relative 'aws-sdk-eventbridge/client'
|
17
18
|
require_relative 'aws-sdk-eventbridge/errors'
|
18
19
|
require_relative 'aws-sdk-eventbridge/resource'
|
20
|
+
require_relative 'aws-sdk-eventbridge/endpoint_parameters'
|
21
|
+
require_relative 'aws-sdk-eventbridge/endpoint_provider'
|
22
|
+
require_relative 'aws-sdk-eventbridge/endpoints'
|
19
23
|
require_relative 'aws-sdk-eventbridge/customizations'
|
20
24
|
|
21
25
|
# This module provides support for Amazon EventBridge. This module is available in the
|
@@ -48,6 +52,6 @@ require_relative 'aws-sdk-eventbridge/customizations'
|
|
48
52
|
# @!group service
|
49
53
|
module Aws::EventBridge
|
50
54
|
|
51
|
-
GEM_VERSION = '1.
|
55
|
+
GEM_VERSION = '1.40.0'
|
52
56
|
|
53
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-eventbridge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 3.
|
22
|
+
version: 3.165.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
32
|
+
version: 3.165.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: aws-sigv4
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,8 +59,11 @@ files:
|
|
59
59
|
- lib/aws-sdk-eventbridge/client.rb
|
60
60
|
- lib/aws-sdk-eventbridge/client_api.rb
|
61
61
|
- lib/aws-sdk-eventbridge/customizations.rb
|
62
|
+
- lib/aws-sdk-eventbridge/endpoint_parameters.rb
|
63
|
+
- lib/aws-sdk-eventbridge/endpoint_provider.rb
|
64
|
+
- lib/aws-sdk-eventbridge/endpoints.rb
|
62
65
|
- lib/aws-sdk-eventbridge/errors.rb
|
63
|
-
- lib/aws-sdk-eventbridge/plugins/
|
66
|
+
- lib/aws-sdk-eventbridge/plugins/endpoints.rb
|
64
67
|
- lib/aws-sdk-eventbridge/resource.rb
|
65
68
|
- lib/aws-sdk-eventbridge/types.rb
|
66
69
|
homepage: https://github.com/aws/aws-sdk-ruby
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
module Aws
|
5
|
-
module EventBridge
|
6
|
-
module Plugins
|
7
|
-
# Resolve Multi-Region Endpoints
|
8
|
-
class MultiRegionEndpoint < Seahorse::Client::Plugin
|
9
|
-
|
10
|
-
def add_handlers(handlers, _config)
|
11
|
-
handlers.add(Handler, operations: [:put_events])
|
12
|
-
end
|
13
|
-
|
14
|
-
# After extracting out any ARN input, resolve a new URL with it.
|
15
|
-
class Handler < Seahorse::Client::Handler
|
16
|
-
def call(context)
|
17
|
-
if (multi_region_endpoint_id = context.params[:endpoint_id])
|
18
|
-
|
19
|
-
validate_multi_region_endpoint!(multi_region_endpoint_id)
|
20
|
-
validate_config!(context)
|
21
|
-
|
22
|
-
url = context.http_request.endpoint
|
23
|
-
region = context.config.region
|
24
|
-
|
25
|
-
# if regional_endpoint is false, a custom endpoint was provided
|
26
|
-
# customer provided endpoints should be used as is
|
27
|
-
if context.config.regional_endpoint
|
28
|
-
sfx = Aws::Partitions::EndpointProvider.dns_suffix_for(
|
29
|
-
region, 'events', { dualstack: context.config.use_dualstack_endpoint }
|
30
|
-
)
|
31
|
-
url.host = "#{multi_region_endpoint_id}.endpoint.events.#{sfx}"
|
32
|
-
end
|
33
|
-
|
34
|
-
context.config.sigv4_signer = sigv4a_signer(context)
|
35
|
-
end
|
36
|
-
|
37
|
-
@handler.call(context)
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def validate_multi_region_endpoint!(multi_region_endpoint_id)
|
43
|
-
unless !multi_region_endpoint_id.empty? &&
|
44
|
-
valid_hostname?(multi_region_endpoint_id)
|
45
|
-
raise ArgumentError, 'multi_region_endpoint_id must be a valid host label.'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def valid_hostname?(str)
|
50
|
-
str =~ /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$/
|
51
|
-
end
|
52
|
-
|
53
|
-
def validate_config!(context)
|
54
|
-
if context.config.use_fips_endpoint
|
55
|
-
raise ArgumentError,
|
56
|
-
'FIPS is not supported with EventBridge multi-region endpoints.'
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def sigv4a_signer(context)
|
61
|
-
existing = context.config.sigv4_signer
|
62
|
-
Aws::Sigv4::Signer.new(
|
63
|
-
service: existing.service,
|
64
|
-
region: '*',
|
65
|
-
credentials_provider: existing.credentials_provider,
|
66
|
-
signing_algorithm: :sigv4a,
|
67
|
-
uri_escape_path: true,
|
68
|
-
unsigned_headers: existing.unsigned_headers
|
69
|
-
)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|