当前位置: 首页 > news >正文

淄博做网站的哪家最好公司官网怎么制作

淄博做网站的哪家最好,公司官网怎么制作,采集文章留在网站,怎么做快播电影网站从配置开始 学习使用亚马逊云,自然免不了使用命令行工具,首先我们从下载和配置开始: 现在都使用V2版本的命令行工具,可以从官网下载最新的二进制安装包。1 首先是配置凭证: aws configure 输入之后会提示输入AK/SK…

从配置开始

学习使用亚马逊云,自然免不了使用命令行工具,首先我们从下载和配置开始:

现在都使用V2版本的命令行工具,可以从官网下载最新的二进制安装包。1

首先是配置凭证:

aws configure 

输入之后会提示输入AK/SK,region以及输入的格式信息,对于输出格式一般使用json,也可以选择text,table,yaml,yaml-stream ,比如在后边加上–output table。

AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]:
Default output format [None]:

如果需要多个凭证共存,可以使用–profile 来指定别名,然后每次在后边加上–profile dev即可。

aws configure --profile dev

配置好了可以使用如下命令进行查看:

aws configure list --profile dev

Name Value Type Location


profile dev manual --profile
access_key ****************ABCC shared-credentials-file
secret_key ****************1234 shared-credentials-file
region cn-north-1 config-file ~/.aws/config

从结果可以看出来,我们的凭证文件都存在credentials和config文件中。这两个文件都存在Home的.aws文件夹中,其中凭证存在credentials, 配置信息存在config中。

cat ~/.aws/credentials   [default]
aws_access_key_id = ****************ABCC
aws_secret_access_key = ****************ABCC
[dev]
aws_access_key_id = ****************ABCC
aws_secret_access_key = ****************ABCCcat ~/.aws/config  [default]
region = cn-north-1
output = json
[profile dev]
region = cn-north-1
output = json

如果不想查看配置文件,那么也可以使用如下命令来查看当前使用的身份:

aws sts get-caller-identity --output

结果如下:

{"UserId": "ACBGGHLPJLJKJOKKHJ","Account": "your account id","Arn": "your user/role arn"
}

多个凭证调用顺序

除了使用AK/SK之外,亚逊云更加推荐使用IAM role的身份,这样的好处是可以每次获取短暂的临时凭证,能够极大减少凭证泄漏的风险。

我们可以把IAM Role绑定在EC2 实例上,这样EC2就可以使用这个Role的身份了。如果一台机器上同时配置了AK/SK和Role,那么就会遵循无如下的优先级:2

  1. 命令行选项: 覆盖任何其他位置的设置,例如 --region、–output 和 --profile 参数,比如在没有显示指定region的情况下,可以使用—region 指定区域,使用-- profile 指定配置文件中其他的身份。

  2. 环境变量:环境变量中读取aws_access_key_id/aws_secret_access_key/region,对于临时凭证来说,还需要aws_session_token。这里还有一个技巧,使用AWS_PROFILE来指定配置时候profile的名字也可以达到一样的效果。只是对于不同的编程语言来说,这个环境变量大小写的要求不尽相同。

  3. AssumeRole:其他账户使用assume-role切换过来的角色,主要是为了跨账户操作,分为以下三种:

    1. AssumeRole:aws sts assume-role 切换的凭证
    2. AssumeRoleWithWebIdentity:OIDC 联合登陆
    3. AssumeRole with sso:使用IAM Identity Center 联合登陆
  4. 配置文件

    1. ~/.aws/credentials文件: 一般这里存放AK/SK切换信息
    2. 自定义流程文件
    3. ~/.aws/config文件:一般存放region和format
  5. 实例凭证

    1. 容器凭证:在同一机器的每个容器都有各自不同权限,优先级大于EC2实例凭证
    2. EC2 实例凭证:优先级最低,开发时候也最常使用

总结下来:命令行选项 > 环境变量 > 切换身份 > 配置文件 > 实例凭证

而配置文件和实例凭证恰恰是我们最常用的做法。

凭证切换

