SaveMyCert
Log in
5 of 5 free questions left today·for unlimited practice
Data Security and Governance

Applying Authentication Mechanisms: IAM, Secrets Manager, and Networks

12 min readDEA-C01 · Data Security and GovernanceUpdated

Authentication on AWS answers one question: who is making this request? Every data pipeline you build must prove identity at three layers — the AWS API layer (IAM identities and roles signing requests with temporary credentials from AWS STS), the application layer (database passwords and API keys, stored and rotated in AWS Secrets Manager), and the network layer (VPC security groups, VPC endpoints, and AWS PrivateLink deciding which traffic can even reach a service). The DEA-C01 exam tests whether you can wire these layers together for services like AWS Lambda, Amazon API Gateway, Amazon Redshift, and Amazon SageMaker Unified Studio without falling back on long-lived access keys or hard-coded passwords. This lesson walks through IAM users, groups, and roles, credential rotation with Secrets Manager, S3 Access Points and PrivateLink endpoint policies, the managed-versus-unmanaged service split, and how SageMaker Unified Studio organizes access with domains, domain units, and projects.

What you’ll learn
  • Distinguish IAM users, groups, and roles, and explain why roles with temporary STS credentials are preferred for workloads
  • Set up IAM roles for AWS Lambda, Amazon API Gateway, the AWS CLI, and AWS CloudFormation
  • Create, store, and automatically rotate database credentials with AWS Secrets Manager
  • Control network-layer access with VPC security groups, VPC endpoints, AWS PrivateLink, and S3 Access Points
  • Explain the authentication responsibilities you keep with managed versus unmanaged services
  • Describe how SageMaker Unified Studio uses domains, domain units, and projects to scope access

How AWS authenticates a request

AWS authenticates every API call by verifying a cryptographic signature attached to the request. When you call an AWS service — from the console, the AWS CLI, an SDK, or another AWS service — the request is signed with a set of credentials, and IAM resolves those credentials to a principal: an IAM user, an IAM role session, or the account root user. Only after the principal is identified does authorization (policy evaluation) happen. Authentication asks who are you; authorization asks what are you allowed to do. The DEA-C01 exam expects you to keep those two ideas separate.

Credentials come in two flavors. Long-term credentials are an access key ID and secret access key attached to an IAM user — they never expire on their own, which makes them a standing liability if leaked. Temporary credentials are issued by AWS Security Token Service (STS) when a principal assumes a role: an access key, secret key, and session token that expire automatically after the session duration. Almost every exam scenario that mentions hard-coded keys, leaked keys, or credentials in code has the same shape of answer: replace the long-term credentials with an IAM role and temporary STS credentials.

For data engineering this matters everywhere. A Glue job, a Lambda function, a Redshift cluster loading from S3, an EMR cluster's EC2 instances — none of them should hold access keys. Each assumes a role, AWS delivers short-lived credentials to the compute automatically, and rotation is handled for you. Human access follows the same principle: prefer federated identities (through IAM Identity Center) that assume roles over IAM users with passwords and access keys.

IAM users, groups, and roles compared

IAM gives you three identity building blocks, and the exam tests when to use each. An IAM user is a permanent identity with its own credentials, meant for the rare cases where a specific person or legacy system truly needs long-term keys. An IAM group is a collection of users used purely to attach policies once and have them apply to every member — groups cannot be referenced as a principal in resource policies and cannot be assumed; they are a permissions-management convenience, not an identity that authenticates. An IAM role is an assumable identity with no long-term credentials at all: a trust policy defines who may assume it, and permission policies define what the resulting session can do.

IdentityCredentialsWho uses itTypical data-engineering use
IAM userLong-term (password, access keys)A single person or legacy processBreak-glass or legacy CLI access; avoid for workloads
IAM groupNone (not a principal)Collections of usersAttach a data-analyst policy once for a whole team
IAM roleTemporary via STS, auto-expiringAWS services, federated humans, cross-account accessGlue jobs, Lambda execution, Redshift COPY from S3, cross-account lake access

