Authentication and access to resources
DEA-C01 · Lesson 19 of 23 · 2:48:01
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the DEA-C01 exam (AWS Certified Data Engineer – Associate). In this lesson: security groups as stateful firewalls, gateway and interface VPC endpoints with endpoint policies, IAM roles and temporary credentials for services and AWS CLI profiles, AWS Secrets Manager and credential rotation, and domains, domain units, and projects in Amazon SageMaker Unified Studio. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Locked out of S3
AnyCompany Games moves its pipelines into private subnets, and the first Glue job fails: it cannot reach S3 anymore. The Redshift password sits in a script, unchanged for two years, and each new team asks for admin access. This lesson covers network access, identities and roles, credentials and secrets, and managed services with SageMaker Unified Studio.
Network access
A security group acts as a virtual firewall for a resource, with inbound and outbound rules that set the source or destination, the port range, and the protocol. Security groups are stateful, so the response to allowed traffic goes back out, and the default outbound rule allows all traffic. To let a Glue job reach a Redshift cluster, add an inbound rule to the Redshift security group that allows its port from the security group of the job, rather than from a wide range of addresses. A gateway VPC endpoint gives private subnets access to S3 and DynamoDB through a route in the route table, without an internet gateway or a NAT device, while interface endpoints use AWS PrivateLink for other services. An endpoint policy, a resource-based policy on the endpoint, limits the principals and resources that it allows, and without one, the default policy allows full access.
Identities and roles
An IAM user group gives the same identity-based policies to all its users, and a user can belong to several groups, but groups cannot be nested, and a group is never a principal in a policy. Services act through roles: Lambda assumes the execution role of a function each time it runs, for example to write logs to CloudWatch or read from S3. A CloudFormation service role lets a stack create, change, or delete resources with only the permissions of that role, even when the person who deploys it has more. The AWS CLI can switch to a role with a profile that names the role and a source profile, and when an API Gateway API uses IAM authorization, callers need the permission to invoke it. S3 access points are named endpoints on a bucket, each with its own policy and network controls, so each team gets its own entry point, and one can accept requests only from a VPC.
Credentials and secrets
Never write passwords or access keys in scripts or job parameters: roles give temporary credentials to services, and secrets belong in AWS Secrets Manager. Your code reads the secret at run time with an API call, through a role that allows it, so no password appears in the code. Rotation changes the credentials both in the secret and in the database or service, and Secrets Manager can rotate a secret automatically. For most managed secrets, managed rotation is configured and run by the service itself, with no Lambda function. For other secrets, a rotation Lambda function changes the password in the database and stores the new one, so applications always read the current version.
Managed services and Unified Studio
With an unmanaged service, like Kafka or Spark that you install on EC2 instances, you patch the operating system and the software, and you configure the firewall. With a managed, abstracted service, like S3 or DynamoDB, AWS runs the infrastructure, the operating system, and the platform, and you manage your data, access, and settings. In SageMaker Unified Studio, a domain connects your assets, users, and projects, with IAM Identity Center or IAM for authentication. Domain units organize assets under business units and teams, and their owners set authorization policies, for example on who can create projects from a project profile. A project is a boundary where users collaborate on a business use case, with the tools and resources of its project profile, and its members share data and resources.
Access at AnyCompany Games
Here is the setup at AnyCompany Games: Glue jobs run in private subnets, and reach S3 through a gateway endpoint whose policy allows only the buckets of the company. The Redshift security group allows its port only from the security group of the Glue jobs, and the Redshift password is a secret in Secrets Manager, rotated automatically. Every Lambda function has its own execution role, and stacks deploy with a CloudFormation service role limited to data resources. And in SageMaker Unified Studio, one domain has a domain unit for each game studio, with a project for each team.
Recap
Let's recap. Security groups are stateful firewalls: allow ports from other security groups, not from wide ranges. Gateway endpoints serve S3 and DynamoDB, interface endpoints use PrivateLink, and endpoint policies limit what they allow. Roles give services temporary credentials: execution roles, service roles, and roles in CLI profiles. Secrets Manager stores credentials and rotates them, with managed rotation or a Lambda function. And in Unified Studio, domains, domain units, and projects organize users, assets, and permissions.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
After a move to private subnets, a Glue job can no longer read S3, and by policy, the VPC has no internet gateway or NAT device. What should the data engineer add?
- A NAT gateway in a new public subnet
- An internet gateway attached to the VPC
- A gateway VPC endpoint for Amazon S3
- An inbound rule for S3 on the security group of the job
Show the answer
A gateway VPC endpoint for Amazon S3
A gateway endpoint adds a route to S3 in the route table, so private subnets reach S3 with no internet gateway or NAT device. “A NAT gateway in a new public subnet” would add a NAT device, which the policy forbids. “An internet gateway attached to the VPC” would connect the VPC to the internet, which the policy also forbids. And “An inbound rule for S3 on the security group of the job” would change inbound traffic, while the job starts the connection to S3.
Glue jobs connect to an RDS for MySQL database with a password that never changes, written in a script. The security team wants the password out of the code, and changed automatically every month. What should the data engineer use?
- An IAM user group for the Glue job roles
- A new password, in the job parameters
- A security group rule on the port of the database
- A Secrets Manager secret, rotated automatically
Show the answer
A Secrets Manager secret, rotated automatically
The jobs read the secret at run time, with no password in the code, and rotation changes the password in the secret and in the database. “An IAM user group for the Glue job roles” would group users, without storing or changing any password. “A new password, in the job parameters” would still show the password in plain text. And “A security group rule on the port of the database” would control network traffic, not the password.
Developers deploy CloudFormation stacks for their pipelines, and some of them are administrators. The stacks must only create Glue and S3 resources, whoever deploys them. What should the data engineer set up?
- A service role for the stacks, Glue and S3 only
- An IAM user group for all of the developers
- An S3 access point, one for each developer
- A Lambda execution role, one for each stack
Show the answer
A service role for the stacks, Glue and S3 only
With a service role, CloudFormation creates resources with the permissions of that role only, even when an administrator deploys the stack. “An IAM user group for all of the developers” would group developers, but administrators would keep all their permissions. “An S3 access point, one for each developer” would control access to data, not what a stack can create. And “A Lambda execution role, one for each stack” would give permissions to a function, not to CloudFormation.