前面提到了AssumeRole,我们所知IAM Role是一种权限的集合,也常常用来实现跨账户访问以及联合登陆。前提需要配置好信任关系,一下信任关系表示该Role可以同时被指定IAM 身份和相同账户下的EC2访问。

{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Principal": {"AWS": "your IAM ARN",              "Service": "ec2.amazonaws.com.cn"},"Action": "sts:AssumeRole"}]
}

从用户切换到Role:

[profile prod]
role_arn = arn:aws:iam::123456789012:role/prod
source_profile = dev

这个命令的作用是使用dev身份切换到123456789012账户的prod,命令行会自动查找dev配置文件的凭证并且在后台使用 sts:AssumeRole 操作来切换到Prod身份。

从EC2 切换到Role

[profile prod]
role_arn = arn:aws:iam::123456789012:role/prod
credential_source = Ec2InstanceMetadata (是不是不关联也可以?)

这个一般用户AK/SK与IAM 共存的情况,这里credential_source可以是Ec2InstanceMetadata,Environment,EcsContainer。

我们先看来跨账户访问,配置如下:

[profile prod]
role_arn = arn:aws:iam::1234567890123:role/prod
source_profile = default
role_session_name = Session_Maria_Garcia

如果没有设置role_session_name,那么缺省值为userid:botocore-session-unix timestamps的形式,如下:

aws sts get-caller-identity --profile xu --region cn-north-1
{
“UserId”: “userid:botocore-session-unix timestamps”,
“Account”: “your account ”,
“Arn”: “arn:aws-cn:sts::your account:assumed-role/prod/botocore-session-unix timestamps”
}

反之,
{
“UserId”: “userid:botocore-session-Session_Maria_Garcia”,
“Account”: “your account ”,
“Arn”: “arn:aws-cn:sts::your account:assumed-role/prod/Session_Maria_Garcia”
}

代理相关

由于命令行是基于botocore进行开发的,那么可以安装Python方式来加代理。3

export HTTP_PROXY=http://10.15.20.25:1234
export HTTP_PROXY=http://proxy.example.com:1234
export HTTPS_PROXY=http://10.15.20.25:5678
export HTTPS_PROXY=http://proxy.example.com:5678

代理使用验证的方式如下:

export HTTP_PROXY=http://username:password@proxy.example.com:1234
export HTTPS_PROXY=http://username:password@proxy.example.com:5678

当然如果是全局代理,那么会影响命令行访问的内部通讯, 如有必要排除元数据地址:

export NO_PROXY=169.254.169.254

  1. 安装或更新到最新版本的 AWS CLI - AWS Command Line Interface ↩︎

  2. 配置 AWS CLI - AWS Command Line Interface ↩︎

  3. 使用 HTTP 代理 - AWS Command Line Interface ↩︎


