forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom-domain.yml
65 lines (65 loc) · 1.5 KB
/
custom-domain.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建API网关自定义域名,关联DNS记录与SSL证书,支持特定VPC实例及域名解析。
en: Create a custom domain for the API Gateway, associate DNS records and SSL certificates,
supporting specific VPC instances and domain name resolution.
Parameters:
GroupName:
Type: String
Default: mytest
CertificateName:
Type: String
Default: mytest
DomainName:
Type: String
CertificateBody:
Type: String
CertificatePrivateKey:
Type: String
Resources:
Record:
Type: ALIYUN::DNS::DomainRecord
Properties:
DomainName:
Ref: DomainName
RR: '@'
Type: CNAME
Value:
Fn::Join:
- ''
- - Fn::GetAtt:
- Group
- GroupId
- '-'
- Ref: ALIYUN::Region
- .alicloudapi.com
Group:
Type: ALIYUN::ApiGateway::Group
Properties:
InstanceId: api-shared-vpc-001
GroupName:
Fn::Join:
- ''
- Fn::Split:
- '-'
- Ref: GroupName
CustomDomain:
Type: ALIYUN::ApiGateway::CustomDomain
Properties:
GroupId:
Ref: Group
DomainName:
Ref: DomainName
CertificateName:
Ref: CertificateName
CertificateBody:
Ref: CertificateBody
CertificatePrivateKey:
Ref: CertificatePrivateKey
DependsOn: Record
Outputs:
CertificateId:
Value:
Fn::GetAtt:
- CustomDomain
- CertificateId