当前位置:主页 > 查看内容

SLS控制台内嵌操作指南

发布时间:2021-06-12 00:00| 位朋友查看

简介:一、机制 详见 https://help.aliyun.com/document_detail/74971.html 二、操作2.1 子账号操作 主账号身份操作 登陆ram控制台 创建子账号。给子账号授予 AliyunSTSAssumeRoleAccess 权限。 创建子账号ak 并保存。 2.2 创建操作角色 主账号身份 主账号下创建角……
一、机制

image.png

详见 https://help.aliyun.com/document_detail/74971.html


二、操作2.1 子账号操作 主账号身份操作 登陆ram控制台 创建子账号。给子账号授予AliyunSTSAssumeRoleAccess权限。

image.png

创建子账号ak 并保存。

image.png

2.2 创建操作角色 主账号身份 主账号下创建角色 授予当前账号AliyunLogReadOnlyAccess权限。

image.png

image.png

image.png

image.png

在主账号下创建出具有sls读权限读slsreadrole角色 具有AliyunLogReadOnlyAccess权限。 这里的arn拷贝下来 后续代码使用。

image.png

信任策略 表示子账号具有assume权限。

{
 Statement : [
 Action : sts:AssumeRole ,
 Effect : Allow ,
 Principal : {
 RAM : [
 acs:ram::主账号uid:root 
 Version : 1 
}
2.3 代码获取免登页面

代码链接 https://samplecode.oss-cn-hangzhou.aliyuncs.com/slsconsole.py?spm a2c4g.11186623.2.17.71337019d4IbX1 file slsconsole.py


需要修改的配置

SigninHost 国内站账号 https://signin-intl.aliyun.com 国际站账号 https://signin.aliyun.com accessKeyId/accessKeySecret 子账号ak 即2.1建的akroleArn 主账号下建的role 即2.2建的roledestination 要访问的目的地
// destination取值样例 
// 完整查询分析页面 
https://sls4service.console.aliyun.com/lognext/project/ Project名称 /logsearch/ 日志库名称 ?hideTopbar true hideSidebar true
## 查询页面
https://sls4service.console.aliyun.com/lognext/project/ Project名称 /logsearch/ 日志库名称 ?isShare true hideTopbar true hideSidebar true
// 仪表盘页面
https://sls4service.console.aliyun.com/lognext/project/ Project名称 /dashboard/ 仪表盘ID ?isShare true hideTopbar true hideSidebar true




本文转自网络,原文链接:https://developer.aliyun.com/article/784281
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文

  • 周排行
  • 月排行
  • 总排行

随机推荐