English translation
Create a new group
AI Article Decision Snapshot
Turn the lesson into workflow, model, budget, and security checks before choosing tools.
Use this quick snapshot before leaving the article. It keeps the next search tied to practical AI software, model/API, cost, privacy, and implementation questions.
Workflow fit
Identify the real job behind the article: coding, research, document review, support, analytics, content, or internal automation.
Model or tool decision
Decide whether the next step is a software shortlist, an AI tool comparison, an API platform choice, or a model benchmark.
Budget and usage signal
Estimate seats, API calls, prompt volume, retries, review time, and fallback work before assuming the workflow is cheap.
Security and privacy review
Check whether source code, customer data, private documents, prompts, logs, or embeddings will enter the AI workflow.
In the previous tutorial, we explored how to host applications using AWS Elastic Beanstalk. In this tutorial, we’ll dive deep into AWS Identity and Access Management (IAM) and its role management. Security is paramount in cloud environments; therefore, properly configuring permissions and access controls helps safeguard your resources.
What Is IAM?
AWS Identity and Access Management (IAM) is a web service that enables you to securely control access to AWS services and resources. With IAM, you can create and manage users, groups, roles, and permissions—determining who can access your AWS resources and how they can access them.
Core Concepts
- Users: Represent an individual or application identity. Users can be assigned specific permissions.
- Groups: Collections of users. Permissions granted to a group are inherited by all users within it.
- Roles: Sets of permissions that can be temporarily assumed by AWS services, users, or applications—offering greater flexibility than users.
- Policies: JSON-formatted permission definitions specifying which actions are allowed (or denied) on which resources.
Managing IAM Users and Groups
Creating IAM Users and Groups
You can easily create IAM users and groups via the AWS Management Console. Here’s how:
- Sign in to the AWS Management Console.
- Select
IAM. - In the left navigation pane, choose
Users, then clickAdd user. - Enter a user name and configure access type (e.g., access keys).
- After creating the user, you may add them to an existing group—or create a new one.
- Attach permission policies to the group.
Example: Creating Users and Groups Using the AWS CLI
Below is an example of creating users and groups with the AWS CLI:
# Create a new group
aws iam create-group --group-name Developers
# Create a user
aws iam create-user --user-name Alice
# Add the user to the group
aws iam add-user-to-group --group-name Developers --user-name Alice
# Attach a permission policy to the group
aws iam attach-group-policy --group-name Developers --policy-arn arn:aws:iam::aws:policy/AdministratorAccess
IAM Role Management
Defining and Using Roles
An IAM role is a highly flexible concept in AWS—it is not permanently tied to any specific user or group but can be temporarily assumed by AWS services, IAM identities, or applications. Roles let you grant precise permissions to resources such as EC2 instances or Lambda functions.
Creating a Role
You can create roles using either the AWS Management Console or the AWS CLI. Steps include:
- Sign in to the AWS Management Console.
- Select
IAM, then chooseRoles. - Click
Create role. - Select
AWS serviceas the trusted entity and choose the service (e.g., EC2). - Attach appropriate permission policies to the role.
- Complete role creation.
Example: Configuring an IAM Role for an EC2 Instance
Suppose you want your EC2 instance to access an S3 bucket. You can achieve this as follows:
- Create a role with S3 access permissions.
- Assign that role when launching the EC2 instance.
Here’s an AWS CLI example demonstrating role creation and attachment:
# Create an S3 access role
aws iam create-role --role-name S3AccessRole --assume-role-policy-document file://trust-policy.json
# The trust-policy.json file should contain:
# {
# "Version": "2012-10-17",
# "Statement": [
# {
# "Effect": "Allow",
# "Principal": {
# "Service": "ec2.amazonaws.com"
# },
# "Action": "sts:AssumeRole"
# }
# ]
# }
# Attach the S3 read-only access policy
aws iam attach-role-policy --role-name S3AccessRole --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
# Launch an EC2 instance with the role attached
aws ec2 run-instances --image-id ami-abcde123 --instance-type t2.micro --iam-instance-profile Name=S3AccessRole
Best Practices
- Principle of Least Privilege: Grant users and roles only the minimum permissions required to perform their tasks.
- Regular Auditing: Periodically review user and role validity, as well as actual permission usage.
- Enable MFA: Strengthen account security by enabling Multi-Factor Authentication (MFA) for IAM users.
Summary
In this tutorial, we introduced AWS Identity and Access Management (IAM) and demonstrated how to create and manage users, groups, and roles. Next, we’ll explore how to define security policies and fine-tune permissions—ensuring your IAM configurations remain both secure and operationally efficient. If you have questions or need further guidance during IAM implementation, consult the AWS official documentation for comprehensive reference material.
Apply This Lesson
Turn this article into AI software, model, API, and security decisions.
English Article FAQ
Use this article as evidence before choosing AI tools
How should I use this AI Tutorials article?
Use it as the implementation or learning layer, then connect the idea to AI software buyer guides, tool comparisons, benchmarks, API choices, and security checks before making a production decision.
Is this English article different from the Chinese original?
The English edition is localized for global AI readers while preserving the original diagrams, screenshots, prompts, code examples, and source context from the Chinese article.
What should I read after Create a new group?
Continue with AI Software Buyer Guides, AI Tools Workbench, Best AI Coding Agents, AI Model Benchmarks, OpenAI vs Anthropic API, or LLM Security Tools depending on the decision you need to make.
Can this article alone choose an AI product or model?
No. Treat the article as evidence and context, then validate fit with pricing, privacy requirements, integration effort, benchmark results, workflow tests, and fallback planning.
Continue