AWS Builder Center

How we collaborated on a new AWS project without configuring IAM

Build an API Gateway collaboratively on AWS in the same Project.

Developer Advocate @ AWS
Building in the cloud is usually a team effort. One developer starts an API, a second adds a feature, and a third prepares it for production. AWS projects give you a shared place to organize resources and build with teammates.
A project owner can invite team members directly from AWS Settings without creating an IAM user or configuring a human access role for each person. After accepting an invitation, a team member can open the shared project in the AWS Management Console and work with its resources.
In this post, two developers will build a small API together:
  • The project owner will create a project and invite a team member.
  • The owner will create a GET /health route using Amazon API Gateway and AWS Lambda.
  • The team member will accept the invitation and add a GET /version route backed by a second Lambda function.
  • Both developers will verify the completed API with curl.
If this is your first time signing up for AWS , you can begin with a login you already own from Google, GitHub, Apple, or Amazon. AWS creates an AWS Builder ID, a personal profile that represents you as an individual, and provisions your first project. A project contains a single AWS account where you create resources, along with settings for sharing the project with collaborators.
You create, access, and share projects from AWS Settings . If you already have a project and are familiar with these terms, you can continue with the walkthrough below.
For this walkthrough, the project owner uses a project named TeamStatusAPI. To match the steps and screenshots, create a separate project for the example:
    1. Open AWS Settings.
    2. In the main navigation pane, choose Project.
    3. Choose Create project.
    4. For Project name, enter TeamStatusAPI.
    5. Choose Create.
AWS assigns the project a Region based on the country in the owner's contact address. Before creating Regional resources, confirm the project's Region in AWS Settings. When the project is ready, open it and enter the AWS Management Console.
TeamStatusAPI project overview in AWS Settings

Invite a team member

The project owner can invite another person from AWS Settings:
    1. Open AWS Settings.
    2. In the main navigation pane, choose Team.
    3. Choose Invite new team member.
    4. Enter the team member's email address.
    5. Select the TeamStatusAPI project.
    6. Choose Send invitation.
You can also invite someone from the project's Members area. Invitations are valid for 14 days. The recipient needs an AWS Builder ID to access the project and can create one if needed.
For this human access flow, the project owner does not create an IAM user or configure a human access role for the team member. AWS provides the access the owner and team member use to enter the project.
A team member has admin access to the project's AWS resources. They can view, create, edit, and delete resources and access the AWS services available for the project. The owner retains project-management and financial responsibilities.
While the invitation is on its way, the project owner can create the API's first route.

Create the first API route

The project owner starts with a Lambda function that reports the health of the service.
In the Lambda console, create a function named project-health using a supported Python runtime. Replace the starter code with the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
import json

def lambda_handler(event, context):
return {
"statusCode": 200,
"headers": {
"content-type": "application/json"
},

"body": json.dumps({
"status": "healthy"
})
}
Deploy the function. Then open the API Gateway console and create an HTTP API named project-info-api:
    1. Add project-health as a Lambda integration.
    2. Create a GET /health route that uses the integration.
    3. Use the $default stage with automatic deployment enabled.
    4. Create the API and copy its invoke URL.
Set the invoke URL as a shell variable and call the new route:
1
2
3
API_URL="https://<api-id>.execute-api.<region>.amazonaws.com"

curl -s "$API_URL/health"
The response should be:
1
{"status":"healthy"}
With the starting point ready, the invited team member can enter the project and add the next capability.

Accept the invitation and enter the shared project

The team member opens the invitation email and follows its link. After accepting the invitation and signing in, they can find TeamStatusAPI in AWS Settings.
From the project, they enter the AWS Management Console. The project name in the upper-right corner confirms which project they are currently using. The API and Lambda function created by the owner are available in the standard service consoles.

Add a second route as the team member

The team member will extend the API with version information. First, create another Lambda function in the project's assigned Region. Name it project-version and use this code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

import json

def lambda_handler(event, context):
return {
"statusCode": 200,
"headers": {
"content-type": "application/json"
},
"body": json.dumps({
"version": "1.0.0",
"environment": "development"
})

}
Deploy the function. Then return to the project-info-api HTTP API in API Gateway:
    1. Create a Lambda integration for project-version.
    2. Add a GET /version route.
    3. Attach the new route to the project-version integration.
    4. Confirm that the $default stage has deployed the change.
The team member has now added a new function and connected it to an API that the project owner started.

Verify the completed API

Either developer can now call both routes. Use the same invoke URL from earlier:
1
2
3
4
5
6
7
8
9
10
11
12

API_URL="https://<api-id>.execute-api.<region>.amazonaws.com"



curl -s "$API_URL/health"

echo

curl -s "$API_URL/version"

echo
The terminal displays two responses:
1
2
3
4

{"status":"healthy"}

{"version":"1.0.0","environment":"development"}
With a small example, we have demonstrated the complete collaboration path: one developer created a project and started an API; another accepted an invitation, entered the same project, and added a working endpoint.

Understand the access boundary

Project sharing simplifies access for people. It does not replace application security design.
The invitation flow means you do not need to create an IAM user or role for each team member. Within the project, AWS provides both the owner and team member with admin access to project resources, subject to the documented differences between their roles.
This walkthrough uses a public HTTP API that returns only static JSON. For a production API, configure authorization appropriate to your application.

Clean up

This walkthrough creates an API Gateway HTTP API and two Lambda functions. When you finish capturing the example:
    1. Delete project-info-api from API Gateway.
    2. Delete the project-health and project-version Lambda functions.
    3. Remove the team member from the project if they no longer need access.
Removing a team member does not delete resources they created. The project owner remains responsible for managing those resources and the project's charges.

Build something together

AWS lets builders go from creating an environment to collaborating in it without per-person IAM setup. Projects help organize related resources, and AWS Settings gives project owners one place to invite and manage team members.
Once a team member accepts an invitation, both people can work with the project's resources in the familiar AWS Management Console. In our example, that meant extending an API from one route to two. This model works for larger applications too: start a project, invite the people building with you, and contribute within a shared AWS environment.

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article