gpt4 book ai didi

node.js - 调用CreateStack操作时发生错误(AccessDenied) :

转载 作者:行者123 更新时间:2023-12-02 19:23:46 25 4
gpt4 key购买 nike

An error occurred (AccessDenied) when calling the CreateStack operation: User: arn:aws:iam::812520856627:user/dimitris is not authorized to perform: cloudformation:CreateStack on resource: arn:aws:cloudformation:us-west-2:812520856627:stack/blog-stage/*

我试着在命令上运行它:

aws cloudformation create-stack --stack-name blog-stage --template-body file://$PWD/stack.yml --profile demo --region us-west-2
Resources:
AppNode:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
ImageId: ami-0c579621aaac8bade
KeyName: jimapos
SecurityGroups:
- !Ref AppNodeSG
AppNodeSG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: for the app nodes that allow ssh, http and docker ports
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '80'
ToPort: '80'
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: '22'
ToPort: '22'
CidrIp: 0.0.0.0/0

最佳答案

您正在尝试针对未授权执行 cloudformation:CreateStackUser dimitris 创建堆栈

收件人assign permission给用户转到https://console.aws.amazon.com/iam/home#/home -> 用户 -> 选择用户 -> 添加权限

尝试添加此政策与用户 dimitries。

示例授予创建和查看堆栈操作的示例策略

{
"Version":"2012-10-17",
"Statement":[{
"Effect":"Allow",
"Action":[
"cloudformation:CreateStack",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResources",
"cloudformation:GetTemplate",
"cloudformation:ValidateTemplate"
],
"Resource":"*"
}]
}

你可以查看这个link为特定资源定制或重新制定政策。

您可以创建自定义策略,也可以附加下面现有的策略。

enter image description here

enter image description here

enter image description here

关于node.js - 调用CreateStack操作时发生错误(AccessDenied) :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57935589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com