Roles are the default answer for anything automated. A role's trust policy is the authentication gate: for a Lambda execution role it trusts the Lambda service principal; for cross-account access it trusts the other account; for federation it trusts an identity provider. A common gotcha: assuming a role replaces your permissions entirely — the session has the role's permissions, not the union of the role's and the caller's.

Also know the vocabulary of skill 4.1.2: you create and update IAM groups and roles for people and workloads, and you attach policies to endpoints and services — VPC endpoint policies and service-linked or service roles — so that both identities and the paths they travel are governed.

Setting up IAM roles for Lambda, API Gateway, the CLI, and CloudFormation

Each compute or orchestration service authenticates to other AWS services through its own role, and you should be able to name the pattern for each. AWS Lambda uses an execution role: the function assumes it at invocation, and its policies must grant exactly what the function touches — for a pipeline function, perhaps reading one S3 prefix, writing to one Kinesis stream, and fetching one secret from Secrets Manager. Lambda also needs the ability to write CloudWatch Logs, which the AWSLambdaBasicExecutionRole managed policy covers.

Amazon API Gateway plays both sides of authentication. Inbound, it can authenticate callers with IAM authorization (requests signed with SigV4), Amazon Cognito user pools, or Lambda authorizers. Outbound, an API Gateway integration role lets the API call AWS services directly — for example, an API that drops records onto a Kinesis stream without any Lambda in between assumes a role trusted by the API Gateway service principal.

The AWS CLI authenticates with whatever credentials its profile resolves: for humans, prefer IAM Identity Center sign-in, which issues temporary credentials; on EC2 or in containers, the CLI automatically picks up the instance or task role from the metadata endpoint — no keys on disk. Named profiles can also be configured to assume a role, so an engineer authenticates once and pivots into a scoped data-admin role for sensitive operations.

AWS CloudFormation deserves special attention because it is a privilege-escalation vector. By default a stack operates with the permissions of the user who launches it, but you can pass a service role that CloudFormation assumes for all stack operations. That is powerful and dangerous: anyone allowed to launch a stack with that role effectively borrows its permissions. The exam-safe framing is to scope CloudFormation service roles tightly and control who may pass them with the iam:PassRole permission — PassRole is the control that stops a low-privilege user from handing a high-privilege role to a service.

Creating and rotating credentials with AWS Secrets Manager

AWS Secrets Manager exists because some authentication cannot be replaced by IAM roles: databases, third-party APIs, and SaaS platforms still want usernames, passwords, and API keys. Secrets Manager stores those secrets encrypted with AWS KMS, controls retrieval through IAM policies, logs every access in CloudTrail, and — its defining feature — rotates credentials automatically on a schedule.

Rotation works two ways. Managed rotation is available for services like Amazon RDS, Amazon Aurora, Amazon Redshift, and Amazon DocumentDB: Secrets Manager coordinates with the database to change the password and update the secret with no code from you. For anything else, Secrets Manager invokes a rotation Lambda function you supply, which knows how to create and test new credentials against the target system. Two rotation strategies matter for the exam: the single-user strategy changes the password of one database user (brief risk that in-flight connections using the old password fail), while the alternating-users strategy flips between two users so one always holds valid credentials — better for high-availability pipelines. Applications should always fetch the secret at connection time (and refresh on authentication failure) rather than caching it forever, or rotation will break them.

Know the contrast with AWS Systems Manager Parameter Store: Parameter Store also holds configuration and SecureString values cheaply, but it has no built-in rotation. The exam heuristic: if the scenario says rotate, database credentials, or cross-account secret access, the answer is Secrets Manager; if it says plain configuration values at minimal cost, Parameter Store is fine. A concrete pipeline pattern: a Glue connection or Lambda function references a Secrets Manager secret for the Redshift password; its IAM role is granted secretsmanager:GetSecretValue on that one secret's ARN; rotation runs every 30 days; nothing is ever hard-coded.

Managed versus unmanaged services: who owns authentication

