我现在非常困惑,并且正在努力使用 AWS。我创建了一个副驾驶应用程序,创建了服务,后来想删除它。我似乎手动删除了一些东西,现在我留下了一个无法操作的堆栈集,我无法删除它。由于堆栈必须为空,但堆栈实例无法操作,所以我无法对其执行任何操作
我有两个角色,执行和管理,这是执行角色
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"cloudformation:*",
"s3:*",
"sns:*"
],
"Resource": "*",
"Effect": "Allow",
"Sid": "StackSetRequiredPermissions"
},
{
"Action": [
"kms:*"
],
"Resource": "*",
"Effect": "Allow",
"Sid": "ManageKMSKeys"
},
{
"Action": [
"ecr:DescribeImageScanFindings",
"ecr:GetLifecyclePolicyPreview",
"ecr:CreateRepository",
"ecr:GetDownloadUrlForLayer",
"ecr:GetAuthorizationToken",
"ecr:ListTagsForResource",
"ecr:ListImages",
"ecr:DeleteLifecyclePolicy",
"ecr:DeleteRepository",
"ecr:SetRepositoryPolicy",
"ecr:BatchGetImage",
"ecr:DescribeImages",
"ecr:DescribeRepositories",
"ecr:BatchCheckLayerAvailability",
"ecr:GetRepositoryPolicy",
"ecr:GetLifecyclePolicy",
"ecr:TagResource"
],
"Resource": "*",
"Effect": "Allow",
"Sid": "ManageECRRepos"
}
]
}
Run Code Online (Sandbox Code Playgroud)
这是管理员
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"cloudformation:*",
"s3:*",
"sns:*"
],
"Resource": "*",
"Effect": …Run Code Online (Sandbox Code Playgroud) 我想要一个 lambda 创建 EventBridge 事件,但在调用 lambda 时出现此错误:
User: arn:aws:sts::120293923901:assumed-role/MyApiOrdersPostFunct-I1QOYC7P1R0Z/MyApiOrdersPostFunct-SJtAeYoiaguW is not authorized to perform: events:PutEvents on resource: arn:aws:events:eu-north-1:120293923901:event-bus/MyApiEventBus because no identity-based policy allows the events:PutEvents action
Run Code Online (Sandbox Code Playgroud)
我添加了政策但没有改变。
这是 lambda 调用 eventbridge。
User: arn:aws:sts::120293923901:assumed-role/MyApiOrdersPostFunct-I1QOYC7P1R0Z/MyApiOrdersPostFunct-SJtAeYoiaguW is not authorized to perform: events:PutEvents on resource: arn:aws:events:eu-north-1:120293923901:event-bus/MyApiEventBus because no identity-based policy allows the events:PutEvents action
Run Code Online (Sandbox Code Playgroud)
这是 CDK 配置。有两个策略(attachInlinePolicy、addToRolePolicy),因为我测试了这两个策略。
import { APIGatewayProxyHandler, APIGatewayProxyResult } from 'aws-lambda';
import { EventBridgeClient, PutEventsCommand } from '@aws-sdk/client-eventbridge';
const eventBridge = new EventBridgeClient({ region: 'eu-north-1' });
export const post: APIGatewayProxyHandler = …Run Code Online (Sandbox Code Playgroud) amazon-web-services amazon-iam aws-lambda aws-cdk aws-event-bridge
我没有团队,除了我的代码使用的编程访问之外,我不想创建范围有限的用户来访问控制台。然而,使用 root 登录很麻烦,因为他们总是要求输入验证码。这导致我无法定期检查我的账单。我会尽可能获得付费验证码解算器扩展,这太糟糕了。因此,我本质上想创建一个具有所有功能的 root 用户,但作为 IAM 用户,因此它不需要验证码。我知道这不是最佳实践,但我又不属于任何一个重要的组织。这不起作用:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 terraform 将以下策略添加到 iam 用户。如何在 upload_user_user 的策略中添加帐户 ID?
resource "aws_iam_user" "product_upload_user" {
name = "cc-${terraform.workspace}-product-upload-user"
}
resource "aws_iam_user_policy" "allow_upload" {
user = aws_iam_user.product_upload_user.name
policy = data.aws_iam_policy_document.allow_upload.json
}
data "aws_iam_policy_document" "allow_upload" {
statement {
sid = "STSToken"
effect = "Allow"
actions = ["sts:GetFederationToken"]
# resources = ["arn:aws:sts::${aws_iam_user.product_upload_user.<account_id>}:federated-user/S3UploadWebToken"]
}
}
Run Code Online (Sandbox Code Playgroud)
尝试实施本教程中的策略:https://next-s3-upload.codingvalue.com/setup
amazon-web-services amazon-iam terraform terraform-provider-aws
我想跑aws s3 sync s3://bucket-in-account-1111 s3://bucket-in-account-2222
我们不想使用存储桶策略,而是希望使用跨账户 IAM 角色。
我们拥有这两个账户,并使用 AWS SSO 访问它们。我通过假定的 SSO 角色对这两个帐户拥有管理员访问权限。
我尝试遵循跨账户 IAM 角色部分中的指导。我收到权限错误An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied。
目标是将对象从 复制bucket-in-account-1111到bucket-in-account-2222
我在帐户 1111 和 2222 中创建了名为role-1111和 的角色role-2222:
role-1111
"sts:AssumeRole"、资源"arn:aws:iam::2222:role/role-2222”role-2222
"s3:*"、资源"aws:arn:s3:::bucket-in-account-2222", "aws:arn:s3:::bucket-in-account-2222/*""sts:AssumeRole",委托人:"AWS: arn:aws:iam::1111:role/role-1111"通过此配置,以我的正常角色登录帐户 1111,
aws s3 ls s3://bucket-in-account-1111aws sts assume-role --role-arn arn:aws:iam::2222:role/role-2222 --role-session-name me@example.com …假设一个组织有自定义 IAM 角色——服务账户被分配了任意数量的角色。每个自定义角色是否有可以分配的最大权限数?
我正在尝试在 AWS CLI 中为 IAM 编写一个命令,在其中我可以获取所有组详细信息、在这些组中添加的用户以及在单个 AWS CLI 中附加到这些组的策略。
任何指示都会有所帮助。
我有一个ThisRole具有以下deny权限的角色:
{
"Sid": "DenyPolicies",
"Effect": "Deny",
"Action": [
"iam:AddUserToGroup",
"iam:AttachGroupPolicy",
"iam:AttachUserPolicy",
"iam:CreateGroup",
"iam:CreateLoginProfile",
"iam:CreateUser",
"iam:DeleteUser",
"iam:DeleteLoginProfile",
"iam:DeleteAccountPasswordPolicy",
"iam:DeleteGroup",
"iam:DeleteGroupPolicy",
"iam:DeleteOpenIDConnectProvider",
"iam:DeleteUserPolicy",
"iam:DeleteVirtualMFADevice",
"iam:DetachGroupPolicy",
"iam:DetachUserPolicy",
"iam:EnableMFADevice",
"iam:RemoveUserFromGroup",
"iam:UpdateGroup",
],
"Resource": "*"
}
Run Code Online (Sandbox Code Playgroud)
以及以下allow权限:
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
Run Code Online (Sandbox Code Playgroud)
我确实想ThisRole创建新角色、创建新角色并更新现有 IAM 策略。这就是为什么iam:CreateRole和喜欢不被拒绝。但这为这个角色打开了后门:
NewRole)。NewRole所有权限本身被拒绝。NewRole(角色链)。ThisRole。允许ThisRole创建新角色/策略、修改现有角色/策略或承担其他角色但仅在其本身被允许做的范围内的最佳方法是什么?
以下是客户端库用于连接Cloud Foundry 的GO代码。
c := &cfclient.Config{
ApiAddress: "https://x.y.z.cloud",
Username: "admin",
Password: "admin",
}
client, _ := cfclient.NewClient(c)
Run Code Online (Sandbox Code Playgroud)
由于密码易读,该源代码容易受到攻击,进入源代码管理。
目前,使用上述代码的应用程序正在Cloud Foundry(PAAS)外部运行。
AWS云(IAAS)引入了称为角色的概念,该角色无需凭证即可进行访问。