c7n-org cannot deploy policies in multiple account same error occurring #7458
-
Ask your questionI am trying to get custodian to do this ... @kapilt I'm having the same problem deploying c7n-org policies; I'm trying to auto tag ec2 instances in the managed account once they are launch but I'm getting same error that is mentioned. Just for the testing purpose I even gave root account and managed account role full admin permission but still getting the same error. I'm not sure what is wrong with my permission PolicyMy managed acct trust policy is as followed
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::11111111:role/custodainrole",
"Service": [
"lambda.amazonaws.com",
"ec2.amazonaws.com"
]
},
"Action": "sts:AssumeRole"
}
]
}
Policy attach is [AWSLambdaExecute], [AWSConfigRulesExecutionRole], & EC2FullAccess. And inline policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "lambda:*",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"iam:GetRole",
"iam:PassRole"
],
"Resource": "arn:aws:iam::root-account#:role/custodainrole"
}
]
} Relevant log/traceback outputrunning policy:cloud-custodian-auto-tag account:devops-account region:us-west-2 error:An error occurred (AccessDeniedException) when calling the CreateFunction operation: Cross-account pass role is not allowed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Permission policies:
Still getting error: I cannot get around this error even when starting from scratch |
Beta Was this translation helpful? Give feedback.
-
Did anyone manage to solve this issue? Searched the internet seems no one has a clear solution :( |
Beta Was this translation helpful? Give feedback.
Permission
policies:
resource: ec2
mode:
type: cloudtrail
role: arn:aws:iam::account_id#:role/AmazonSSMRoleForInstancesQuickSetup
events:
tags:
custodian-info: mode=cloudtrail:version=0.9.16
filters:
actions:
tag: CreatorName
key: backup
value: weekly
Still getting error: I cannot get around this error even when starting from scratch