@@ -1306,7 +1306,7 @@ export const bucketWithWebsiteRos = {
13061306 } ,
13071307 ROSTemplateFormatVersion : '2015-09-01' ,
13081308 Resources : {
1309- FCFunctionFormy_bucket_bucket_code_deployment : {
1309+ FCFunctionForsi_auto_my_bucket_bucket_code_deployment : {
13101310 Properties : {
13111311 CAPort : 9000 ,
13121312 Code : {
@@ -1340,103 +1340,18 @@ export const bucketWithWebsiteRos = {
13401340 MemorySize : 128 ,
13411341 Runtime : 'python3.10' ,
13421342 ServiceName : {
1343- 'Fn::GetAtt' : [ 'FCServiceFormy_bucket_bucket_code_deployment ' , 'ServiceName' ] ,
1343+ 'Fn::GetAtt' : [ 'FCServiceForsi_auto_my_bucket_bucket_code_deployment ' , 'ServiceName' ] ,
13441344 } ,
13451345 Timeout : 3000 ,
13461346 } ,
13471347 Type : 'ALIYUN::FC::Function' ,
13481348 } ,
1349- FCRoleFormy_bucket_bucket_code_deployment : {
1350- Properties : {
1351- AssumeRolePolicyDocument : {
1352- Statement : [
1353- {
1354- Action : 'sts:AssumeRole' ,
1355- Effect : 'Allow' ,
1356- Principal : {
1357- Service : [ 'fc.aliyuncs.com' ] ,
1358- } ,
1359- } ,
1360- ] ,
1361- Version : '1' ,
1362- } ,
1363- DeletionForce : false ,
1364- IgnoreExisting : false ,
1365- Policies : [
1366- {
1367- PolicyDocument : {
1368- Statement : [
1369- {
1370- Action : [ 'oss:*' ] ,
1371- Effect : 'Allow' ,
1372- Resource : [ '*' ] ,
1373- } ,
1374- ] ,
1375- Version : '1' ,
1376- } ,
1377- PolicyName : 'AliyunOSSFullAccess' ,
1378- } ,
1379- {
1380- PolicyDocument : {
1381- Statement : [
1382- {
1383- Action : [ 'log:*' ] ,
1384- Effect : 'Allow' ,
1385- Resource : [ '*' ] ,
1386- } ,
1387- {
1388- Action : [ 'ram:CreateServiceLinkedRole' ] ,
1389- Condition : {
1390- StringEquals : {
1391- 'ram:ServiceName' : [
1392- 'audit.log.aliyuncs.com' ,
1393- 'alert.log.aliyuncs.com' ,
1394- 'middlewarelens.log.aliyuncs.com' ,
1395- 'storagelens.log.aliyuncs.com' ,
1396- 'ai-lens.log.aliyuncs.com' ,
1397- 'securitylens.log.aliyuncs.com' ,
1398- ] ,
1399- } ,
1400- } ,
1401- Effect : 'Allow' ,
1402- Resource : [ '*' ] ,
1403- } ,
1404- ] ,
1405- Version : '1' ,
1406- } ,
1407- PolicyName : 'AliyunLogFullAccess' ,
1408- } ,
1409- ] ,
1410- RoleName : {
1411- 'Fn::Join' : [
1412- '-' ,
1413- [
1414- 'ros-cdk' ,
1415- {
1416- 'Fn::Select' : [
1417- 0 ,
1418- {
1419- 'Fn::Split' : [
1420- '-' ,
1421- {
1422- Ref : 'ALIYUN::StackId' ,
1423- } ,
1424- ] ,
1425- } ,
1426- ] ,
1427- } ,
1428- ] ,
1429- ] ,
1430- } ,
1431- } ,
1432- Type : 'ALIYUN::RAM::Role' ,
1433- } ,
1434- FCServiceFormy_bucket_bucket_code_deployment : {
1349+ FCServiceForsi_auto_my_bucket_bucket_code_deployment : {
14351350 Properties : {
14361351 DeletionForce : false ,
14371352 Description : 'FC service for oss deployment by CDK' ,
14381353 Role : {
1439- 'Fn::GetAtt' : [ 'FCRoleFormy_bucket_bucket_code_deployment ' , 'Arn' ] ,
1354+ 'Fn::GetAtt' : [ 'si_auto_od_bucket_role ' , 'Arn' ] ,
14401355 } ,
14411356 ServiceName : {
14421357 'Fn::Join' : [
@@ -1483,7 +1398,7 @@ export const bucketWithWebsiteRos = {
14831398 } ,
14841399 Type : 'ALIYUN::OSS::Bucket' ,
14851400 } ,
1486- my_bucket_bucket_code_deployment : {
1401+ si_auto_my_bucket_bucket_code_deployment : {
14871402 Properties : {
14881403 Parameters : {
14891404 destinationBucket : {
@@ -1501,11 +1416,38 @@ export const bucketWithWebsiteRos = {
15011416 ] ,
15021417 } ,
15031418 ServiceToken : {
1504- 'Fn::GetAtt' : [ 'FCFunctionFormy_bucket_bucket_code_deployment ' , 'ARN' ] ,
1419+ 'Fn::GetAtt' : [ 'FCFunctionForsi_auto_my_bucket_bucket_code_deployment ' , 'ARN' ] ,
15051420 } ,
15061421 Timeout : 3000 ,
15071422 } ,
15081423 Type : 'ALIYUN::ROS::CustomResource' ,
15091424 } ,
1425+ si_auto_od_bucket_role : {
1426+ Properties : {
1427+ AssumeRolePolicyDocument : {
1428+ Statement : [
1429+ {
1430+ Action : 'sts:AssumeRole' ,
1431+ Effect : 'Allow' ,
1432+ Principal : {
1433+ Service : [ 'fc.aliyuncs.com' ] ,
1434+ } ,
1435+ } ,
1436+ ] ,
1437+ Version : '1' ,
1438+ } ,
1439+ DeletionForce : false ,
1440+ Description :
1441+ 'roles created by ServerlessInsight for oss deployment to put files to oss bucket during deployment' ,
1442+ IgnoreExisting : false ,
1443+ PolicyAttachments : {
1444+ System : [ 'AliyunOSSFullAccess' , 'AliyunLogFullAccess' ] ,
1445+ } ,
1446+ RoleName : {
1447+ 'Fn::Sub' : 'si-auto-od-bucket-role-${ALIYUN::StackId}' ,
1448+ } ,
1449+ } ,
1450+ Type : 'ALIYUN::RAM::Role' ,
1451+ } ,
15101452 } ,
15111453} ;
0 commit comments