AWS Cloud Control API uses AWS CloudFormation resource providers, which may invoke additional API operations beyond the primary service API. As a result, GetResource for an Amazon Bedrock Agent can return AccessDenied even when GetAgent succeeds. This article explains why, how to identify missing permissions using AWS CloudTrail, and the IAM permissions that can help resolve the issue.
Overview:
A common point of confusion when working with AWS Cloud Control API is encountering an AccessDenied error from GetResource for an Amazon Bedrock Agent, even though direct Bedrock API calls such as GetAgent succeed using the same IAM role.
This behavior is expected due to how Cloud Control API operates behind the scenes.
Root Cause:
AWS Cloud Control API does not always invoke a single service API when processing a resource request.
Instead, it relies on CloudFormation resource providers, which may perform additional API calls to construct a complete representation of the resource.
For Amazon Bedrock Agents, a GetResource request can trigger:
-
bedrock-agent: GetAgent (primary resource read)
-
bedrock:ListTagsForResource (retrieve resource tags)
-
Additional bedrock-agent:List* or bedrock-agent:Describe* operations depending on the resource provider implementation
Because Cloud Control API aggregates the results of these operations, failure of any underlying API call causes the entire GetResource request to fail.
As a result, a role that can successfully call GetAgent directly may still receive an AccessDenied error when using Cloud Control API.
How to Diagnose the Issue:
CloudTrail is the most effective way to identify the missing permission.
Step 1: Enable CloudTrail Logging
Ensure CloudTrail is capturing management events for the account and region where the request is executed.
Step 2: Reproduce the Failure
Invoke the Cloud Control API GetResource operation for the Bedrock Agent.
Step 3: Search CloudTrail
Look for events matching the following criteria:
- invokedBy = "cloudformation.amazonaws.com"
- errorCode = "AccessDenied"
- eventSource = "bedrock.amazonaws.com" or "bedrock-agent.amazonaws.com"
A typical finding is a denied ListTagsForResource call initiated by CloudFormation on behalf of Cloud Control API.
Minimal Permissions Required:
If the failure is caused by missing tag permissions, the following permissions are typically sufficient:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"bedrock-agent:GetAgent",
"bedrock:ListTagsForResource",
"cloudcontrol:GetResource"
],
"Resource": "*"
}]
}
Recommended Permissions for Cloud Control API:
The exact IAM permissions required by Cloud Control API depend on the CloudFormation resource provider implementation and may change over time. While AWS documentation does not prescribe a fixed set of read permissions for this scenario, based on observed behaviour, and to improve compatibility with current and future CloudFormation resource provider implementation, consider granting read-only permissions across relevant Bedrock APIs:
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "BedrockAgentCloudControlAccess",
"Effect": "Allow",
"Action": [
"bedrock-agent:Get*",
"bedrock-agent:List*",
"bedrock-agent:Describe*",
"bedrock:Get*",
"bedrock:List*",
"cloudcontrol:GetResource",
"cloudcontrol:ListResources"
],
"Resource": "*"
}]
}
Additional Considerations:
-
IAM Permission Propagation:
IAM policy updates are not always immediate. New permissions can take several minutes to become effective across AWS services.
-
Credential Caching:
Applications running on EC2 instances, containers, or other compute services may cache credentials. Even after updating permissions, cached credentials may continue to
be used until refreshed.
-
Applies Beyond Bedrock Agents:
This behavior is not unique to Bedrock Agents. The same pattern can occur with other AWS::Bedrock::* resource types and, more broadly, with any resource managed
through Cloud Control API where the underlying CloudFormation provider performs supplemental API calls.
-
Key Takeaway
- When troubleshooting Cloud Control API authorization failures, do not assume that permission to the primary service API is sufficient.
- Cloud Control API often executes additional read, list, describe, and tag-related operations through CloudFormation resource providers. Reviewing CloudTrail logs for requests initiated by "cloudformation.amazonaws.com" is usually the fastest way to identify the exact missing permission and resolve the issue.