Invalid json - I AM policy

0

{ "Version": "2012-10-17", "Statement": [ {"Effect": "Allow", "Principal": {"Service": [ "healthlake.amazonaws.com" ] }, "Action": "sts:AssumeRole" "Condition": { "StringEquals": { "aws:SourceAccount": "(accountId)" }, "ArnEquals": { "aws:SourceArn": "arn:aws:healthlake:(region):(accountId):datastore/fhir/(datastoreId)" } } } ] }

When i am trying to create i am policy this json gives syntax error.....

anurag
질문됨 2달 전143회 조회
1개 답변
0

2 Issues. You were missing a Resource and also you do not specify a Principal on an IAM policy. Principals are only used on resource policies. Confirm the Resource you’re happy with * and this is valid.

However you don’t need the conditions imho as the policy is attached to a role in the same account. There may be some confusion here with IAM policy and a Resource policy.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "sts:AssumeRole",
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:SourceAccount": "(accountId)"
                },
                "ArnEquals": {
                    "aws:SourceArn": "arn:aws:healthlake:(region):(accountId):datastore/fhir/(datastoreId)"
                }
            }
        }
    ]
}

You may need to create a service role and configure the Trust for healthlake.amazonaws.com and attach the policy above.

profile picture
전문가
답변함 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