Class: Jets::Cfn::Resource::ApiGateway::Authorizer
- Inherits:
-
Base
- Object
- Base
- Jets::Cfn::Resource::ApiGateway::Authorizer
show all
- Defined in:
- lib/jets/cfn/resource/api_gateway/authorizer.rb
Instance Method Summary
collapse
Methods inherited from Base
#attributes, #logical_id, #parameters, #permission, #properties, #replacements, #replacer, #standarize, #template, truncate_id, #type
#camelize
Constructor Details
#initialize(props = {}) ⇒ Authorizer
Returns a new instance of Authorizer.
3
4
5
|
# File 'lib/jets/cfn/resource/api_gateway/authorizer.rb', line 3
def initialize(props={})
@props = props end
|
Instance Method Details
#authorizer_logical_id ⇒ Object
47
48
49
|
# File 'lib/jets/cfn/resource/api_gateway/authorizer.rb', line 47
def authorizer_logical_id
"{namespace}Authorizer" end
|
#definition ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/jets/cfn/resource/api_gateway/authorizer.rb', line 7
def definition
{
authorizer_logical_id => {
Type: "AWS::ApiGateway::Authorizer",
Properties: props,
}
}
end
|
#outputs ⇒ Object
51
52
53
54
55
56
|
# File 'lib/jets/cfn/resource/api_gateway/authorizer.rb', line 51
def outputs
{
logical_id => "!Ref #{logical_id}",
}
end
|
#props ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/jets/cfn/resource/api_gateway/authorizer.rb', line 16
def props
default = {
RestApiId: '!Ref RestApi', Type: '', }
unless @props[:Type].to_s.upcase == 'COGNITO_USER_POOLS'
@props[:AuthorizerUri] = { "Fn::Join" => ['', [
'arn:aws:apigateway:',
"!Ref 'AWS::Region'",
':lambda:path/2015-03-31/functions/',
{"Fn::GetAtt" => ["{namespace}LambdaFunction", "Arn"]},
'/invocations'
]]
}
end
@props[:AuthorizerResultTtlInSeconds] = @props.delete(:ttl) if @props[:ttl]
normalize_type!(@props)
normalize_identity_source!(@props)
default.merge(@props)
end
|