The managed/unmanaged distinction (skill 4.1.6) is about how much of the security stack — including authentication — AWS operates for you. With fully managed and serverless services such as Amazon Athena, AWS Glue, AWS Lambda, Amazon Redshift Serverless, and Amazon MSK Serverless, there are no servers you can log into: authentication is IAM end to end, AWS patches the infrastructure, and your responsibility shrinks to writing good policies and protecting your data. With unmanaged or self-managed deployments — databases on EC2, self-hosted Kafka or Airflow, an EMR cluster where you can SSH to nodes — you inherit OS users, SSH keys, database password files, and the patching burden along with them.

Partly managed services sit between the extremes. Amazon EMR on EC2 provisions and monitors the cluster, but the EC2 instances live in your VPC with security groups, instance profiles, and optional SSH access you must govern; EMR Serverless removes those hosts entirely. Amazon RDS manages the OS but leaves database-level users and passwords to you — which is why it pairs so naturally with Secrets Manager rotation.

For the exam, translate scenarios like this: if the requirement stresses minimal operational overhead or no credential management, choose the more managed option (Glue over self-managed Spark, Redshift Serverless over a database on EC2, EMR Serverless over EMR on EC2). If the scenario grants a need for OS-level control or custom software, accept the unmanaged option and expect follow-up questions about the security groups, key pairs, and instance roles you now must maintain.

SageMaker Unified Studio: domains, domain units, and projects

Amazon SageMaker Unified Studio (part of the next generation of Amazon SageMaker) is a single environment where data engineers, analysts, and ML builders work with data, SQL, notebooks, and models — and its access model is built from three nested constructs the exam names explicitly (skill 4.1.7). A domain is the top-level boundary: it holds the user directory integration (typically IAM Identity Center for single sign-on, so people authenticate with corporate credentials rather than IAM users), the associated AWS accounts, and global policies. Domain units are an organizational hierarchy inside the domain — create one per business unit or team, delegate administration of each unit to that team's owners, and organize assets under them so authority is distributed instead of centralized.

Projects are where actual work and authentication meet. A project is a collaboration workspace with its own membership, its own tooling, and — critically — its own project IAM role. When a member runs a query, a notebook, or a job inside the project, the work executes with the project role's permissions, not with the individual's personal AWS credentials. Data and compute made available to the project are available to its members; people outside the project do not see them. Membership therefore becomes the unit of access control: add an analyst to the sales-analytics project and they can immediately query that project's assets with governed, temporary credentials.

The exam-level takeaway: domains establish who can sign in (federated authentication), domain units establish who administers what, and projects establish which role your work runs as. If a scenario asks how to give a cross-functional team shared, governed access to lakehouse data in SageMaker Unified Studio without minting IAM users, the answer is to create a project, add the members, and let the project role carry the permissions.

Scenario: authenticating an end-to-end pipeline

Put the layers together with a realistic build. Your team ingests orders through Amazon API Gateway, transforms them with AWS Lambda, stages them in Amazon S3, and loads them into Amazon Redshift — and security review demands no long-lived credentials and no public network paths.

At the API layer, API Gateway authenticates client apps with a Cognito user pool authorizer, and an integration role trusted by API Gateway writes valid requests to a Kinesis data stream. The Lambda consumer has an execution role scoped to that stream, its S3 staging prefix, and one Secrets Manager secret ARN. Because the function runs in private subnets, it reaches S3 through the gateway endpoint and Secrets Manager and STS through interface endpoints — the endpoint policies allow only this account's principals, and the bucket policy requires the request to arrive through the VPC endpoint. The staging bucket exposes an S3 Access Point restricted to the VPC, so even a leaked bucket name is unreachable from outside.

For the load, Redshift sits in private subnets with a security group allowing inbound only from the Lambda function's security group on the database port. The loader fetches the current database password with GetSecretValue; Secrets Manager rotates it on a 30-day schedule using the alternating-users strategy so loads never fail mid-rotation. Redshift's own COPY authenticates to S3 by assuming an attached IAM role — no keys in the COPY statement. Every credential in this pipeline is either a temporary STS credential or a rotated secret, which is exactly the posture DEA-C01 scenarios reward.