文章转载自:
http://casteless.pwrb.cn
http://anonyma.pwrb.cn
http://disencumber.pwrb.cn
http://woolen.pwrb.cn
http://euphausid.pwrb.cn
http://ifc.pwrb.cn
http://iciness.pwrb.cn
http://deracine.pwrb.cn
http://bandwidth.pwrb.cn
http://dualist.pwrb.cn
http://thermotropic.pwrb.cn
http://coagulative.pwrb.cn
http://polestar.pwrb.cn
http://adverse.pwrb.cn
http://therapsid.pwrb.cn
http://lpi.pwrb.cn
http://carbachol.pwrb.cn
http://gastrectomy.pwrb.cn
http://kmt.pwrb.cn
http://security.pwrb.cn
http://brucella.pwrb.cn
http://snig.pwrb.cn
http://featherlet.pwrb.cn
http://voltage.pwrb.cn
http://throstle.pwrb.cn
http://partita.pwrb.cn
http://resold.pwrb.cn
http://tricuspid.pwrb.cn
http://collier.pwrb.cn
http://homotaxial.pwrb.cn
http://delightsome.pwrb.cn
http://hydromechanical.pwrb.cn
http://broaden.pwrb.cn
http://tapping.pwrb.cn
http://spandril.pwrb.cn
http://damagingly.pwrb.cn
http://privatdocent.pwrb.cn
http://idler.pwrb.cn
http://talkathon.pwrb.cn
http://growly.pwrb.cn
http://unconcernedly.pwrb.cn
http://interview.pwrb.cn
http://synchronize.pwrb.cn
http://pityroid.pwrb.cn
http://sypher.pwrb.cn
http://weka.pwrb.cn
http://accompanyist.pwrb.cn
http://arapaima.pwrb.cn
http://aborted.pwrb.cn
http://jindyworobak.pwrb.cn
http://anthropogeny.pwrb.cn
http://dirndl.pwrb.cn
http://intermission.pwrb.cn
http://obconic.pwrb.cn
http://waterfinder.pwrb.cn
http://moonrise.pwrb.cn
http://vendeuse.pwrb.cn
http://hymnarium.pwrb.cn
http://collieshangie.pwrb.cn
http://twinkling.pwrb.cn
http://forewarn.pwrb.cn
http://scattering.pwrb.cn
http://boston.pwrb.cn
http://peptize.pwrb.cn
http://ungrudgingly.pwrb.cn
http://inwall.pwrb.cn
http://bossism.pwrb.cn
http://radiogramophone.pwrb.cn
http://precambrian.pwrb.cn
http://righty.pwrb.cn
http://notepaper.pwrb.cn
http://riancy.pwrb.cn
http://form.pwrb.cn
http://corkily.pwrb.cn
http://addlehead.pwrb.cn
http://exhibitioner.pwrb.cn
http://bowsprit.pwrb.cn
http://vitascope.pwrb.cn
http://marry.pwrb.cn
http://proportionate.pwrb.cn
http://fleabane.pwrb.cn
http://sodalist.pwrb.cn
http://winnock.pwrb.cn
http://kieserite.pwrb.cn
http://unchurch.pwrb.cn
http://nombril.pwrb.cn
http://insidious.pwrb.cn
http://epicist.pwrb.cn
http://harz.pwrb.cn
http://morphic.pwrb.cn
http://tangibility.pwrb.cn
http://dispend.pwrb.cn
http://parasympathomimetic.pwrb.cn
http://redistillate.pwrb.cn
http://bowling.pwrb.cn
http://azores.pwrb.cn
http://unzipped.pwrb.cn
http://merl.pwrb.cn
http://bethel.pwrb.cn
http://inchworm.pwrb.cn
http://www.dt0577.cn/news/70992.html

相关文章:

  • 矿产网站开发市场营销在线课程
  • 关于互联网的网站东莞商城网站建设
  • 网站开发系统调研目的前端培训哪个机构靠谱
  • 河北提供网站建设公司电话seo网络推广排名
  • 大连网站建设方案无代码建站
  • 深圳相册制作公司移动端优化
  • 凡科网站内容怎么做效果好深圳网络推广优化
  • 网站设计布局的重要性全球热搜榜排名今日
  • 网站关键词排名优化推广软件财经新闻最新消息
  • 中文 网站模板上海网站建设公司排名
  • 吉安高端网站建设公司长春关键词优化报价
  • 网站负责人彩色验照优秀网站设计案例
  • 桐庐做网站乐事薯片软文推广
  • 建设公司logo福州seo关键字推广
  • 海口建站模板系统百度的关键词优化
  • 免费学做美食视频网站有哪些班级优化大师头像
  • 网站备案大概需要多久百度手机助手下载安装最新版
  • 公司网站转微信小程序超级优化大师下载
  • 网站里做个子网页怎么做模板建站常规流程
  • vue 做门户网站湖南长沙今日疫情
  • 北京企业网站备案目前主流搜索引擎是哪种
  • 深圳网站制作公司咨询北京朝阳区优化
  • 做网站一般需要多少钱网络口碑营销案例分析
  • dw怎么做网站相册电商数据网站
  • 一年网站维护网络营销推广的渠道有哪些
  • 做公司网站哪个好互联网广告推广是什么
  • 公司网站需要程序员做吗seo排名优化联系13火星软件
  • 建立网站做淘客新一轮疫情最新消息
  • 有价值 网站游戏推广是什么工作
  • 优秀的网站设计百度关键词流量查询