[AWS] Optional roleSecretRef on SecretStore / ClusterSecretStore (parity with auth.secretRef)
Is your feature request related to a problem? Please describe.
SecretStore / ClusterSecretStore can load AWS access keys via auth.secretRef, but the optional spec.provider.aws.role (IAM role ARN for sts:AssumeRole) must be a plaintext string in the manifest.
In GitOps setups the ClusterSecretStore often lives in Git. If we still need the assume-role hop, the role ARN has to sit in that manifest today (or in Helm values rendered into it). Common workarounds are CI/Argo injecting role at sync time, or keeping the store only in a platform-owned repo. A role ARN is not a credential, but many policies still do not want it in version control—which is why auth.secretRef exists for keys but there is no equivalent for role.
Describe the solution you'd like
Add optional roleSecretRef on AWSProvider, same shape as existing secret key selectors (name, key, namespace on ClusterSecretStore):
spec:
provider:
aws:
service: SecretsManager
region: us-east-1
roleSecretRef:
name: aws-role
key: ROLE_ARN
namespace: platform-secretsAt reconcile time, read the role ARN from the Secret and use it for AssumeRole (providers/v1/aws/auth/auth.go). Mirror auth.secretRef validation: require namespace on ClusterSecretStore; surface store-not-ready style errors when the secret or key is missing.
Treat roleSecretRef as the supported path and deprecate the plaintext role string (warning when set); remove it in a future major release or in the planned v2 release.
If both role and roleSecretRef are set during the transition, reject at admission (or prefer roleSecretRef).
Happy to open a PR if this direction works.
Describe alternatives you've considered
- Omit
roleand grant Secrets Manager / Parameter Store access to the workload principal directly (IRSA /auth.jwt/ default credential chain). This should suffice in most scenarios;roleis optional in aws-access.md. - Platform-owned
ClusterSecretStorein a separate Git repo (ARN stays out of application repos). - Pipeline / sync-time injection of
roleinto the store manifest.
Additional context
Update docs/provider/aws-access.md (and related AWS store examples) with:
- When assume-role is needed vs when the base identity is enough.
- Example manifests:
roleSecretRef, legacyrole(deprecated), and no assume-role with JWT/IRSA.
Alignment before implementation: field name (roleSecretRef vs assumeRoleSecretRef); deprecation/removal of role string in v2; whether additionalRoles needs the same pattern later; refresh behavior when the referenced Secret changes.
Source: external-secrets/external-secrets