forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuse-function-compute-to-download-multiple-objects-as-a-package.yml
88 lines (88 loc) · 2.55 KB
/
use-function-compute-to-download-multiple-objects-as-a-package.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 使用函数计算将对象存储OSS上多个文件(Object)打包下载到本地。
en: Use Function Compute to download multiple objects as a package to an on-premises
device.
Resources:
AliyunFCServerlessDevsRole:
Type: ALIYUN::RAM::Role
Properties:
RoleName: AliyunFCServerlessDevsRole
Description: 应用中心需要您的角色中包含应用所需策略,推荐创建并使用系统默认角色 AliyunFCServerlessDevsRole。
AssumeRolePolicyDocument:
Version: '1'
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service:
- fc.aliyuncs.com
MaxSessionDuration: 3600
IgnoreExisting: true
DeletionForce: true
PolicyAttachments:
System:
- AliyunNASFullAccess
- AliyunFCFullAccess
- AliyunFCServerlessDevsRolePolicy
- AliyunOSSReadOnlyAccess
- AliyunECSReadOnlyAccess
- AliyunVPCReadOnlyAccess
- AliyunLogReadOnlyAccess
AliyunFcRole:
Type: ALIYUN::RAM::Role
Properties:
RoleName:
Fn::Sub: AliyunFcRole-start-zip-oss-${ALIYUN::StackId}
Description: Service Role for FC to operate other resource
AssumeRolePolicyDocument:
Version: '1'
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service:
- fc.aliyuncs.com
MaxSessionDuration: 3600
DeletionForce: true
PolicyAttachments:
System:
- AliyunFCDefaultRolePolicy
- AliyunOSSFullAccess
Application:
Type: ALIYUN::FC::Application
Properties:
Name:
Fn::Sub: start-zip-oss-${ALIYUN::StackId}
RoleARN:
Fn::GetAtt:
- AliyunFCServerlessDevsRole
- Arn
Parameters:
serviceName:
Fn::Sub: zip-oss-${ALIYUN::StackId}
functionName:
Fn::Sub: zip-oss-func-${ALIYUN::StackId}
region: cn-hangzhou
roleArn:
Fn::GetAtt:
- AliyunFcRole
- Arn
Template: start-zip-oss
AutoDeploy: true
Outputs:
Url:
Description:
zh-cn: 对外公网域名,用于curl命令。
en: Internet URL, used for the curl command.
Value:
Fn::Jq:
- First
- .deploy."fc-zip-oss-service".triggers[0].urlInternet
- Fn::GetAtt:
- Application
- Output
Metadata:
ALIYUN::ROS::Interface:
TemplateTags:
- acs:document-help:oss:使用函数计算打包下载OSS文件