Tip. Expect scenario questions that hand you a pipeline with hard-coded keys or a public network path and ask for the fix: an IAM role with temporary STS credentials, Secrets Manager rotation, a VPC endpoint with an endpoint policy, or a security-group reference. Know which rotation strategy avoids connection failures, when S3 Access Points beat a bucket policy, and the gateway-versus-interface endpoint split. Newer items test SageMaker Unified Studio vocabulary — domains for sign-in, domain units for delegated administration, projects for shared work under a project role.

Key takeaways
  • Authentication proves identity; authorization decides permissions — IAM resolves every signed request to a principal before any policy is evaluated.
  • Prefer IAM roles with temporary STS credentials for all workloads; long-lived access keys in code or config are almost always the wrong answer.
  • IAM groups organize user permissions but cannot authenticate or be assumed; roles have trust policies that define exactly who may assume them.
  • AWS Secrets Manager stores and automatically rotates database and API credentials (managed rotation or a rotation Lambda); Parameter Store stores configuration but does not rotate.
  • Security groups are stateful and allow-only; reference another security group instead of IP ranges to grant compute-to-database access that survives IP changes.
  • Gateway endpoints (S3, DynamoDB) and PrivateLink interface endpoints keep traffic private, and endpoint policies apply IAM controls to the network path itself.
  • S3 Access Points give each team or application its own policy and can be locked to a VPC — the scalable alternative to one giant bucket policy.
  • In SageMaker Unified Studio, domains handle sign-in, domain units delegate administration, and projects run members' work under a shared project IAM role.

Frequently asked questions

When should I use an IAM user instead of an IAM role?

Almost never for workloads. Roles issue temporary credentials that expire automatically, while IAM user access keys live until someone rotates or revokes them. Reserve IAM users for the rare legacy tool that cannot assume a role, and prefer IAM Identity Center federation for people. Every AWS service that runs your code — Lambda, Glue, EMR, Redshift, EC2 — is designed to assume a role instead of holding keys.

What is the difference between Secrets Manager rotation strategies?

The single-user strategy updates the password of one database user in place, which risks briefly failing connections that raced the change. The alternating-users strategy maintains two database users and flips the secret between them, so a valid credential always exists — the safer choice for pipelines that cannot tolerate authentication failures. Managed rotation for services like RDS and Redshift removes the need to write the rotation Lambda yourself.

How do gateway endpoints differ from interface endpoints?

Gateway endpoints exist only for Amazon S3 and DynamoDB, are free, and work by adding entries to route tables — they cannot have security groups. Interface endpoints, powered by AWS PrivateLink, create ENIs with private IPs in your subnets, support most other AWS services plus third-party services, accept security groups, and carry an hourly and data-processing cost. Both types support endpoint policies to restrict what can be accessed through them.

Why would I use S3 Access Points instead of a bucket policy?

A single bucket policy serving many teams grows into an unmanageable, error-prone document with a size limit. Access points give each application or team its own named endpoint with its own dedicated policy, and an access point can be restricted so it only accepts requests from a specific VPC. The bucket policy then just delegates control to the access points, keeping each policy small and auditable.

What roles do domains, domain units, and projects play in SageMaker Unified Studio?

The domain is the top-level environment that integrates your identity provider (usually IAM Identity Center) so users sign in with corporate credentials. Domain units subdivide the domain by team or business unit and let you delegate administration. Projects are the working boundary: members collaborate on shared data and compute, and everything they run executes under the project's IAM role rather than personal credentials.

Is iam:PassRole an authentication control?

It is the guardrail around delegated authentication. When you give a service like CloudFormation, Lambda, or Glue a role to use, you are handing that service an identity. iam:PassRole controls which roles a user is allowed to hand over, preventing a low-privilege user from launching a stack or job that runs with an administrator role. Scope PassRole to specific role ARNs in least-privilege policies.

Test yourself on this topic
Practice questions with full explanations.
Practice now

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.