Skip to content

iam: CreateServiceLinkedRole, so iam:AWSServiceName has a producer #747

Closed

Description

@scttfrdmn

Follow-up from #730, which surveyed every condition key the 47 bundled AWS managed policies
write about and recorded which have no producer.

iam:AWSServiceName is the largest group — 11 of the 32 condition blocks in
emulator/iam_managed.go — and the most feasible of the producerless keys, because its value
is a direct read of one request parameter rather than something substrate has to infer. It is
blocked only on the operation that carries that parameter not existing.

The 11 statements all have the same shape: a service-linked-role creation allowed only for one
service principal, e.g.

{"Effect":"Allow","Action":"iam:CreateServiceLinkedRole","Resource":"*",
 "Condition":{"StringLike":{"iam:AWSServiceName":"elasticloadbalancing.amazonaws.com"}}}

Substrate has no CreateServiceLinkedRole, so none of them can be exercised, and a consumer
whose CDK/CloudFormation stack creates a service-linked role gets a NotImplemented rather
than the authorization decision the policy describes.

AWS reference: API_CreateServiceLinkedRole.html. Parameters: AWSServiceName (required),
Description, CustomSuffix. It mints a role under the reserved path
/aws-service-role/<service-name>/ with an AWSServiceRoleFor… name and a trust policy naming
the service principal. Errors include InvalidInput, LimitExceeded, NoSuchEntity,
ServiceFailure. Verify all of this against the live page before implementing — do not take
this summary as authoritative.

Acceptance criteria

  • CreateServiceLinkedRole exists, with request/response shape and error codes verified
    against the AWS API reference.
  • The role it mints lives under the reserved path and carries the service trust policy;
    DeleteServiceLinkedRole and GetServiceLinkedRoleDeletionStatus are either implemented
    or explicitly out of scope with a reason.
  • iam:AWSServiceName is populated from the request's own parameter at authorization time,
    so all 11 bundled statements evaluate.
  • A test attaches one of the bundled policies and shows the create allowed for the named
    service principal and denied for another.
  • docs/services.md's producerless-key table drops the row, and the count in the prose
    above it is corrected.

Activity

  1. added this to the v0.109.0 milestone on Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions