Class: Jets::Cfn::Resource::ApiGateway::DomainName
- Inherits:
-
Base
- Object
- Base
- Jets::Cfn::Resource::ApiGateway::DomainName
show all
- Defined in:
- lib/jets/cfn/resource/api_gateway/domain_name.rb
Instance Method Summary
collapse
Methods inherited from Base
#attributes, #logical_id, #parameters, #permission, #properties, #replacements, #replacer, #standarize, #template, truncate_id, #type
#camelize
Instance Method Details
#cert_arn ⇒ Object
61
62
63
|
# File 'lib/jets/cfn/resource/api_gateway/domain_name.rb', line 61
def cert_arn
Jets.config.domain.cert_arn
end
|
#definition ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/jets/cfn/resource/api_gateway/domain_name.rb', line 13
def definition
properties = {
DomainName: domain_name,
EndpointConfiguration: {
Types: endpoint_types
}
}
if endpoint_types.include?("REGIONAL")
properties[:RegionalCertificateArn] = cert_arn
end
if endpoint_types.include?("EDGE")
properties[:CertificateArn] = cert_arn
end
{
DomainName: {
Type: "AWS::ApiGateway::DomainName",
Properties: properties
}
}
end
|
#domain_name ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/jets/cfn/resource/api_gateway/domain_name.rb', line 42
def domain_name
name = Jets.config.domain.name
if Jets.config.domain.apex
name ||= Jets.config.domain.hosted_zone_name
else
subdomain = Jets.project_namespace
managed_domain_name = "#{subdomain}.#{Jets.config.domain.hosted_zone_name}"
name ||= managed_domain_name
end
name.sub(/\.$/,'')
end
|
#endpoint_types ⇒ Object
57
58
59
|
# File 'lib/jets/cfn/resource/api_gateway/domain_name.rb', line 57
def endpoint_types
[Jets.config.domain.endpoint_type].flatten
end
|
#outputs ⇒ Object
36
37
38
39
40
|
# File 'lib/jets/cfn/resource/api_gateway/domain_name.rb', line 36
def outputs
{
DomainName: "!Ref DomainName",
}
end
|