官术网_书友最值得收藏!

  • AWS Administration Cookbook
  • Lucas Chan Rowan Udell
  • 222字
  • 2021-07-09 18:18:28

Permissions and service roles

One important thing to remember about CloudFormation is that it's more or less just making API calls on your behalf. This means that CloudFormation will assume the very same permissions or role you use to execute your template. If you don't have permission to create a new hosted zone in Route 53, for example, any template you try to run that contains a new Route 53-hosted zone will fail.

On the flip side, this has created a somewhat tricky situation where anyone developing CloudFormation typically has a very elevated level of privileges, and these privileges are somewhat unnecessarily granted to CloudFormation each time a template is executed.

If my CloudFormation template contains only one resource, which is a Route 53-hosted zone, it doesn't make sense for that template to be executed with full admin privileges to my AWS account. It makes much more sense to give CloudFormation a very slim set of permissions to execute the template with, thus limiting the blast radius if a bad template were to be executed (that is, a bad copy-and-paste operation resulting in deleted resources).

Thankfully, service roles have recently been introduced, and you can now define an IAM role and tell CloudFormation to use this role when your stack is being executed, giving you a much safer space to play in.

主站蜘蛛池模板: 延庆县| 湖北省| 库尔勒市| 龙游县| 南城县| 锡林郭勒盟| 柳河县| 长治县| 龙井市| 雷山县| 宜兰县| 南开区| 竹北市| 伊吾县| 邢台县| 汶川县| 平山县| 宜兴市| 延长县| 息烽县| 额济纳旗| 晋州市| 达孜县| 奇台县| 彭泽县| 太仆寺旗| 禄丰县| 玉树县| 饶河县| 峨边| 浮山县| 五台县| 蒙阴县| 乌审旗| 福建省| 马尔康县| 和龙市| 澜沧| 清流县| 清苑县| 鹤壁市|